Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » get rid of -Djava.endorsed.dirs="/opt/local/share/java/tomcat6/endorsed"(java wtp spring @Autowired)
get rid of -Djava.endorsed.dirs="/opt/local/share/java/tomcat6/endorsed" [message #834899] Mon, 02 April 2012 14:35 Go to next message
Joël Krähemann is currently offline Joël KrähemannFriend
Messages: 3
Registered: April 2012
Junior Member
Hi, I read on stackoverflow.com that -Djava.endorsed.dirs="/opt/local/share/java/tomcat6/endorsed" causes spring loading to fail during tomcat6 startup with wtp plugin. But when I delete it from tomcat6 launch configuration next time I open it again it's still there, so what's happening?

a snippet from web.xml
...

<listener>
  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

...


which causes:

16:31:49,941 ERROR ContextLoader:313 - Context initialization failed
java.lang.ExceptionInInitializerError
	at org.springframework.context.support.AbstractRefreshableApplicationContext.createBeanFactory(AbstractRefreshableApplicationContext.java:195)
	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:128)
	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:522)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:436)
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
	at org.apache.catalina.core.StandardService.start(StandardService.java:525)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.NullPointerException
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.<clinit>(DefaultListableBeanFactory.java:106)
	... 22 more
02.04.2012 16:31:49 org.apache.catalina.core.StandardContext listenerStart
SCHWERWIEGEND: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.ExceptionInInitializerError
	at org.springframework.context.support.AbstractRefreshableApplicationContext.createBeanFactory(AbstractRefreshableApplicationContext.java:195)
	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:128)
	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:522)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:436)
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
	at org.apache.catalina.core.StandardService.start(StandardService.java:525)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.NullPointerException
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.<clinit>(DefaultListableBeanFactory.java:106)
	... 22 more
02.04.2012 16:31:49 org.apache.catalina.core.StandardContext start
SCHWERWIEGEND: Error listenerStart
02.04.2012 16:31:49 org.apache.catalina.core.StandardContext start
SCHWERWIEGEND: Context [/docadmin] startup failed due to previous errors
02.04.2012 16:31:49 org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
02.04.2012 16:31:49 org.apache.catalina.core.StandardContext listenerStop
SCHWERWIEGEND: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
	at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:172)
	at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1066)
	at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1040)
	at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:988)
	at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:556)
	at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:142)
	at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4244)
	at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4879)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4749)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
	at org.apache.catalina.core.StandardService.start(StandardService.java:525)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
16:31:49,955  WARN XmlWebApplicationContext:1028 - Exception thrown from ApplicationListener handling ContextClosedEvent
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: Root WebApplicationContext: startup date [Mon Apr 02 16:31:49 CEST 2012]; root of context hierarchy
	at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:337)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:324)
	at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1025)
	at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:988)
	at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:556)
	at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:142)
	at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4244)
	at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4879)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4749)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
	at org.apache.catalina.core.StandardService.start(StandardService.java:525)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
16:31:49,956  WARN XmlWebApplicationContext:1036 - Exception thrown from LifecycleProcessor on context close
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Mon Apr 02 16:31:49 CEST 2012]; root of context hierarchy
	at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:350)
	at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1033)
	at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:988)
	at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:556)
	at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:142)
	at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4244)
	at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4879)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4749)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
	at org.apache.catalina.core.StandardService.start(StandardService.java:525)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)



You can download project from sourceforge.net it's name is docadmin

Re: get rid of -Djava.endorsed.dirs=&quot;/opt/local/share/java/tomcat6/endorsed&quot; [message #834915 is a reply to message #834899] Mon, 02 April 2012 14:48 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

On 4/2/2012 10:35 AM, Joël Krähemann wrote:
> Hi, I read on stackoverflow.com that
> -Djava.endorsed.dirs="/opt/local/share/java/tomcat6/endorsed" causes
> spring loading to fail during tomcat6 startup with wtp plugin. But when
> I delete it from tomcat6 launch configuration next time I open it again
> it's still there, so what's happening?

You might want to ask this in the WTP forum rather than the JDT one
(which is meant for the Java Development Tools and not issues running
things using Java), or just followup on StackOverflow.

You can't usually directly edit the launch configuration used by WTP's
Server Tools, though--being able to do so usually means you have an
alternate means of launching the server with which it's not involved
(e.g. Sysdeo). Is this something you've modified by opening the editor
for your server instance from the Servers View?

---
Nitin Dahyabhai
Eclipse WTP Source Editing and JSDT
IBM Rational


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: get rid of -Djava.endorsed.dirs=&quot;/opt/local/share/java/tomcat6/endorsed&quot; [message #835024 is a reply to message #834915] Mon, 02 April 2012 17:49 Go to previous messageGo to next message
Joël Krähemann is currently offline Joël KrähemannFriend
Messages: 3
Registered: April 2012
Junior Member
Yes, I opened the editor in the server's view by clicking "Open launch configuration". By the way it's an existing tomcat installation.

[Updated on: Mon, 02 April 2012 18:28]

Report message to a moderator

Re: get rid of -Djava.endorsed.dirs=&quot;/opt/local/share/java/tomcat6/endorsed&quot; [message #835170 is a reply to message #835024] Mon, 02 April 2012 22:02 Go to previous messageGo to next message
Tim Kryselmire is currently offline Tim KryselmireFriend
Messages: 2
Registered: April 2012
Junior Member
I'm dealing with an identical error. If you figure out the solution, please post. I will do the same.

Thanks!
Re: get rid of -Djava.endorsed.dirs="/opt/local/share/java/tomcat6/endorsed" [message #846564 is a reply to message #834899] Mon, 16 April 2012 07:10 Go to previous messageGo to next message
Joël Krähemann is currently offline Joël KrähemannFriend
Messages: 3
Registered: April 2012
Junior Member
At the moment I debug with an ant build file and eclipse's external tools.

sourceforge.net/p/docadmin/code/HEAD/tree/trunk/build.xml

Re: get rid of -Djava.endorsed.dirs="/opt/local/share/java/tomcat6/endorsed" [message #846686 is a reply to message #846564] Mon, 16 April 2012 17:32 Go to previous message
Tim Kryselmire is currently offline Tim KryselmireFriend
Messages: 2
Registered: April 2012
Junior Member
Sorry for the delay in posts. My wife had a baby so I was out last week.

I made an interesting discovery regarding this error: It seems to be more related to the Tomcat instance than anything else.

I got annoyed at it and just deployed to production (not the best practice, I know) but it ran on production! Now the question is, what is different.

So far I've verified that:

1. the same JRE and JDK are installed on production and my test environment (1.6.31 in this case).

2. Same Tomcat configurations (in my case I just copied the tomcat directory from production)

3. All Endorsed jars are same version (again, copied)


I don't know if it will help you, but this has certainly boiled down the list of possibilities for me.

Previous Topic:problem with eclipse installation
Next Topic:Create a new xml file from java code
Goto Forum:
  


Current Time: Thu Apr 18 17:49:48 GMT 2024

Powered by FUDForum. Page generated in 0.01797 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top