I am working on a web application installed on a Tomcat server. In my local test system, I use Eclipse and WST to deploy my code to the server. If stack traces are selected, I can see the source file and line number for each line - as expected.
However, if an exception is thrown in the production system, the source file is unknown, as well as the line number. This applies only to my own code, for all elements of the stack in the trace of external libraries the source file and line number are known.
I compile my project as follows (using Ant):
<javac srcdir="${src}" destdir="${build}" fork="true" debug="true" debuglevel="lines, vars, source"> <classpath refid="classpath" /> </javac>
I can absurdly not find out where the problem is, although it should be very simple to solve.
Thank you for your help!
→ Edit: Additional information about my deployment: I definitely use these Ant targets to create a war file:
<target name="compile" depends="update-dependencies"> <mkdir dir="${build}" /> <javac srcdir="${src}" destdir="${build}" fork="true" debug="true" debuglevel="lines, vars, source"> <classpath refid="classpath" /> </javac> <javac srcdir="${tests}" destdir="${build}" fork="true" debug="true" debuglevel="lines, vars, source"> <classpath refid="classpath" /> </javac> <copydir dest="${build}" src="${src}"> <exclude name="**/*.java"/> </copydir> <copydir dest="${build}" src="${tests}"> <exclude name="**/*.java"/> </copydir> </target> <target name="war" depends="compile"> <war destfile="${war.file}" webxml="WebContent/WEB-INF/web.xml"> <fileset dir="WebContent" /> <lib dir="${lib}" /> <classes dir="${build}" /> </war> </target>
On the local system, I use eclipse for deployment for me, so I do not use any of my target Ants. Do I need .java files in deployment?
→ Edit2: Example of a stack trace (the exception itself is not a problem!):
javax.naming.NamingException: Name is not valid at org.apache.naming.NamingContext.unbind(NamingContext.java:248) at org.apache.naming.NamingContext.unbind(NamingContext.java:282) at org.apache.naming.SelectorContext.unbind(SelectorContext.java:256) at javax.naming.InitialContext.unbind(InitialContext.java:416) at org.hibernate.impl.SessionFactoryObjectFactory.removeInstance(SessionFactoryObjectFactory.java:139) at org.hibernate.impl.SessionFactoryImpl.close(SessionFactoryImpl.java:894) at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.destroy(AbstractSessionFactoryBean.java:251) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.destroy(LocalSessionFactoryBean.java:899) at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:184) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:487) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:463) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:431) at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1048) at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1022) at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:970) HERE: at my.pkg.ContextLoaderListener.closeWebApplicationContext(Unknown Source) HERE: at my.pkg.ContextLoaderListener.contextDestroyed(Unknown Source) at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4174) at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4778) at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:924) at org.apache.catalina.startup.HostConfig.undeployApps(HostConfig.java:1319) at org.apache.catalina.startup.HostConfig.stop(HostConfig.java:1290) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:323) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1086) at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1098) at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:450) at org.apache.catalina.core.StandardService.stop(StandardService.java:587) at org.apache.catalina.core.StandardServer.stop(StandardServer.java:744) at org.apache.catalina.startup.Catalina.stop(Catalina.java:648) at org.apache.catalina.startup.Catalina$CatalinaShutdownHook.run(Catalina.java:692)