cancel
Showing results for 
Search instead for 
Did you mean: 

at org.alfresco.util.RuntimeSystemPropertiesSetter.postProce

lakshmi
Champ in-the-making
Champ in-the-making
Hi,

I wrote a class JCRManagerMeta class that will write contents to repository, and tried to run the class from command line(after placing all the required jars in classpath).It throws the following error when i load the application-context.xml in classpath :

xception thrown at this code:
ApplicationContext context = new ClassPathXmlApplicationContext("classpath:alfresco/application-context.xml");

Error stack trace:

java.lang.NullPointerException
        at org.alfresco.util.RuntimeSystemPropertiesSetter.postProcessBeanFactor
y(RuntimeSystemPropertiesSetter.java:68)
        at org.springframework.context.support.AbstractApplicationContext.invoke
BeanFactoryPostProcessors(AbstractApplicationContext.java:416)
        at org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:330)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<i
nit>(ClassPathXmlApplicationContext.java:92)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<i
nit>(ClassPathXmlApplicationContext.java:77)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<i
nit>(ClassPathXmlApplicationContext.java:68)
        at com.cognizant.digitalmedialab.cms.busines.JCRManagerMeta.getJCRReposi
tory(JCRManagerMeta.java:46)
        at com.cognizant.digitalmedialab.cms.busines.Listener$Task.run(Listener.
java:61)
        at java.util.TimerThread.mainLoop(Unknown Source)
        at java.util.TimerThread.run(Unknown Source)

This error is thrown while loading the application-context.xml in classpath.I added all the jars that are needed for alfresco into my classpath.

What am i missing here? Am i missing any jar that is needed?

Help if anyone knows the solution?

Thanks in advance.

Lakshmi
3 REPLIES 3

renspr
Champ in-the-making
Champ in-the-making
Hi,

I assume you use a version from svn. I had the same error while embedding a trunk version of alfresco in my own project.

Make sure you have the files 'alfresco/alfresco-jmxrmi.access' and 'alfresco/alfresco-jmxrmi.password' in your classpath. It should work now.

regards, René

prophecy
Champ in-the-making
Champ in-the-making
I ran into the same problem and got it working after a while, but could one of the developers catch the NPE and throw with a better error message?

RuntimeSystemPropertiesSetter, line 68.

I am packaging things up in a jar and ran into the same problem again, obviously a classpath issue, but it would be nice to know where and why.

Thanks in advance. (Great product btw!).

prophecy
Champ in-the-making
Champ in-the-making
FYI for anyone that runs into this problem, it looks like config.jar in the Alfresco SDK has the alfresco/alfresco-jmxrmi.password and this will cause an exception here because toURI().getPath() in RuntimeSystemPropertiesSetter:

          
 path = loader.getResource("alfresco/alfresco-jmxrmi.password").toURI().getPath();

returns null.

To find out of this is the problem, run this before loading Alfresco:

ClassLoader loader = Thread.currentThread().getContextClassLoader();
        String path=null;
        try
        {
           URL url = loader.getResource("alfresco/alfresco-jmxrmi.password");
           System.out.println("url: " + url);
           path = url.toURI().getPath();
           System.out.println("path: " + path);
        }
        catch (java.net.URISyntaxException e ) { e.printStackTrace(); }

The fix is to have all the config files extracted out of config.jar then delete config.jar.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.