Hi Jeremy,
it looks to me that you simply have classpath issues. I think that
the classloader that is used from within your elements somehow isn't
the same as the classloader that is used when the repository starts
up. This is the only explanation that I can think of. It will result
in this behavior since the static reference to the default repository
will be different for the both pieces of code.
I added your code to the jumpstart and used exactly the files and
configurations that you provided, and the config instance is
correctly retrieved. I get another error later, but that is about
something else, the initialize() method of SACConfigurationBean has
already run by then:
java.lang.NullPointerException
at net.collab.extranet.sac.elements.ApplicationInitializer
$Deployer.bootstrapConfiguration(ApplicationInitializer.java:61)
at net.collab.extranet.sac.elements.ApplicationInitializer
$Deployer.deploy(ApplicationInitializer.java:34)
at com.uwyn.rife.engine.ElementInfo.deploy(ElementInfo.java:280)
at com.uwyn.rife.engine.SiteBuilder.setupElements(SiteBuilder.java:984)
at com.uwyn.rife.engine.SiteBuilder.setupData(SiteBuilder.java:1618)
at com.uwyn.rife.engine.SiteBuilder.finish(SiteBuilder.java:261)
at com.uwyn.rife.engine.SiteBuilder.process(SiteBuilder.java:252)
at com.uwyn.rife.engine.SiteBuilder.getSite(SiteBuilder.java:178)
at com.uwyn.rife.rep.participants.ParticipantSite.initialize
(ParticipantSite.java:36)
at com.uwyn.rife.rep.BlockingParticipant.run
(BlockingParticipant.java:252)
at java.lang.Thread.run(Thread.java:613)
Do you get this error in development mode or when you create a war
file? Normally, with a war file you shouldn't have to worry about
classpath issues at all, it should just work inside a servlet
container. If the error disappears like this, it's 100% sure that
something isn't totally right with how things are setup for
development. I suggest that you double-check that all locations where
classes and resources are read from for usage inside your web
application are added to the rife.webapp.path JVM property, however
leave servlet container jars outside of it. A good rule is to include
just the directories that will end up inside the file .war file. You
don't need to add each individual one if they all have the same
parent directory, you can then simply use the parent path. However,
if you do that you have to be careful again that the parent path
doesn't also contain directories that contain classes or jar files
that shouldn't be packaged in the war file.
I hope this helps, let me know how it goes.
Best regards,
Geert
On 16 Dec 2006, at 06:45, Jeremy Whitlock wrote:
Geert,
The source you have is for when I had the System.out.println
(config) in there. This means that with the line breaks and the
System.out call, the NPE occurred during the first call to
config.getString(). Trust me, I ran the debugger and have
outputted the config object to verify that this is in fact due to
the Config being null and not a value I look for. Just to verify,
here is the new error output with the proper matching line numbers:
java.lang.NullPointerException
at
net.collab.extranet.sac.beans.SACConfigurationBean.initialize
(SACConfigurationBean.java:28)
at net.collab.extranet.sac.elements.ApplicationInitializer
$Deployer.deploy (ApplicationInitializer.java:31)
at com.uwyn.rife.engine.ElementInfo.deploy(ElementInfo.java:
280)
at com.uwyn.rife.engine.SiteBuilder.setupElements
(SiteBuilder.java:984)
at com.uwyn.rife.engine.SiteBuilder.setupData
(SiteBuilder.java:1618)
at com.uwyn.rife.engine.SiteBuilder.finish(SiteBuilder.java:
261)
at com.uwyn.rife.engine.SiteBuilder.process
(SiteBuilder.java:252)
at com.uwyn.rife.engine.SiteBuilder.getSite
(SiteBuilder.java:178)
at com.uwyn.rife.rep.participants.ParticipantSite.initialize
(ParticipantSite.java:36)
at com.uwyn.rife.rep.BlockingParticipant.run
(BlockingParticipant.java:252)
at java.lang.Thread.run (Thread.java:595)
This stack trace matches the code I emailed earlier. I know you
are doing your due diligence but I assure you, the problem is
because the Config object is null. I can add a System.out.println
(config) if you'd like.
Take care,
Jeremy
--
Geert Bevin
Uwyn "Use what you need" - http://uwyn.com
RIFE Java application framework - http://rifers.org
Music and words - http://gbevin.com
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users