On Thu, Aug 22, 2013 at 10:30 AM, Daniel Mikusa <dmik...@gopivotal.com>wrote:

> On Aug 22, 2013, at 9:21 AM, D C <dc12...@gmail.com> wrote:
>
> > Ok, here goes.  grep -v '/opt/jdk'
>
> <snip>  Removing some of the fluff.
>
> > Aug 21, 2013 5:08:03 PM org.apache.catalina.startup.HostConfig
> > deployDescriptor
> > INFO: Deploying configuration descriptor
> > /opt/apache-tomcat-7.0.40/conf/Catalina/localhost/myApp.xml
>
> Ok, myApp is deployed here...
>

So far working as expected.
​​

>
> > [Loaded org.springframework.web.SpringServletContainerInitializer from
> > file:/web/webapps/myApp/WEB-INF/lib/spring-web-3.1.0.RELEASE.jar]
> > [Loaded org.springframework.web.WebApplicationInitializer from
> > file:/web/webapps/myApp/WEB-INF/lib/spring-web-3.1.0.RELEASE.jar]
>
> We can see that some of the Spring classes are being loaded from
> "WEB-INF/lib".  Were you expecting this?
>
​

This is an example of something our developers will need to clean up before
we release... But yes it was expected.


> > [Loaded org.springframework.web.context.ContextLoader from
> > file:/web/webapps/myApp/WEB-INF/lib/spring-web-3.1.0.RELEASE.jar]
> > [Loaded org.springframework.web.context.ContextLoaderListener from
> > file:/web/webapps/myApp/WEB-INF/lib/spring-web-3.1.0.RELEASE.jar]
>
> More Spring classes loaded from WEB-INF/ilb.  Again, were you expecting
> this?
>

Yup.
​​

>
> > [Loaded com.myco.management.spring_utils.ContextLoaderListener from
> >
> file:/web/webapps/myApp/WEB-INF/classes/com/myco/management/spring_utils/ContextLoaderListener.class]
>
> Looks like one of your custom classes is being loaded.  No big deal.
>
> > Aug 21, 2013 5:08:07 PM org.apache.catalina.core.ContainerBase
> > addChildInternal
> > SEVERE: ContainerBase.addChild: start:
>
> App start fails...
>
> > Caused by: java.lang.ClassNotFoundException:
> > org.springframework.core.io.Resource
> > at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
> > at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
> > ... 25 more
>
> Missing class is org.springframework.core.io.Resource.  Where is your
> spring-core-3.1.0.RELEASE.jar file?
>


/web/lib/spring-core-3.1.0.RELEASE.jar


>
> Looking further...
>
> > at
> org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)
> > at
> org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:261)
> > at
> org.apache.catalina.startup.WebAnnotationSet.loadApplicationListenerAnnotations(WebAnnotationSet.java:90)
> > at
> org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:65)
> > at
> org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:405)
> > at
> org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)
> > at
> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
> > at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
> > at
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
> > at
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269)
> > at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>
> The stack trace seems to indicate that this error occurred while the
> container was scanning for annotations.  Is your application making use of
> Spring's WebApplicationInitializer functionality?  If not, you might want
> to disable it and see if the error goes away.
>

Sorry I don't know.  ​​


We just tried adding every jar file in /web/lib/ to the classpath and that
seemed to work out, so this brings me back to whats wrong with
common.loader?

