I have installed Spring Tool Suite along with tc Server and couldn't manage to get Spring Insight to show my application. I have successfully added my web application through servers tab and started it without any exceptions. I have also played around a bit with the application so that Spring Insight can catch the activities. In server properties' Insight tab "Enable gathering of metrics" is selected and I can see my application under modules tab aswell.
I can access my project through mysite:8080/myProject page and Insight through mysite:8080/insight but Spring Insight page doesn't show my application.
I'm using Spring Tools Suite 3.0.0.RELEASE bundled with tc Server v2.7.
Any help is appreciated.
Here is my simplified startup log:
Eki 02, 2012 9:41:05 AM com.springsource.insight.tcserver.WeavingHelper findRepositoriesForClassPath
INFO: file:/C:/Users/osahin/Downloads/springsource/vfabric-tc-server-developer-2.7.1.RELEASE/spring-insight-instance/insight/collection-plugins/insight-collection-1.8.3.RELEASE.jar: aspects will be woven into the main Tomcat classloader
Eki 02, 2012 9:41:05 AM com.springsource.insight.tcserver.WeavingHelper findRepositoriesForClassPath
INFO: file:/C:/Users/osahin/Downloads/springsource/vfabric-tc-server-developer-2.7.1.RELEASE/spring-insight-instance/insight/collection-plugins/insight-plugin-jdbc-1.8.3.RELEASE.jar: aspects will be woven into the main Tomcat classloader
Eki 02, 2012 9:41:05 AM com.springsource.insight.tcserver.WeavingHelper findRepositoriesForClassPath
INFO: file:/C:/Users/osahin/Downloads/springsource/vfabric-tc-server-developer-2.7.1.RELEASE/spring-insight-instance/insight/collection-plugins/insight-plugin-tomcat-1.8.3.RELEASE.jar: aspects will be woven into the main Tomcat classloader
ASPECTJ: aspectj.overweaving=true: overweaving switched ON
Eki 02, 2012 9:41:07 AM com.springsource.tcserver.security.PropertyDecoder <init>
INFO: tc Runtime property decoder using memory-based key
Eki 02, 2012 9:41:07 AM com.springsource.tcserver.security.PropertyDecoder <init>
INFO: tcServer Runtime property decoder has been initialized in 774 ms
Eki 02, 2012 9:41:10 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Eki 02, 2012 9:41:11 AM com.springsource.tcserver.serviceability.rmi.JmxSocketListener init
INFO: Started up JMX registry on 127.0.0.1:6969 in 796 ms
Eki 02, 2012 9:41:11 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 4213 ms
Eki 02, 2012 9:41:11 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Eki 02, 2012 9:41:11 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: VMware vFabric tc Runtime 2.7.1.RELEASE/7.0.29.A.RELEASE
Eki 02, 2012 9:41:11 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor C:\Users\osahin\Downloads\springsource\vfabric-tc-server-developer-2.7.1.RELEASE\spring-insight-instance\conf\Catalina\localhost\Claimer.UI.xml
Eki 02, 2012 9:41:11 AM org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Claimer.UI' did not find a matching property.
Eki 02, 2012 9:41:12 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\Users\osahin\Downloads\springsource\vfabric-tc-server-developer-2.7.1.RELEASE\spring-insight-instance\wtpwebapps\Claimer.UI\WEB-INF\lib\el-api-2.2.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/el/Expression.class
Eki 02, 2012 9:41:41 AM org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener "com.sun.faces.config.ConfigureListener" is already configured for this context. The duplicate definition has been ignored.
Eki 02, 2012 9:41:42 AM com.springsource.insight.collection.strategies.CollectionStrategyRunner enable
INFO: Enabled Strategy com.springsource.insight.collection.strategies.EndPointOnlyCollectionStrategy#ee68cd7c
Eki 02, 2012 9:41:42 AM com.springsource.insight.collection.strategies.CollectionStrategyRunner enable
INFO: Enabled Strategy com.springsource.insight.collection.strategies.PrefixExcludeCollectionStrategy#d813cb8b
09:41:42,445 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
09:41:42,447 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
09:41:42,448 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/C:/Users/osahin/Downloads/springsource/vfabric-tc-server-developer-2.7.1.RELEASE/spring-insight-instance/wtpwebapps/Claimer.UI/WEB-INF/classes/logback.xml]
09:41:42,452 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs multiple times on the classpath.
09:41:42,452 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [file:/C:/Users/osahin/Downloads/springsource/vfabric-tc-server-developer-2.7.1.RELEASE/spring-insight-instance/wtpwebapps/Claimer.UI/WEB-INF/classes/logback.xml]
09:41:42,452 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Users/osahin/Downloads/springsource/vfabric-tc-server-developer-2.7.1.RELEASE/spring-insight-instance/wtpwebapps/Claimer.UI/WEB-INF/lib/Alias-1.2.2-SNAPSHOT.jar!/logback.xml]
09:41:42,769 |-INFO in ch.qos.logback.classic.turbo.ReconfigureOnChangeFilter#15ff6c16 - Will scan for changes in file [C:\Users\osahin\Downloads\springsource\vfabric-tc-server-developer-2.7.1.RELEASE\spring-insight-instance\wtpwebapps\Claimer.UI\WEB-INF\classes\logback.xml] every 60 seconds.
09:41:42,769 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Adding ReconfigureOnChangeFilter as a turbo filter
09:41:42,780 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
09:41:42,811 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
09:41:42,900 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
09:41:43,518 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
09:41:43,518 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUTWARN]
09:41:43,543 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
09:41:43,545 |-INFO in ch.qos.logback.classic.joran.action.LevelAction - ROOT level set to OFF
09:41:43,545 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.springframework] to INFO
09:41:43,545 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[org.springframework]
09:41:43,551 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.compugroup] to INFO
09:41:43,551 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[com.compugroup]
09:41:43,551 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache.cxf] to INFO
09:41:43,551 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[org.apache.cxf]
09:41:43,552 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache.cxf.interceptor] to INFO
09:41:43,552 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[org.apache.cxf.interceptor]
09:41:43,552 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
Eki 02, 2012 9:41:43 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
09:41:42,445 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
09:41:42,447 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
09:41:42,448 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/C:/Users/osahin/Downloads/springsource/vfabric-tc-server-developer-2.7.1.RELEASE/spring-insight-instance/wtpwebapps/Claimer.UI/WEB-INF/classes/logback.xml]
09:41:42,452 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs multiple times on the classpath.
09:41:42,452 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [file:/C:/Users/osahin/Downloads/springsource/vfabric-tc-server-developer-2.7.1.RELEASE/spring-insight-instance/wtpwebapps/Claimer.UI/WEB-INF/classes/logback.xml]
09:41:42,452 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Users/osahin/Downloads/springsource/vfabric-tc-server-developer-2.7.1.RELEASE/spring-insight-instance/wtpwebapps/Claimer.UI/WEB-INF/lib/Alias-1.2.2-SNAPSHOT.jar!/logback.xml]
09:41:42,769 |-INFO in ch.qos.logback.classic.turbo.ReconfigureOnChangeFilter#15ff6c16 - Will scan for changes in file [C:\Users\osahin\Downloads\springsource\vfabric-tc-server-developer-2.7.1.RELEASE\spring-insight-instance\wtpwebapps\Claimer.UI\WEB-INF\classes\logback.xml] every 60 seconds.
09:41:42,769 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Adding ReconfigureOnChangeFilter as a turbo filter
09:41:42,780 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
09:41:42,811 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
09:41:42,900 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
09:41:43,518 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
09:41:43,518 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUTWARN]
09:41:43,543 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
09:41:43,545 |-INFO in ch.qos.logback.classic.joran.action.LevelAction - ROOT level set to OFF
09:41:43,545 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.springframework] to INFO
09:41:43,545 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[org.springframework]
09:41:43,551 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.compugroup] to INFO
09:41:43,551 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[com.compugroup]
09:41:43,551 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache.cxf] to INFO
09:41:43,551 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[org.apache.cxf]
09:41:43,552 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache.cxf.interceptor] to INFO
09:41:43,552 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[org.apache.cxf.interceptor]
09:41:43,552 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
09:41:43.596 INFO [localhost-startStop-1] org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization started
09:41:43.875 INFO [localhost-startStop-1] org.springframework.web.context.support.XmlWebApplicationContext - Refreshing Root WebApplicationContext: startup date [Tue Oct 02 09:41:43 EEST 2012]; root of context hierarchy
09:41:44.294 INFO [localhost-startStop-1] org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [file:/C:/Users/osahin/Downloads/springsource/vfabric-tc-server-developer-2.7.1.RELEASE/spring-insight-instance/wtpwebapps/Claimer.UI/WEB-INF/classes/web-appl-context.xml]
09:41:44.538 INFO [localhost-startStop-1] org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xml]
09:41:44.649 INFO [localhost-startStop-1] org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [ws-anadolu-context.xml]
09:41:49.164 INFO [localhost-startStop-1] org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#63d63048: defining beans [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,serviceClient,*.http-conduit,user.proxyFactory,user,saglikKurumu.proxyFactory,saglikKurumu,odemeKurumu.proxyFactory,odemeKurumu,webinterface.proxyFactory,webinterface,infrastructure.proxyFactory,infrastructure,rawObject.proxyFactory,rawObject,propertyConfigurer]; root of factory hierarchy
09:41:51.742 INFO [localhost-startStop-1] org.apache.cxf.service.factory.ReflectionServiceFactoryBean - Creating Service {http://wsdl.hastane.claimer.compugroup.com}ClaimerHastaneWsdlService from class com.compugroup.claimer.hastane.wsdl.ClaimerHastaneWsdl
09:41:56.478 INFO [localhost-startStop-1] org.apache.cxf.service.factory.ReflectionServiceFactoryBean - Creating Service {http://sigortaserver.claimer.compugroup.com}ClaimerSigortaServerWsdlService from class com.compugroup.claimer.sigortaserver.ClaimerSigortaServerWsdl
09:41:59.023 INFO [localhost-startStop-1] org.apache.cxf.service.factory.ReflectionServiceFactoryBean - Creating Service {http://webinterface.claimer.compugroup.com}WebInterfaceWsdlService from class com.compugroup.claimer.webinterface.WebInterfaceWsdl
09:42:00.939 INFO [localhost-startStop-1] org.apache.cxf.service.factory.ReflectionServiceFactoryBean - Creating Service {http://infrastructure.claimer.compugroup.com}UserServiceService from class com.compugroup.claimer.infrastructure.service.UserService
09:42:02.732 INFO [localhost-startStop-1] org.apache.cxf.service.factory.ReflectionServiceFactoryBean - Creating Service {http://infrastructure.claimer.compugroup.com}ClaimerInfrastructureServiceService from class com.compugroup.claimer.infrastructure.wsdl.ClaimerInfrastructureService
09:42:05.754 INFO [localhost-startStop-1] org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 22144 ms
Eki 02, 2012 9:42:06 AM com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Mojarra 2.0.6 (FCS FCS) for context '/Claimer.UI'
Eki 02, 2012 9:42:09 AM com.sun.faces.spi.InjectionProviderFactory createInstance
INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed.
Eki 02, 2012 9:42:14 AM org.richfaces.javascript.ClientServiceConfigParser parse
WARNING: Found JavaScript function definition for class javax.validation.constraints.NotNull, but that class is not presented
Eki 02, 2012 9:42:14 AM org.richfaces.javascript.ClientServiceConfigParser parse
WARNING: Found JavaScript function definition for class org.hibernate.validator.constraints.NotEmpty, but that class is not presented
Eki 02, 2012 9:42:14 AM org.richfaces.javascript.ClientServiceConfigParser parse
WARNING: Found JavaScript function definition for class javax.validation.constraints.Size, but that class is not presented
Eki 02, 2012 9:42:14 AM org.richfaces.javascript.ClientServiceConfigParser parse
WARNING: Found JavaScript function definition for class javax.validation.constraints.Pattern, but that class is not presented
Eki 02, 2012 9:42:14 AM org.richfaces.javascript.ClientServiceConfigParser parse
WARNING: Found JavaScript function definition for class javax.validation.constraints.Min, but that class is not presented
Eki 02, 2012 9:42:14 AM org.richfaces.javascript.ClientServiceConfigParser parse
WARNING: Found JavaScript function definition for class javax.validation.constraints.Max, but that class is not presented
Eki 02, 2012 9:42:14 AM org.richfaces.javascript.ClientServiceConfigParser parse
WARNING: Found JavaScript function definition for class javax.validation.constraints.AssertTrue, but that class is not presented
Eki 02, 2012 9:42:14 AM org.richfaces.javascript.ClientServiceConfigParser parse
WARNING: Found JavaScript function definition for class javax.validation.constraints.AssertFalse, but that class is not presented
Eki 02, 2012 9:42:14 AM org.richfaces.cache.CacheManager getCacheFactory
INFO: Selected fallback cache factory
Eki 02, 2012 9:42:14 AM org.richfaces.cache.lru.LRUMapCacheFactory createCache
INFO: Creating LRUMap cache instance using parameters: {com.sun.faces.numberOfLogicalViews=1, com.sun.faces.expressionFactory=com.sun.el.ExpressionFactoryImpl, sigorta=anadolu, com.sun.faces.autoCompleteOffOnViewState=true, org.ajax4jsf.VIEW_HANDLERS=com.sun.facelets.FaceletViewHandler, ws.internal.rootPublishedUrl=http://localhost:9000, com.sun.faces.externalizeJavaScript=false, javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE=true, javax.faces.PROJECT_STAGE=Development, com.sun.faces.preferXHTML=false, javax.faces.FACELETS_SKIP_COMMENTS=false, javax.servlet.jsp.jstl.fmt.localizationContext=resources.application, contextConfigLocation=classpath*:web-appl-context.xml, javax.faces.STATE_SAVING_METHOD=server, com.sun.faces.enableRestoreView11Compatibility=true, com.sun.faces.numberOfViewsInSession=1}
Eki 02, 2012 9:42:14 AM org.richfaces.cache.lru.LRUMapCacheFactory createCache
INFO: Creating LRUMap cache instance of 512 items capacity
Eki 02, 2012 9:42:14 AM org.richfaces.application.InitializationListener onStart
INFO: RichFaces Core Implementation by JBoss, a division of Red Hat, Inc., version v.4.0.0.Final SVN r.22269
Eki 02, 2012 9:42:14 AM com.sun.faces.config.ConfigureListener$WebConfigResourceMonitor$Monitor <init>
INFO: Monitoring jndi:/localhost/Claimer.UI/WEB-INF/faces-config.xml for modifications
Eki 02, 2012 9:42:14 AM com.sun.faces.lifecycle.ELResolverInitPhaseListener populateFacesELResolverForJsp
INFO: JSF1027: [null] The ELResolvers for JSF were not registered with the JSP container.
09:42:15.764 INFO [localhost-startStop-1] org.apache.cxf.interceptor.LoggingOutInterceptor - Outbound Message
Eki 02, 2012 9:42:18 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor C:\Users\osahin\Downloads\springsource\vfabric-tc-server-developer-2.7.1.RELEASE\spring-insight-instance\conf\Catalina\localhost\insight.xml
Eki 02, 2012 9:42:18 AM com.springsource.insight.collection.tcserver.ltw.TomcatWeavingInsightClassLoader start
INFO: Context [localhost|insight] will not be woven
Eki 02, 2012 9:42:19 AM com.springsource.insight.InsightAgentPluginsHelper defaultInsightLogs
INFO: Using default insight.logs=C:\Users\osahin\Downloads\springsource\vfabric-tc-server-developer-2.7.1.RELEASE\spring-insight-instance\insight\logs
Eki 02, 2012 9:42:20 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Eki 02, 2012 9:42:50 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'Spring MVC Dispatcher Servlet'
Eki 02, 2012 9:42:57 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Users\osahin\Downloads\springsource\vfabric-tc-server-developer-2.7.1.RELEASE\spring-insight-instance\webapps\manager
Eki 02, 2012 9:42:57 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Users\osahin\Downloads\springsource\vfabric-tc-server-developer-2.7.1.RELEASE\spring-insight-instance\webapps\ROOT
Eki 02, 2012 9:42:57 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Eki 02, 2012 9:42:57 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 106463 ms
Related
HelloWorld obj = (HelloWorld) context.getBean("helloWorld");
obj.getMessage();
context.registerShutdownHook();
below the output:
Feb 03, 2017 11:46:12 AM org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext#799f7e29: startup date [Fri Feb 03 11:46:12 IST 2017]; root of context hierarchy
Feb 03, 2017 11:46:12 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [Beans.xml]
Bean is going through init.
Your Message : Hello World!
Bean will destroy now.
Whereas using context.close() gives
Feb 03, 2017 11:53:57 AM org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext#799f7e29: startup date [Fri Feb 03 11:53:57 IST 2017]; root of context hierarchy
Feb 03, 2017 11:53:57 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [Beans.xml]
Bean is going through init.
Your Message : Hello World!
Feb 03, 2017 11:53:57 AM org.springframework.context.support.ClassPathXmlApplicationContext doClose
INFO: Closing org.springframework.context.support.ClassPathXmlApplicationContext#799f7e29: startup date [Fri Feb 03 11:53:57 IST 2017]; root of context hierarchy
Bean will destroy now.
Could someone explain the difference?
The ApplicationContext class doesn't define either of these methods as a part of its interface, but the ConfigurableApplicationContext does define both of these.
From the JavaDoc:
close() -- Close this application context, destroying all beans in its bean factory.
registerShutdownHook() -- Register a shutdown hook with the JVM runtime, closing this context on JVM shutdown unless it has already been closed at that time.
Basically, AbstractApplicationContext#close() will close, or shutdown, the ApplicationContext at the time it is invoked, while AbstractApplicationContext#registerShutdownHook() will close, or shutdown, the ApplicationContext at a later time when the JVM is shutting down for whatever reason. This will be achieved by utilizing the JVM shutdown hook functionality.
In either case, the actual closing is done by the doClose() method.
If you are curious about why your outputs look so similar, it is because they are effectively doing the same thing, whether you call #close() or #registerShutdownHook() at line 3 of you example. #close will shutdown right away, and #registerShutdownHook will shutdown just before the JVM will exit, which is pretty much as soon as the method is done being invoked, because it is the last line of code!
I am using spring release 4.1.4. I am also using axis2.
Here is my aop.xml
<!DOCTYPE aspectj PUBLIC
"-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd">
<aspectj>
<weaver options="-verbose -debug -showWeaveInfo">
<!-- only weave classes in our application-specific packages -->
<include within="com.alu.motive.smdm.mediation.process.orchestration.process.*" />
<include within="com.alu.motive.smdm.mediation.process.orchestration.activity.*" />
</weaver>
<aspects>
<aspect name="com.alu.motive.smdm.mediation.process.orchestration.process.TransitionGovernorAspect" />
</aspects>
</aspectj>
here is my jvm args (i am suing Tomcat 8):
-Dcatalina.base="C:\PCRefresh\workspace-luna\.metadata\.plugins\org.eclipse.wst.server.core\tmp0" -Dcatalina.home="C:\Tomcat\apache-tomcat-8.0.18" -Dwtp.deploy="C:\PCRefresh\workspace-luna\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps" -Djava.endorsed.dirs="C:\Tomcat\apache-tomcat-8.0.18\endorsed" -javaagent:"C:\PCRefresh\DATA\SNE\_CVS\SchneiderElectric\LWM2M\MediationLayer\Cpmv215\lib\spring-instrument-4.1.4.RELEASE.jar" -XX:-UseSplitVerifier
Here is my application context:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!-- will register load time weaver needed to weave Aspect which controls activity transition,
TransitionGovernorAspect -->
<context:load-time-weaver/>
<!-- PART 1 – Process Assembly -->
<aop:config>
<!-- we are using "bean" pointcut in conjunction with execution pointcut
which will allow us to assemble some other process from another instance of
GenericProcessImpl -->
<aop:pointcut id="serviceToAssociatePointcut"
expression="bean(serviceToAssociate) and
execution(void com.alu.motive.smdm.mediation.process.orchestration.process.GenericProcessImpl.execute(..))"/>
<aop:advisor pointcut-ref="serviceToAssociatePointcut"
advice-ref="validateServiceDataFlter" order="1"/>
<aop:advisor pointcut-ref="serviceToAssociatePointcut"
advice-ref="associateServiceInM2MFlter" order="2"/>
<aop:advisor pointcut-ref="serviceToAssociatePointcut"
advice-ref="storeSessionStepFlter" order="3"/>
<aop:advisor pointcut-ref="serviceToAssociatePointcut"
advice-ref="retryFlter" order="4"/>
<aop:advisor pointcut-ref="serviceToAssociatePointcut"
advice-ref="processAsyncResponseFlter" order="5"/>
<aop:advisor pointcut-ref="serviceToAssociatePointcut"
advice-ref="processAsyncErrorResponseFlter" order="6"/>
</aop:config>
<!-- PART 2 – Activity Interceptors (Filters) Configuration -->
<!-- Individual Intercepting filters wired with corresponding
Activities and simple Fact rules-->
<bean id="genericFlter" class="com.alu.motive.smdm.mediation.process.orchestration.activity.ActivityFilterInterceptor"
abstract="true"/>
<bean id="validateServiceDataFlter" parent="genericFlter">
<constructor-arg ref="validateServiceDataActivity"/>
<property name="facts" value="!VALIDATED_SERVICE"/>
</bean>
<bean id="associateServiceInM2MFlter" parent="genericFlter">
<constructor-arg ref="associateServiceInM2MActivity"/>
<property name="facts" value="VALIDATED_SERVICE,!ASSOCIATED_SERVICE,!STORE_SESSION_ASSOCIATED_SERVICE,!ASSOCIATION_ERROR"/>
</bean>
<bean id="storeSessionStepFlter" parent="genericFlter">
<constructor-arg ref="storeSessionActivity"/>
<property name="facts" value="VALIDATED_SERVICE,ASSOCIATED_SERVICE,!STORE_SESSION_ASSOCIATED_SERVICE,!ASSOCIATION_ERROR"/>
</bean>
<bean id="retryFlter" parent="genericFlter">
<constructor-arg ref="RetryActivity"/>
<property name="facts" value="VALIDATED_SERVICE,ASSOCIATED_SERVICE,STORE_SESSION_ASSOCIATED_SERVICE,RETRY"/>
</bean>
<bean id="processAsyncResponseFlter" parent="genericFlter">
<constructor-arg ref="processAsyncResponseActivity"/>
<property name="facts" value="VALIDATED_SERVICE,ASSOCIATED_SERVICE,STORE_SESSION_ASSOCIATED_SERVICE,!ASYNC_RESPONSE,!ASSOCIATION_ERROR"/>
</bean>
<bean id="processAsyncErrorResponseFlter" parent="genericFlter">
<constructor-arg ref="processAsyncErrorResponseActivity"/>
<property name="facts" value="!ASYNC_RESPONSE,ACTIVITY_ERROR,!ASYNC_ERROR_RESPONSE"/>
</bean>
<!-- PART 3 – POJO Activities -->
<bean id="validateServiceDataActivity"
class="com.alu.motive.smdm.mediation.process.orchestration.activity.ValidateServiceDataActivity"/>
<bean id="associateServiceInM2MActivity"
class="com.alu.motive.smdm.mediation.process.orchestration.activity.AssociateServiceInFM2SActivity"/>
<bean id="storeSessionActivity"
class="com.alu.motive.smdm.mediation.process.orchestration.activity.StoreSessionActivity"/>
<bean id="RetryActivity"
class="com.alu.motive.smdm.mediation.process.orchestration.activity.RetryActivity"/>
<bean id="processAsyncResponseActivity"
class="com.alu.motive.smdm.mediation.process.orchestration.activity.ProcessAsyncResponseActivity"/>
<bean id="processAsyncErrorResponseActivity"
class="com.alu.motive.smdm.mediation.process.orchestration.activity.ProcessAsyncErrorResponseActivity"/>
</beans>
Here is the trace of the application:
févr. 27, 2015 10:22:01 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
AVERTISSEMENT: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Cpmv215' did not find a matching property.
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Server version: Apache Tomcat/8.0.18
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Server built: Jan 23 2015 11:56:07 UTC
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Server number: 8.0.18.0
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: OS Name: Windows 7
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: OS Version: 6.1
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Architecture: amd64
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Java Home: C:\Program Files\Java\jre7
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: JVM Version: 1.7.0_75-b13
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: JVM Vendor: Oracle Corporation
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: CATALINA_BASE: C:\PCRefresh\workspace-luna\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: CATALINA_HOME: C:\Tomcat\apache-tomcat-8.0.18
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -Dcatalina.base=C:\PCRefresh\workspace-luna\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -Dcatalina.home=C:\Tomcat\apache-tomcat-8.0.18
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -Dwtp.deploy=C:\PCRefresh\workspace-luna\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -Djava.endorsed.dirs=C:\Tomcat\apache-tomcat-8.0.18\endorsed
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -javaagent:C:\PCRefresh\DATA\SNE\_CVS\SchneiderElectric\LWM2M\MediationLayer\Cpmv215\lib\spring-instrument-4.1.4.RELEASE.jar
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -XX:-UseSplitVerifier
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -Dfile.encoding=Cp1252
févr. 27, 2015 10:22:02 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFOS: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\oraclexe\app\oracle\product\11.2.0\server\bin;;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Common Files\Microsoft Shared\Microsoft Online Services;C:\Program Files (x86)\Common Files\Microsoft Shared\Microsoft Online Services;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Oracle_universal\10_32;C:\Program Files\TortoiseSVN\bin;C:\ProgramFiles\nodejs\;C:\PCRefresh\oracle\instantclient\instantclient_11_2;C:\ProgramFiles\ApacheSoftwareFoundation\apache-maven-3.2.1\bin;C:\Program Files (x86)\CVSNT\;C:\Program Files\Java\jdk1.8.0_05\bin;C:\Users\claveri1\AppData\Roaming\npm;C:\ProgramFiles\nodejs;C:\PCRefresh\oracle\instantclient\instantclient_12_1;.
févr. 27, 2015 10:22:02 PM org.apache.coyote.AbstractProtocol init
INFOS: Initializing ProtocolHandler ["http-nio-8080"]
févr. 27, 2015 10:22:02 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFOS: Using a shared selector for servlet write/read
févr. 27, 2015 10:22:02 PM org.apache.coyote.AbstractProtocol init
INFOS: Initializing ProtocolHandler ["ajp-nio-8009"]
févr. 27, 2015 10:22:02 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFOS: Using a shared selector for servlet write/read
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.Catalina load
INFOS: Initialization processed in 886 ms
févr. 27, 2015 10:22:02 PM org.apache.catalina.core.StandardService startInternal
INFOS: Démarrage du service Catalina
févr. 27, 2015 10:22:02 PM org.apache.catalina.core.StandardEngine startInternal
INFOS: Starting Servlet Engine: Apache Tomcat/8.0.18
févr. 27, 2015 10:22:02 PM org.apache.jasper.servlet.TldScanner scanJars
INFOS: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
févr. 27, 2015 10:22:02 PM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
INFOS: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [182] milliseconds.
2015-02-27 22:22:16,310 [localhost-startStop-1] WARN org.apache.axis2.transport.http.AxisAdminServlet - line:39 - Web application uses org.apache.axis2.transport.http.AxisAdminServlet; please update web.xml to use org.apache.axis2.webapp.AxisAdminServlet instead
2015-02-27 22:22:19,705 [localhost-startStop-1] WARN org.apache.axis2.transport.http.AxisServlet - line:165 - No transportReceiver for org.apache.axis2.transport.http.AxisServletListener found. An instance for HTTP will be configured automatically. Please update your axis2.xml file!
févr. 27, 2015 10:22:19 PM org.apache.coyote.AbstractProtocol start
INFOS: Starting ProtocolHandler ["http-nio-8080"]
févr. 27, 2015 10:22:19 PM org.apache.coyote.AbstractProtocol start
INFOS: Starting ProtocolHandler ["ajp-nio-8009"]
févr. 27, 2015 10:22:19 PM org.apache.catalina.startup.Catalina start
INFOS: Server startup in 17470 ms
2015-02-27 22:22:34,987 [http-nio-8080-exec-3] INFO com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:64 - associateService: beg - responseURI=http://localhost:8882/foo - endpointId=myEndPointId - sgwId=mySgwId - serviceID=myServiceId - serviceDeliveryID=mySDid
2015-02-27 22:22:34,988 [http-nio-8080-exec-3] DEBUG com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:71 - first check input parameters
2015-02-27 22:22:34,989 [http-nio-8080-exec-3] DEBUG com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:99 - All mandatory parameters found
2015-02-27 22:22:34,989 [http-nio-8080-exec-3] TRACE com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:100 - Instanciating service from input parameters
2015-02-27 22:22:34,991 [http-nio-8080-exec-3] DEBUG com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:107 - transaction id generated is: mPqRdhR5ASWc7bBB
2015-02-27 22:22:34,992 [http-nio-8080-exec-3] TRACE com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:113 - Service LCS is null with errorSubCode=null
2015-02-27 22:22:34,992 [http-nio-8080-exec-3] TRACE com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:114 - set synchronous answer to OK since there is no additional check
2015-02-27 22:22:34,993 [http-nio-8080-exec-3] DEBUG com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:129 - Launch the association orchestration
2015-02-27 22:22:35,001 [http-nio-8080-exec-3] INFO com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:176 - associateService: end (return the synchronous response)
2015-02-27 22:22:35,019 [Thread-8] DEBUG com.alu.motive.if_dm_sm.ThreadForAssociateService - line:22 - Begin of ThreadForAssociateService:run
2015-02-27 22:22:35,020 [Thread-8] DEBUG com.alu.motive.if_dm_sm.ThreadForAssociateService - line:27 - Load application configuration: application-config-associateService.xml
[TomcatInstrumentableClassLoader#4dee3a29] info AspectJ Weaver Version 1.8.5 built on Thursday Jan 29, 2015 at 01:03:58 GMT
[TomcatInstrumentableClassLoader#4dee3a29] info register classloader org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader#4dee3a29
[TomcatInstrumentableClassLoader#4dee3a29] info using configuration /C:/PCRefresh/workspace-luna/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Cpmv215/WEB-INF/classes/META-INF/aop.xml
[TomcatInstrumentableClassLoader#4dee3a29] info using configuration file:/C:/PCRefresh/workspace-luna/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Cpmv215/WEB-INF/lib/spring-aspects-4.1.4.RELEASE.jar!/META-INF/aop.xml
[TomcatInstrumentableClassLoader#4dee3a29] info register aspect com.alu.motive.smdm.mediation.process.orchestration.process.TransitionGovernorAspect
[TomcatInstrumentableClassLoader#4dee3a29] info register aspect org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect
[TomcatInstrumentableClassLoader#4dee3a29] info register aspect org.springframework.scheduling.aspectj.AnnotationAsyncExecutionAspect
[TomcatInstrumentableClassLoader#4dee3a29] info register aspect org.springframework.transaction.aspectj.AnnotationTransactionAspect
[TomcatInstrumentableClassLoader#4dee3a29] info register aspect org.springframework.cache.aspectj.AnnotationCacheAspect
[TomcatInstrumentableClassLoader#4dee3a29] info register aspect org.springframework.cache.aspectj.JCacheCacheAspect
[TomcatInstrumentableClassLoader#4dee3a29] debug not weaving 'org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker'
[TomcatInstrumentableClassLoader#4dee3a29] debug not weaving 'org.springframework.aop.TargetSource'
[TomcatInstrumentableClassLoader#4dee3a29] debug not weaving 'org.springframework.aop.TargetClassAware'
[TomcatInstrumentableClassLoader#4dee3a29] debug not weaving 'org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper'
[TomcatInstrumentableClassLoader#4dee3a29] debug not weaving 'org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator$BeanFactoryAdvisorRetrievalHelperAdapter'
[TomcatInstrumentableClassLoader#4dee3a29] debug not weaving 'org.springframework.aop.aspectj.autoproxy.AspectJPrecedenceComparator'
[TomcatInstrumentableClassLoader#4dee3a29] debug not weaving 'org.springframework.aop.framework.adapter.GlobalAdvisorAdapterRegistry'
[TomcatInstrumentableClassLoader#4dee3a29] debug not weaving 'org.springframework.aop.framework.adapter.AdvisorAdapterRegistry'
[TomcatInstrumentableClassLoader#4dee3a29] debug not weaving 'org.springframework.aop.framework.adapter.DefaultAdvisorAdapterRegistry'
[TomcatInstrumentableClassLoader#4dee3a29] debug not weaving 'org.springframework.aop.framework.adapter.UnknownAdviceTypeException'
[TomcatInstrumentableClassLoader#4dee3a29] debug not weaving
...
[TomcatInstrumentableClassLoader#4dee3a29] debug not weaving 'org.springframework.aop.BeforeAdvice'
[TomcatInstrumentableClassLoader#4dee3a29] debug not weaving 'org.springframework.aop.AfterReturningAdvice'
[TomcatInstrumentableClassLoader#4dee3a29] debug not weaving 'org.springframework.aop.AfterAdvice'
[TomcatInstrumentableClassLoader#4dee3a29] debug not weaving 'org.springframework.aop.ThrowsAdvice'
[TomcatInstrumentableClassLoader#4dee3a29] debug not weaving 'org.springframework.aop.TrueMethodMatcher'
[TomcatInstrumentableClassLoader#4dee3a29] debug not weaving 'org.springframework.aop.support.MethodMatchers'
[TomcatInstrumentableClassLoader#4dee3a29] debug not weaving 'org.springframework.aop.framework.ReflectiveMethodInvocation'
[TomcatInstrumentableClassLoader#4dee3a29] debug not weaving 'org.springframework.aop.ProxyMethodInvocation'
[TomcatInstrumentableClassLoader#4dee3a29] debug not weaving 'org.springframework.aop.framework.InterceptorAndDynamicMethodMatcher'
2015-02-27 22:22:39,142 [Thread-8] DEBUG com.alu.motive.smdm.mediation.process.orchestration.activity.ActivityFilterInterceptor - line:47 - >>>> Executing com.alu.motive.smdm.mediation.process.orchestration.activity.ValidateServiceDataActivity
2015-02-27 22:22:39,143 [Thread-8] DEBUG com.alu.motive.smdm.mediation.process.orchestration.activity.ActivityFilterInterceptor - line:51 - >>>> with Facts
2015-02-27 22:22:39,143 [Thread-8] DEBUG com.alu.motive.smdm.mediation.process.orchestration.activity.ValidateServiceDataActivity - line:17 - Checking service data (nothing to check)
2015-02-27 22:22:39,143 [Thread-8] DEBUG com.alu.motive.smdm.mediation.process.orchestration.activity.ActivityFilterInterceptor - line:47 - >>>> Executing com.alu.motive.smdm.mediation.process.orchestration.activity.AssociateServiceInFM2SActivity
2015-02-27 22:22:39,143 [Thread-8] DEBUG com.alu.motive.smdm.mediation.process.orchestration.activity.ActivityFilterInterceptor - line:51 - >>>> with Facts VALIDATED_SERVICE
2015-02-27 22:22:39,143 [Thread-8] DEBUG com.alu.motive.smdm.mediation.process.orchestration.activity.AssociateServiceInFM2SActivity - line:42 - AssociateServiceInFM2SActivity:process - BEG
[TomcatInstrumentableClassLoader#4dee3a29] debug not weaving 'com.sun.jersey.api.client.Client'
[TomcatInstrumentableClassLoader#4dee3a29] debug not weaving 'com.sun.jersey.api.client.ClientHandler'
[TomcatInstrumentableClassLoader#4dee3a29] debug not weaving 'com.sun.jersey.api.client.filter.Filterable'
My issue:
My own classes (com.alu.motive.smdm.mediation.process.orchestration.activity.*) are never weaved.
A advice will be apreciated to understand my issues.
I have resolved my issue.
My jvm arguments were wrong. Note with the correction, the classes are loaded at the beginning and not only during the application context loading.
Before, my jvm arg included:
-javaagent:C:\PCRefresh\DATA\SNE\_CVS\SchneiderElectric\LWM2M\MediationLayer\Cpmv215\lib\spring-instrument-4.1.4.RELEASE.jar
The correction was to set it like as follows:
-javaagent:"C:\PCRefresh\DATA\SNE\_CVS\SchneiderElectric\LWM2M\MediationLayer\Cpmv215\lib\aspectjweaver.jar"
Tomcat needs to scan the classpath to find classes with Servlet 3.0 annotations, which it does by loading all your classes. Because this happens before Spring configures AspectJ, your classes don't get woven. There are two ways to deal with this: either specify Servlet 2.5 in your web.xml, or add metadata-complete="true" to <web-app> in web.xml. If you're using Servlet 3.0 annotations (#Servlet, etc), that puts you in a pickle--AFAIK there's no way to combine LTW with Servlet 3.0 annotations on Tomcat.
thanks
Here is my web.xml before the change.
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID"
version="2.5">
<display-name>Cpmv215</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
<welcome-file>/axis2-web/index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<display-name>Apache-Axis Servlet</display-name>
<servlet-name>AxisServlet</servlet-name>
<servlet-class>org.apache.axis2.transport.http.AxisServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<url-pattern>/servlet/AxisServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<url-pattern>*.jws</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
<servlet>
<display-name>Apache-Axis Admin Servlet Web Admin</display-name>
<servlet-name>AxisAdminServlet</servlet-name>
<servlet-class>org.apache.axis2.transport.http.AxisAdminServlet</servlet-class>
<load-on-startup>100</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>AxisAdminServlet</servlet-name>
<url-pattern>/axis2-admin/*</url-pattern>
</servlet-mapping>
</web-app>
Here is the the beginning of the web.xml after the change you have suggested:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID"
version="2.5"
metadata-complete="true">
But, i have the same trace. Spring never tries to weave my own classes.
When I try to deploy the sample Java Spring application with MongoDB (hello-spring-mongodb) I get the error pasted below, which suggests the MongoDB service is failing to bind. I have been getting this error in all my own applications too, deploying both from the command line and from STS 3.0.0. The key error is:
Error creating bean with name 'mongoDbFactory': Invocation of init method failed; nested exception is
org.cloudfoundry.runtime.env.CloudServiceException: Expected 1 service of class org.cloudfoundry.runtime.env.MongoServiceInfo type, but found0
Full trace:
Bind existing services to 'hello-weeels'? [yN]:
Create services to bind to 'hello-weeels'? [yN]: y
1: mongodb
2: mysql
3: postgresql
4: rabbitmq
5: redis
What kind of service?: 1
Specify the name of the service [mongodb-9c56b]:
Create another? [yN]: n
Would you like to save this configuration? [yN]: y
Manifest written to manifest.yml.
Creating Application: OK
Creating Service [mongodb-9c56b]: OK
Binding Service [mongodb-9c56b]: OK
Uploading Application:
Checking for available resources: OK
Processing resources: OK
Packing application: OK
Uploading (3K): OK
Push Status: OK
Staging Application 'hello-weeels': OK
Starting Application 'hello-weeels': ..
Error: Application [hello-weeels] failed to start, logs information below.
====> /logs/stderr.log <====
Aug 27, 2012 9:17:24 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-54519
Aug 27, 2012 9:17:24 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 392 ms
Aug 27, 2012 9:17:24 PM org.apache.catalina.realm.JAASRealm setContainer
INFO: Set JAAS app name Catalina
Aug 27, 2012 9:17:24 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Aug 27, 2012 9:17:24 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.35
Aug 27, 2012 9:17:24 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
Aug 27, 2012 9:17:24 PM org.cloudfoundry.reconfiguration.CloudAutoStagingBeanFactoryPostProcessor usingCloudService
INFO: Found an instance of org.cloudfoundry.runtime.service.AbstractCloudServiceFactory. Autostaging will be skipped.
Aug 27, 2012 9:17:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Aug 27, 2012 9:17:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [] startup failed due to previous errors
====> /logs/stdout.log <====
INFO : org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization started
INFO : org.springframework.web.context.support.XmlWebApplicationContext - Refreshing Root WebApplicationContext: startup date [Mon Aug 27 21:17:24 UTC 2012]; root of context hierarchy
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [root-context.xml]
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [META-INF/cloud/cloudfoundry-auto-reconfiguration-context.xml]
INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#c292cb2: defining beans [mongoTemplate,mongoDbFactory,__appCloudJpaPostgreSQLReplacementProperties,__appCloudJpaMySQLReplacementProperties,__appCloudHibernatePostgreSQLReplacementProperties,__appCloudHibernateMySQLReplacementProperties,org.cloudfoundry.reconfiguration.CloudAutoStagingBeanFactoryPostProcessor#0]; root of factory hierarchy
INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#c292cb2: defining beans [mongoTemplate,mongoDbFactory,__appCloudJpaPostgreSQLReplacementProperties,__appCloudJpaMySQLReplacementProperties,__appCloudHibernatePostgreSQLReplacementProperties,__appCloudHibernateMySQLReplacementProperties,org.cloudfoundry.reconfiguration.CloudAutoStagingBeanFactoryPostProcessor#0]; root of factory hierarchy
ERROR: org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoTemplate' defined in class path resource [root-context.xml]: Cannot resolve reference to bean 'mongoDbFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoDbFactory': Invocation of init method failed; nested exception is org.cloudfoundry.runtime.env.CloudServiceException: Expected 1 service of class org.cloudfoundry.runtime.env.MongoServiceInfo type, but found0
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:630)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1035)
Replace:
<beans profile="default">
<mongo:db-factory id="mongoDbFactory" dbname="pwdtest" host="127.0.0.1" port="27017" username="mongo_user" password="passwd"/>
</beans>
<beans profile="cloud">
<cloud:mongo-db-factory id="mongoDbFactory"/>
</beans>
With:
<mongo:db-factory
id="mongoDbFactory"
dbname="${mongo.name}"
host="${mongo.host}"
port="27017"
username="${mongo.username}"
password="${mongo.password}" />
...and cloudfoundry auto reconfig will do it's job properly. If you still have a problem, Right-click on your project in the Spring Explorer View > Properties, and enable the "Beans Validator".
Did you change the name of the expected mongo db? The hello-spring-mondgodb app is configured to to look for a db named 'hello' (The second constructor arg of SimpleMongoDbFactory). Maybe try updating this property to reflect the name of your mongo db and re-push.
Hope this helps
Chris
The hello-spring-mongodb runs without configuration changes. It deploys successfully on my CF installation. First, I create a mongoDB service with:
vmc create-service mongoDB
and then I run: vmc push hello-sping-mongodb from the target directory
C:\eclipseWork\Indigo\hello-spring-mongodb\target>vmc push hello-spring-mongodb
Would you like to deploy from the current directory? [Yn]:
Detected a Java SpringSource Spring Application, is this correct? [Yn]:
Application Deployed URL [hello-spring-mongodb.vcap.me]:
Memory reservation (128M, 256M, 512M, 1G, 2G) [512M]:
How many instances? [1]:
Bind existing services to 'hello-spring-mongodb'? [yN]: y
1: mongodb-86f0e
Which one?: 1
Create services to bind to 'hello-spring-mongodb'? [yN]:
Would you like to save this configuration? [yN]:
Creating Application: OK
Binding Service [mongodb-86f0e]: OK
Uploading Application:
Checking for available resources: OK
Processing resources: OK
Packing application: OK
Uploading (2K): OK
Push Status: OK
Staging Application 'hello-spring-mongodb': OK
Starting Application 'hello-spring-mongodb': OK
Can you try to create the mongoDB service first and then push the application?
It seems that the cloud profile configuration isn't defined in your root-context.xml. Check again that you have the following configuration:
<bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate">
<constructor-arg ref="mongoDbFactory"/>
</bean>
<beans profile="default">
<mongo:db-factory id="mongoDbFactory" dbname="pwdtest" host="127.0.0.1" port="27017" username="mongo_user" password="passwd"/>
</beans>
<beans profile="cloud">
<cloud:mongo-db-factory id="mongoDbFactory"/>
</beans>
Make sure the service name matches, and update the cloudfoundry-runtime version. See my answer to another question with the same exception here.
I am getting an exception when I am trying to deploy my project on linux machine, I am using Spring and hibernate framework for my project. Following is the error in catalin.out
Using CATALINA_BASE: /usr/share/tomcat5
Using CATALINA_HOME: /usr/share/tomcat5
Using CATALINA_TMPDIR: /usr/share/tomcat5/temp
Using JRE_HOME:
Created MBeanServer with ID: oovd91:gmddgare.0:leeginweb1.inetu.net:1
Using CATALINA_BASE: /usr/share/tomcat5
Using CATALINA_HOME: /usr/share/tomcat5
Using CATALINA_TMPDIR: /usr/share/tomcat5/temp
Using JRE_HOME:
Created MBeanServer with ID: onrubt:gmddgel2.0:leeginweb1.inetu.net:1
11-Apr-11 8:21:38 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/gcj-4.1.2
11-Apr-11 8:21:38 AM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
11-Apr-11 8:21:38 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 477 ms
11-Apr-11 8:21:38 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
11-Apr-11 8:21:38 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.23
11-Apr-11 8:21:38 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
11-Apr-11 8:21:38 AM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE: ContainerBase.addChild: start:
LifecycleException: Error initializaing : java.lang.NullPointerException
at org.apache.catalina.core.StandardContext.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.ContainerBase.addChildInternal(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.ContainerBase.addChild(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardHost.addChild(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.deployDescriptor(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.deployDescriptors(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.deployApps(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.ContainerBase.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardHost.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.ContainerBase.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardEngine.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardService.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardServer.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.Catalina.start(catalina-5.5.23.jar.sozxb574.so)
at java.lang.reflect.Method.invoke(libgcj.so.7rh)
at org.apache.catalina.startup.Bootstrap.start(bootstrap.jar.so)
at org.apache.catalina.startup.Bootstrap.main(bootstrap.jar.so)
11-Apr-11 8:21:38 AM org.apache.catalina.startup.HostConfig deployDescriptor
SEVERE: Error deploying configuration descriptor Brighton.xml
java.lang.IllegalStateException: ContainerBase.addChild: start: LifecycleException: Error initializaing : java.lang.NullPointerException
at org.apache.catalina.core.ContainerBase.addChildInternal(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.ContainerBase.addChild(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardHost.addChild(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.deployDescriptor(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.deployDescriptors(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.deployApps(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.ContainerBase.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardHost.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.ContainerBase.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardEngine.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardService.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardServer.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.Catalina.start(catalina-5.5.23.jar.sozxb574.so)
at java.lang.reflect.Method.invoke(libgcj.so.7rh)
at org.apache.catalina.startup.Bootstrap.start(bootstrap.jar.so)
at org.apache.catalina.startup.Bootstrap.main(bootstrap.jar.so)
11-Apr-11 8:21:38 AM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE: ContainerBase.addChild: start:
LifecycleException: Error initializaing : java.lang.NullPointerException
at org.apache.catalina.core.StandardContext.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.ContainerBase.addChildInternal(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.ContainerBase.addChild(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardHost.addChild(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.deployDescriptor(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.deployDescriptors(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.deployApps(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.ContainerBase.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardHost.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.ContainerBase.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardEngine.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardService.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardServer.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.Catalina.start(catalina-5.5.23.jar.sozxb574.so)
at java.lang.reflect.Method.invoke(libgcj.so.7rh)
at org.apache.catalina.startup.Bootstrap.start(bootstrap.jar.so)
at org.apache.catalina.startup.Bootstrap.main(bootstrap.jar.so)
11-Apr-11 8:21:38 AM org.apache.catalina.startup.HostConfig deployDescriptor
SEVERE: Error deploying configuration descriptor TrackingToolWebService.xml
java.lang.IllegalStateException: ContainerBase.addChild: start: LifecycleException: Error initializaing : java.lang.NullPointerException
at org.apache.catalina.core.ContainerBase.addChildInternal(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.ContainerBase.addChild(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardHost.addChild(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.deployDescriptor(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.deployDescriptors(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.deployApps(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.ContainerBase.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardHost.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.ContainerBase.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardEngine.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardService.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardServer.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.Catalina.start(catalina-5.5.23.jar.sozxb574.so)
at java.lang.reflect.Method.invoke(libgcj.so.7rh)
at org.apache.catalina.startup.Bootstrap.start(bootstrap.jar.so)
at org.apache.catalina.startup.Bootstrap.main(bootstrap.jar.so)
11-Apr-11 8:21:39 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive Brighton.war
11-Apr-11 8:21:39 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.NoClassDefFoundError: org.springframework.web.context.ContextLoader
at java.lang.Class.initializeClass(libgcj.so.7rh)
at java.lang.Class.initializeClass(libgcj.so.7rh)
at java.lang.Class.newInstance(libgcj.so.7rh)
at org.apache.catalina.core.StandardContext.listenerStart(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardContext.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.ContainerBase.addChildInternal(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.ContainerBase.addChild(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardHost.addChild(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.deployWAR(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.deployWARs(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.deployApps(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.ContainerBase.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardHost.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.ContainerBase.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardEngine.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardService.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.core.StandardServer.start(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.startup.Catalina.start(catalina-5.5.23.jar.sozxb574.so)
at java.lang.reflect.Method.invoke(libgcj.so.7rh)
at org.apache.catalina.startup.Bootstrap.start(bootstrap.jar.so)
at org.apache.catalina.startup.Bootstrap.main(bootstrap.jar.so)
Caused by: java.lang.ClassNotFoundException: java.util.concurrent.ConcurrentHashMap
at org.apache.catalina.loader.WebappClassLoader.loadClass(catalina-5.5.23.jar.sozxb574.so)
at org.apache.catalina.loader.WebappClassLoader.loadClass(catalina-5.5.23.jar.sozxb574.so)
at java.lang.Class.forName(libgcj.so.7rh)
at java.lang.Class.initializeClass(libgcj.so.7rh)
...23 more
11-Apr-11 8:21:39 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
11-Apr-11 8:21:39 AM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
11-Apr-11 8:21:39 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/Brighton] startup failed due to previous errors
11-Apr-11 8:21:39 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive TrackingToolWebService.war
log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax).
log4j:WARN Please initialize the log4j system properly.
11-Apr-11 8:21:41 AM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
11-Apr-11 8:21:41 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/TrackingToolWebService] startup failed due to previous errors
11-Apr-11 8:21:41 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
11-Apr-11 8:21:41 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
11-Apr-11 8:21:41 AM org.apache.catalina.core.ApplicationContext log
INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: ], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
11-Apr-11 8:21:41 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
11-Apr-11 8:21:41 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
11-Apr-11 8:21:42 AM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
11-Apr-11 8:21:42 AM org.apache.catalina.connector.MapperListener init
INFO: Registering Hosts
11-Apr-11 8:21:42 AM org.apache.catalina.connector.MapperListener init
INFO: Registering WebModule Contexts
11-Apr-11 8:21:42 AM org.apache.catalina.connector.MapperListener init
INFO: Registering Servlets
11-Apr-11 8:21:42 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
11-Apr-11 8:21:42 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/34 config=null
11-Apr-11 8:21:42 AM org.apache.catalina.connector.MapperListener init
INFO: Registering Hosts
11-Apr-11 8:21:42 AM org.apache.catalina.connector.MapperListener init
INFO: Registering WebModule Contexts
11-Apr-11 8:21:42 AM org.apache.catalina.connector.MapperListener init
INFO: Registering Servlets
11-Apr-11 8:21:42 AM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
11-Apr-11 8:21:42 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 4364 m
The exception java.lang.NoClassDefFoundError: org.springframework.web.context.ContextLoader at least indicates that you are missing a Spring framework JAR file: spring-web-<version>.jar. This JAR has to be part of your WAR file distribution. When you bundle your WAR file make sure it will end up in WEB-INF/lib. You might have to add more than just this one JAR file. Check your logs to see if there are more java.lang.NoClassDefFoundErrors.
I am building a GWT app with Spring. I am having some issues to inject a dependency to one of my Servlets, so I am trying to narrow down what can be wrong.
First, when my app starts I get:
[WARN] Server class
'org.springframework.web.context.ContextLoaderListener'
could not be found in the web app, but
was found on the system classpath
[WARN] Adding classpath entry
'file:/home/macarse/.m2/repository/org/springframework/spring/2.5.6/spring-2.5.6.jar'
to the web app classpath for this
session For additional info see:
file:/home/macarse/tpf/eclipse/plugins/com.google.gwt.eclipse.sdkbundle.2.0.4_2.0.4.v201006301309/gwt-2.0.4/doc/helpInfo/webAppClassPath.html
[WARN] Server class
'org.apache.commons.collections.map.CaseInsensitiveMap'
could not be found in the web app, but
was found on the system classpath
[WARN] Adding classpath entry
'file:/home/macarse/tpf/eclipse/plugins/com.google.gwt.eclipse.sdkbundle.2.0.4_2.0.4.v201006301309/gwt-2.0.4/gwt-dev.jar' to the web app classpath for this
session For additional info see:
file:/home/macarse/tpf/eclipse/plugins/com.google.gwt.eclipse.sdkbundle.2.0.4_2.0.4.v201006301309/gwt-2.0.4/doc/helpInfo/webAppClassPath.html
Jul 18, 2010 11:07:00 AM
org.springframework.web.context.ContextLoader
initWebApplicationContext INFO: Root
WebApplicationContext: initialization
started Jul 18, 2010 11:07:00 AM
org.springframework.context.support.AbstractApplicationContext
prepareRefresh INFO: Refreshing
org.springframework.web.context.support.XmlWebApplicationContext#16b904d:
display name [Root
WebApplicationContext]; startup date
[Sun Jul 18 11:07:00 ART 2010]; root
of context hierarchy Jul 18, 2010
11:07:00 AM
org.springframework.context.support.AbstractApplicationContext
obtainFreshBeanFactory INFO: Bean
factory for application context
[org.springframework.web.context.support.XmlWebApplicationContext#16b904d]:
org.springframework.beans.factory.support.DefaultListableBeanFactory#1a8dfb3
Jul 18, 2010 11:07:01 AM
org.springframework.beans.factory.support.DefaultListableBeanFactory
preInstantiateSingletons INFO:
Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory#1a8dfb3:
defining beans []; root of factory
hierarchy Jul 18, 2010 11:07:01 AM
org.springframework.web.context.ContextLoader
initWebApplicationContext
Is that OK?
In my web.xml I have:
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath*:/META-INF/spring-presentation.xml, classpath*:/META-INF/spring-persistence.xml
</param-value>
</context-param>
Is there a way to know if those two xml were loaded?
Scan your application startup logs. You should find logs telling you which context files it loaded in the following format (log pattern might differ based on your log config):
org.springframework.beans.factory.xml.XmlBeanDefinitionReader (315): Loading XML bean definitions from ServletContext resource [/META-INF/spring-presentation.xml]
org.springframework.beans.factory.xml.XmlBeanDefinitionReader (315): Loading XML bean definitions from ServletContext resource [/META-INF/spring-persistence.xml]