cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco SDK Samples - FirstFoundationClient not able to run

heyitsaakash
Champ in-the-making
Champ in-the-making
Hi
I have installed War file of alfresco 2.9 on jboss server 4.2.3GA. After that I am trying to run some sample examples
I am trying to execute the FirstFoundationClient.java after following the steps given in the http://wiki.alfresco.com/wiki/Alfresco_SDK link.

However, I am not able to run the program. Everytime i try i get an error  given below:

————————————————————————————————————
Exception in thread "main" java.lang.NullPointerException
   at org.alfresco.util.RuntimeSystemPropertiesSetter.postProcessBeanFactory(RuntimeSystemPropertiesSetter.java:68)
   at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:414)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:328)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
   at org.alfresco.util.ApplicationContextHelper.getApplicationContext(ApplicationContextHelper.java:55)
   at org.alfresco.sample.FirstFoundationClient.main(FirstFoundationClient.java:69)

——————————————————————————————————————————————-


I have changed customrepository.xml as follows of the firstfoundationclient as follows:

dir.root=./alf_data
#dir.root=C:\jboss-4.2.3.GA\bin\alf_data

db.username=alfresco
db.password=alfresco

# MySQL connection (This is default and requires mysql-connector-java-3.1.12-bin.jar, which ships with the Alfresco server)
#
db.driver=org.gjt.mm.mysql.Driver
db.url=jdbc:mysql://localhost/alfresco

—————————————————-
Earlier i was getting some issues while trying to build the project after that I added all the jars present in the exploded war file of alfresco (e.g \alfresco\WEB-INF\lib). THus it was able to recognize the spring related classes like org.springframework.context.ApplicationContext

Can someone please help me out. I am not able to find any proper help on how to proceed and not able to trace where I am going wrong.

Any help is appreciated.

Best Regards,
Aakash Sharma
4 REPLIES 4

sathishkumark
Champ in-the-making
Champ in-the-making
Hi,
Please find all the custom-repository.properties in all the samples. and find and change the jdbc driver of yours in the custom-repository.properties and custom-hibernate-dialect.properties files @ the shared\classes\alfresco\extension location of your app server.

Then run your app server first to run all the dbscripts to get run and should create the schema first and it should end successfully then u shut the app server and then run the FirstFoundationClient.java and it will run and update the same schema created by ur app server. and will be successfull.

Then again start ur app server and hit the alfresco application to see the content created in ur company home space… let me know when u gets it  Smiley Happy

Thanks & Regards,
Sathish kumar.K

heyitsaakash
Champ in-the-making
Champ in-the-making
Thanks Satish.
FInally managed to get it running and able to see the FirstFoundation file in company folder : Smiley Tongue

This time I created the database using the scripts in the \extras\databases\mysql. I did not started the webserver at this point. But i executed the first foundation client after doing the required changes in the properties file and including the dependencies. This meant that the schema will be created through this program and not through the scripts when i restart the sever after putting the war file.

After this i ran the webserver and was able to view the results succcesfuly.

Best Regards,
Aakash Sharma

cttrang
Champ in-the-making
Champ in-the-making
Hi,
The version of SDK I use is 2.9B, and the Alfresco is 3lab-full.I use with Tomcat 5.5 and MySQL server.
When I run FirstFoundationClient, I have the same problem. And I have followed your instruction, but I still get this error:

————————————————————————————————————————————————
Exception in thread "main" java.lang.NullPointerException
   at org.alfresco.util.RuntimeSystemPropertiesSetter.postProcessBeanFactory(RuntimeSystemPropertiesSetter.java:68)
   at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:414)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:328)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
   at org.alfresco.util.ApplicationContextHelper.getApplicationContext(ApplicationContextHelper.java:55)
   at org.alfresco.sample.FirstFoundationClient.main(FirstFoundationClient.java:69)
————————————————————————————————————————————————

Besides, I can't find out the file custom-hibernate-dialect.properties in Alfresco SDK.

This is my custom-repository.properties file:

# Sample custom content and index data location
#

dir.root=C:/Alfresco/alf_data


db.username=alfresco
db.password=alfresco

#
# MySQL connection (This is default and requires mysql-connector-java-3.1.12-bin.jar, which ships with the Alfresco server)
#
db.driver=C:/Alfresco/tomcat/shared/classes/alfresco/extension
db.url=jdbc:mysql://localhost/alfresco
————————————————————————-

I appreciate any help.

Thanks and Regards

carolanna
Champ in-the-making
Champ in-the-making
Hi
am getting this error when i run FirstFoundationClient of sdk samples
Please help me.Am stuck with this.

java.lang.UnsupportedClassVersionError: Bad version number in .class file
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
   at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Exception in thread "main"


Thanks & Regards
Carol Anna