common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,/web/lib,/web/lib/*.jar




> Dan
>
> >
> >
> > On Thu, Aug 22, 2013 at 8:58 AM, Daniel Mikusa <dmik...@gopivotal.com
> >wrote:
> >
> >> On Aug 22, 2013, at 8:38 AM, D C <dc12...@gmail.com> wrote:
> >>
> >>> [tomcat@test05 logs]# grep "from file" catalina.out  | sed 's/.*from
> >>> file//g' | sed 's/\/lib\/.*/\/lib/g' | sort -u
> >>> :/opt/apache-tomcat-7.0.40/bin/bootstrap.jar]
> >>> :/opt/apache-tomcat-7.0.40/bin/tomcat-juli.jar]
> >>> :/opt/apache-tomcat-7.0.40/lib
> >>> :/opt/jdk1.7.0.21/jre/lib
> >>>
> >>
> :/web/webapps/myApp/WEB-INF/classes/com/myco/management/spring_utils/ContextLoaderListener.class]
> >>> :/web/webapps/myApp/WEB-INF/lib
> >>
> >> Can you show the unaltered output?  If you want to filter out stuff to
> >> make it smaller, filter out any classes that were loaded from the JDK.
> >>
> >> Dan
> >>
> >>>
> >>>
> >>>
> >>> Thanks,
> >>> Dan
> >>>
> >>>
> >>> On Thu, Aug 22, 2013 at 6:47 AM, Daniel Mikusa <dmik...@gopivotal.com
> >>> wrote:
> >>>
> >>>> On Aug 21, 2013, at 5:09 PM, D C <dc12...@gmail.com> wrote:
> >>>>
> >>>>> I added verbose,  it does not appear to attempt to load anything from
> >>>>> /web/lib/
> >>>>
> >>>> Ok.  Where do you see it loading classes from?  /WEB-INF/lib/*.jar?
>  Do
> >>>> you see any classes listed that you would expect to be loaded from
> >>>> /web/lib? Where are they being loaded from?
> >>>>
> >>>>> for permissions i verified that i could read the files as the tomcat
> >>>> user.​
> >>>>
> >>>> Good
> >>>>
> >>>>> Thanks,
> >>>>> Dan
> >>>>>
> >>>>>
> >>>>> On Wed, Aug 21, 2013 at 5:01 PM, Daniel Mikusa <
> dmik...@gopivotal.com
> >>>>> wrote:
> >>>>>
> >>>>>> On Aug 21, 2013, at 4:48 PM, D C <dc12...@gmail.com> wrote:
> >>>>>>
> >>>>>>> So here is what I'm trying to achieve.
> >>>>>>>
> >>>>>>> 1. The tomcat install remains clean.  I want to be able to change
> the
> >>>>>>> tomcat installation without messing with the app.
> >>>>>>> 2. We want our applications to be decoupled from the libraries
> which
> >> it
> >>>>>>> needs.  ( i understand the pains you are referring to..  this was a
> >> bit
> >>>>>> of
> >>>>>>> debate, but this is what we want to do).
> >>>>>>> 3. We want our engineering team to manage libs via RPM, not the
> >>>>>> developers.
> >>>>>>>
> >>>>>>> tomcat is installed like so via RPM.
> >>>>>>> /opt/tomcat-6.0.35
> >>>>>>> /opt/tomcat-7.0.39
> >>>>>>> /opt/tomcat-7.0.40
> >>>>>>> /tomcat symlinks to which ever  /opt/tomcat-7.0.40
> >>>>>>>
> >>>>>>> Context entries go in /tomcat/conf/Catalina/localhost/myApp.xml
> >>>>>>>
> >>>>>>> /web/webapps - holds our webapps.  This much works perfectly.
> >>>>>>> /web/conf/myApp - holds our application configs.
> >>>>>>> /web/lib - holds any libs that are not part of the base tomcat
> >>>>>>> installation.  This is managed by rpm.
> >>>>>>>
> >>>>>>> If unpack a war file, and it has contents inside WEB_INF/lib,  we
> >> will
> >>>>>>> consider that a broken build.
> >>>>>>>
> >>>>>>>
> >>>>>>> Everything works, except that my libs are not loading..  I had
> >> thought
> >>>>>> that
> >>>>>>> I could add /web/lib,/web/lib/*.jar to the common.loader.  Am I
> >>>> mistaken
> >>>>>> by
> >>>>>>> this?
> >>>>>>
> >>>>>> You can certainly add entries to common.loader and yours looks OK.
> >>>>>>
> >>>>>> Assuming the paths exist and permissions on those paths are correct,
> >> I'd
> >>>>>> suggest adding the "-verbose" JVM argument to your bin/setenv.sh
> file.
> >>>>>> This will show you the location of classes that are being loaded.
> >>>> Perhaps
> >>>>>> it is loading classes from those locations and there is some other
> >>>> reason
> >>>>>> you are getting the ClassNotFoundException.
> >>>>>>
> >>>>>> Dan
> >>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> Thanks,
> >>>>>>> Dan
> >>>>>>>
> >>>>>>>
> >>>>>>> On Wed, Aug 21, 2013 at 4:27 PM, Daniel Mikusa <
> >> dmik...@gopivotal.com
> >>>>>>> wrote:
> >>>>>>>
> >>>>>>>> On Aug 21, 2013, at 4:09 PM, David kerber <dcker...@verizon.net>
> >>>> wrote:
> >>>>>>>>
> >>>>>>>>> Basically you're trying to defeat the way the system is designed
> to
> >>>>>>>> work.  Don't do that…
> >>>>>>>>
> >>>>>>>> +1 Don't do what you've described unless you have a very good
> >> reason.
> >>>>>> It
> >>>>>>>> will cause you many headaches.
> >>>>>>>>
> >>>>>>>> Keep all of your JAR files in "WEB-INF/lib", with the exception of
> >>>> JDBC
> >>>>>>>> drivers.  Put those in "$CATALINA_BASE/lib".
> >>>>>>>>
> >>>>>>>> Dan
> >>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> On 8/21/2013 3:58 PM, D C wrote:
> >>>>>>>>>> Tomcat 7.0.40
> >>>>>>>>>> CentOS 6.3
> >>>>>>>>>> Java 1.7.0_21
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> I am trying to move all libraries out of my webapps directory,
> and
> >>>>>> into
> >>>>>>>> a
> >>>>>>>>>> common place.
> >>>>>>>>>>
> >>>>>>>>>> I have my libs that were bundled with tomcat in /tomcat/lib (the
> >>>>>>>> default),
> >>>>>>>>>> and my extra libs i want to keep in /web/lib.
> >>>>>>>>>>
> >>>>>>>>>> I've updated /tomcat/conf/catalina.properties to use the
> >> following:
> >>>>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>
> >>
> common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,/web/lib,/web/lib/*.jar
> >>>>>>>>>>
> >>>>>>>>>> I have my database resource located in
> >>>>>>>>>> /tomcat/conf/Catalina/localhost/myApp.xml  (probably not
> relevant)
> >>>>>>>>>>
> >>>>>>>>>> When I start tomcat, I get the errors listed below.  However if
> I
> >>>> move
> >>>>>>>>>> /web/lib/*  to webapps/myApp/WEB_INF/lib/  it works fine.
> >>>>>>>>>>
> >>>>>>>>>> What am I missing here?
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> catalina.out snip.
> >>>>>>>>>> SEVERE: ContainerBase.addChild: start:
> >>>>>>>>>> org.apache.catalina.LifecycleException: Failed to start
> component
> >>>>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>
> >>
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/myApp]]
> >>>>>>>>>>     at
> >>>>>>>>>>
> >> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
> >>>>>>>>>>     at
> >>>>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
> >>>>>>>>>>     at
> >>>>>>>>>>
> >>>>>>
> >> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
> >>>>>>>>>>     at
> >>>>>>>>>>
> >>>> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
> >>>>>>>>>>     at
> >>>>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)
> >>>>>>>>>>     at
> >>>>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1636)
> >>>>>>>>>>     at
> >>>>>>>>>>
> >>>>>>
> >> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> >>>>>>>>>>     at
> >>>>>>>>>>
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
> >>>>>>>>>>     at java.util.concurrent.FutureTask.run(FutureTask.java:166)
> >>>>>>>>>>     at
> >>>>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>
> >>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> >>>>>>>>>>     at
> >>>>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>
> >>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> >>>>>>>>>>     at java.lang.Thread.run(Thread.java:722)
> >>>>>>>>>> Caused by: java.lang.NoClassDefFoundError:
> >>>>>>>>>> org/springframework/core/io/Resource
> >>>>>>>>>>     at java.lang.Class.getDeclaredFields0(Native Method)
> >>>>>>>>>>     at java.lang.Class.privateGetDeclaredFields(Class.java:2317)
> >>>>>>>>>>     at java.lang.Class.getDeclaredFields(Class.java:1762)
> >>>>>>>>>>     at
> >>>>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)
> >>>>>>>>>>     at
> >>>>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:261)
> >>>>>>>>>>     at
> >>>>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.catalina.startup.WebAnnotationSet.loadApplicationListenerAnnotations(WebAnnotationSet.java:90)
> >>>>>>>>>>     at
> >>>>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:65)
> >>>>>>>>>>     at
> >>>>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:405)
> >>>>>>>>>>     at
> >>>>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)
> >>>>>>>>>>     at
> >>>>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
> >>>>>>>>>>     at
> >>>>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
> >>>>>>>>>>     at
> >>>>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
> >>>>>>>>>>     at
> >>>>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269)
> >>>>>>>>>>     at
> >>>>>>>>>>
> >> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> >>>>>>>>>>     ... 11 more
> >>>>>>>>>> Caused by: java.lang.ClassNotFoundException:
> >>>>>>>>>> org.springframework.core.io.Resource
> >>>>>>>>>>     at
> >>>>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
> >>>>>>>>>>     at
> >>>>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
> >>>>>>>>>>     ... 25 more
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> Thanks,
> >>>>>>>>>> Dan
> >>>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >> ---------------------------------------------------------------------
> >>>>>>>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >>>>>>>>> For additional commands, e-mail: users-h...@tomcat.apache.org
> >>>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >> ---------------------------------------------------------------------
> >>>>>>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >>>>>>>> For additional commands, e-mail: users-h...@tomcat.apache.org
> >>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >>>>>> For additional commands, e-mail: users-h...@tomcat.apache.org
> >>>>>>
> >>>>>>
> >>>>
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >>>> For additional commands, e-mail: users-h...@tomcat.apache.org
> >>>>
> >>>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >> For additional commands, e-mail: users-h...@tomcat.apache.org
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to