-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Randy,
On 12/10/12 6:09 PM, Randy Toor wrote: > I have an existing server which uses the Embedded class which I am > tasked with upgrading to tomcat7 (deprecated, but we'll be keeping > it for the time being). What part is deprecated? The Embedded class itself? Why not just switch-over to using the Tomcat class? It's much easier to use and now would be the time to make the switch. > There were some small changes to the code to fix API breaks but > the startup stuff is the same. When I start up the container I am > now seeing this - > > INFO: Starting tomcat server > org.apache.catalina.startup.Embedded||Dec 7, 2012 12:09:49 PM > org.apache.catalina.startup.Embedded startInternal INFO: Catalina > naming disabled Dec 7, 2012 12:09:49 PM > org.apache.catalina.core.StandardEngine startInternal INFO: > Starting Servlet Engine: Apache Tomcat/7.0.32 Dec 7, 2012 12:09:49 > PM org.apache.catalina.util.LifecycleBase start INFO: The start() > method was called on component [Realm[NullRealm]] after start() had > already been called. The second call will be ignored. > org.apache.catalina.util.LifecycleBase||Dec 7, 2012 12:09:49 PM > org.apache.catalina.util.LifecycleBase start Dec 7, 2012 12:09:49 > PM org.apache.catalina.core.ContainerBase startInternal SEVERE: A > child container failed during start > java.util.concurrent.ExecutionException: > org.apache.catalina.LifecycleException: Failed to start component > [StandardEngine[OSGiEngine].StandardHost[tomcathost].StandardContext[]] > > at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222) > at java.util.concurrent.FutureTask.get(FutureTask.java:83) at > org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123) > > at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800) > at > org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) > > at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) > at > org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) > > at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) > at java.util.concurrent.FutureTask.run(FutureTask.java:138) at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:743) Caused by: > org.apache.catalina.LifecycleException: Failed to start component > [StandardEngine[OSGiEngine].StandardHost[tomcathost].StandardContext[]] > > at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) > ... 7 more Caused by: java.lang.NullPointerException: while trying > to invoke the method org.apache.catalina.Service.findConnectors() > of an object loaded from local variable 's' at > org.apache.catalina.core.ApplicationContext.populateSessionTrackingModes(ApplicationContext.java:1191) > > at org.apache.catalina.core.ApplicationContext.<init>(ApplicationContext.java:125) > at > org.apache.catalina.core.StandardContext.getServletContext(StandardContext.java:2323) > > at org.apache.catalina.core.StandardContext.postWorkDirectory(StandardContext.java:6062) > at > org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5102) > > at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) > ... 7 more org.apache.catalina.core.ContainerBase||Dec 7, 2012 > 12:09:49 PM org.apache.catalina.core.ContainerBase startInternal > > > I looked into that particular line in ApplicationContext and I see > this code is new in tomcat7 - > > Service s = ((Engine) > context.getParent().getParent()).getService(); Connector[] > connectors = s.findConnectors(); > > > Looking at the API docs for Engine, it indicates that a Service > does not necessarily need to be associated with an Engine (from the > docs - "Set the Service with which we are associated (if any)". Am > I missing a step now to prevent this? Or should there be a null > check here? Can your post your own code that uses the Embedded class? It will probably be easier to spot a place where you've missed something important (or have it out of order) than to just look at the stack trace above and try to debug Tomcat in order to determine the original mistake. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with undefined - http://www.enigmail.net/ iEYEAREIAAYFAlDHUbIACgkQ9CaO5/Lv0PD+kQCfQ0i2evO0hn7g0E66MlpHpy4Q jfsAnjOqNnKIHZRlK/zuDsr4VssZQVZR =josl -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org