Migration jboss to tomcat - javax.naming.NamingException - java

We are Migrating Struts 1.2 project from JDK 1.6 to 1.8 and application server jboss5.1 to tomcat 8.0. Database connection is working fine and initial pages are loading and populating some data. But when i do any action(Submit button)it throws an exception javax.naming.NamingException: Cannot create resource instance Same code was working in jboss 5.1 but getting an error in Tomcat 8.
But i am suspecting reason for the error is UserTransaction needs to be defined separately in the context.xml but not sure about it. Please let me know.
UserTransaction ut = (UserTransaction) myCntxt.lookup("java:comp/UserTransaction");
If UserTransaction needs to be defined , Please let me know how to configure in Tomcat server ?
Added database configuration in context.xml under META-INF/context.xml
<Resource name="jdbc/Test1"
auth="Container"
type="javax.sql.DataSource"
maxTotal="100"
maxIdle="30"
maxWaitMillis="10000"
username="xxxxx"
password="xxxxx"
driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:#xxxx:1527:xxxx" />
<Resource name="jdbc/Test2"
auth="Container"
type="javax.sql.DataSource"
maxTotal="100"
maxIdle="30"
maxWaitMillis="10000"
username="xxxxx"
password="xxxxx"
driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:#xxxx:1527:xxxx" />
Added data source reference in web.xml under {project}/WEB-INF/web.xml
<resource-ref>
<description>Oracle Datasource</description>
<res-ref-name>jdbc/Test1</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
<description>Oracle Datasource</description>
<res-ref-name>jdbc/Test2</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
Sample Code
public static void dbInit(String test1dataSourceReference,String test2dataSourceReference) throws Exception
{
Context ctx = new InitialContext();
tds =(DataSource) ctx.lookup("java:comp/env/" + test1dataSourceReference);
cds = (DataSource) ctx.lookup("java:comp/env/" + test2dataSourceReference);
}
Stack-trace:
Dec 25, 2019 7:28:07 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
Dec 25, 2019 7:28:07 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
Dec 25, 2019 7:28:07 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
Dec 25, 2019 7:28:07 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
Dec 25, 2019 7:28:08 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.logic.LocalStrings', returnNull=true
Dec 25, 2019 7:28:08 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
Dec 25, 2019 7:28:08 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
Dec 25, 2019 7:28:22 AM org.apache.struts.action.RequestProcessor processException
WARNING: Unhandled Exception thrown: class javax.naming.NamingException
Dec 25, 2019 7:28:22 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [action] in context with path [/policy] threw exception [javax.naming.NamingException: Cannot create resource instance] with root cause
javax.naming.NamingException: Cannot create resource instance
at org.apache.naming.factory.FactoryBase.getObjectInstance(FactoryBase.java:96)
at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
at org.apache.naming.NamingContext.lookup(NamingContext.java:847)
at org.apache.naming.NamingContext.lookup(NamingContext.java:158)
at org.apache.naming.NamingContext.lookup(NamingContext.java:835)
at org.apache.naming.NamingContext.lookup(NamingContext.java:172)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:157)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.db.DbQuery.saveAppRejValue(DbQuery.java:798)
at com.actions.PolicyAction.executeDisplay(PolicyAction.java:298)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)

As the TomEE Comparison page indicates Tomcat does not have support for JTA (JSR 907):
You'll either need to remove the JTA code or consider another EE server like Wildfly as a simpler upgrade path.

you can deploy a 3rd party TransactionManager solution (ie Atomikos) in your Tomcat, we have done it with an older version of Tomcat. We now run Struts1 (and Struts2) app on JBoss 6, so the code is compatible with newer JBoss which provides a JTA implementation.
You can remove the transactional boundaries from your code (keeping ORM and DAO code) but I am not sure it is a great idea as data inconsistency is a risk.
If you want to minimise changes I would try to upgrade to a newer JBoss version.
A better medium-term solution is to integrate Spring Transaction Management (if you don't need to handle transactions across multiple resources).
A long-term solution would be to refactor out Struts1 (epic effort probably but I must mention it).
Good luck.
Beppe

Related

SEVERE: Error manager.start() java.lang.NullPointerException

I am using the Persistent Manager Implementation on the tomcat server with a JDBC Store, Which stores the session data in the DB table instead of storing in tomcat. I Configured my context.xml file like shown below for my oracle DB.
<Valve className="org.apache.catalina.valves.PersistentValve" />
<Resource name="jdbc/mydb" type="javax.sql.DataSource"
maxActive="50" maxIdle="20" maxWait="5000" validationQuery="select 1 from dual"
removeAbandoned="true" logAbandoned="true" driverClassName="oracle.jdbc.driver.OracleDriver"
username="myusername" password="mypassword"
url="jdbc:oracle:thin:#192.168.1.63:1521/orcl" />
<Manager className="org.apache.catalina.session.PersistentManager"
distributable="true" processExpiresFrequency="3" maxIdleBackup="1" saveOnRestart='false'>
<Store className="org.apache.catalina.session.JDBCStore"
dataSourceName="jdbc/mydb"
sessionAppCol="app_name" sessionDataCol="session_data" sessionIdCol="session_id"
sessionLastAccessedCol="last_access" sessionMaxInactiveCol="max_inactive"
sessionTable="tomcat_sessions" sessionValidCol="valid_session" />
</Manager>
The session data is storing in DB table as excepted. But now i want to do the same for my MySQL DB and I configured in the same way which i did for Oracle DB. Only made required changes for MySQL in the Resource as shown below. But it is throwing NullPointerException.
<Resource name="jdbc/mydb" type="javax.sql.DataSource"
maxActive="150" maxIdle="100" maxWait="5000" validationQuery="select 1"
removeAbandoned="true" logAbandoned="true" driverClassName="com.mysql.jdbc.Driver"
username="myusername" password="mypassword"
url="jdbc:mysql://192.168.1.205:2222/mydbname" />
Stack Trace:
SEVERE: Error manager.start()
java.lang.NullPointerException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:195)
at org.apache.catalina.session.JDBCStore.open(JDBCStore.java:861)
at org.apache.catalina.session.JDBCStore.getConnection(JDBCStore.java:833)
at org.apache.catalina.session.JDBCStore.start(JDBCStore.java:968)
at org.apache.catalina.session.PersistentManagerBase.start(PersistentManagerBase.java:995)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4714)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
May 12, 2019 2:32:07 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [] startup failed due to previous errors
May 12, 2019 2:32:07 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8090
May 12, 2019 2:32:07 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8011
May 12, 2019 2:32:07 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/22 config=null
May 12, 2019 2:32:07 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 262912 ms
Exception in thread "Quartz Scheduler [SCHEDULERS]" May 12, 2019 2:33:58 PM org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load org.quartz.utils.ExceptionHelper. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1566)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at org.quartz.SchedulerException.getUnderlyingException(SchedulerException.java:169)
at org.quartz.SchedulerException.toString(SchedulerException.java:265)
at java.lang.String.valueOf(String.java:2849)
at java.lang.StringBuilder.append(StringBuilder.java:128)
at org.springframework.core.NestedExceptionUtils.buildMessage(NestedExceptionUtils.java:47)
at org.springframework.core.NestedRuntimeException.getMessage(NestedRuntimeException.java:74)
at java.lang.Throwable.getLocalizedMessage(Throwable.java:391)
at java.lang.Throwable.toString(Throwable.java:480)
at java.lang.String.valueOf(String.java:2849)
at java.io.PrintStream.println(PrintStream.java:821)
at org.apache.tomcat.util.log.SystemLogHandler.println(SystemLogHandler.java:242)
at java.lang.Throwable$WrappedPrintStream.println(Throwable.java:748)
at java.lang.Throwable.printStackTrace(Throwable.java:655)
at java.lang.Throwable.printStackTrace(Throwable.java:643)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1061)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1052)
at java.lang.Thread.dispatchUncaughtException(Thread.java:1986)
Exception: java.lang.NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread "Quartz Scheduler [SCHEDULERS]"
Exception in thread "Quartz Scheduler [SCHEDULERS]"
Exception: java.lang.NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread "Quartz Scheduler [SCHEDULERS]"

Tomcat 7 stops receiving HTTP-requests

I have a Tomcat 7 server that receives a lot of GET-requests. This works very well for some time, then suddenly it stops working (after 7-8 hours).
When it stops working, I am getting this error:
mai 06, 2015 12:47:58 AM org.apache.coyote.http11.AbstractHttp11Processor process
INFO: Error parsing HTTP request header
Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.
All others errors after this, is just the same. I have tried to stop the get-requests, but it crashes after a while anyways. Do you have any ideas?
This is right before it crashes:
[06/May/2015:10:47:11 +0200] "GET /ListenerServlet?request=getLastChanged&_=1430852558104 HTTP/1.1" 200 32
After the crash:
[06/May/2015:10:47:14 +0200] "GET /ListenerServlet?request=getLastChanged&_=1430902035081 HTTP/1.1" 500 1674
After the crash, the Servlet can't get the request parameter.. that throws this nullpointer:
SEVERE: Servlet.service() for servlet [RoomServlet] in context with path [] threw exception java.lang.NullPointerException
at factory.Factory.initEditMode(Factory.java:37)
at factory.Factory.init(Factory.java:20)
at factory.TabsFactory.<init>(TabsFactory.java:19)
at servlet.RoomServlet.getTabs(RoomServlet.java:285)
at servlet.RoomServlet.doGet(RoomServlet.java:46)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
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:745)
followed by:
mai 07, 2015 9:58:00 AM org.apache.catalina.core.StandardContext listenerStop
SEVERE: Exception sending context destroyed event to listener instance of class websocket.drawboard.DrawboardContextListener
java.lang.NoClassDefFoundError: javax/websocket/Endpoint
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2944)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1208)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)
at websocket.drawboard.DrawboardContextListener.contextDestroyed(DrawboardContextListener.java:32)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5014)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5659)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1575)
at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1564)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
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:745)
Caused by: java.lang.ClassNotFoundException: javax.websocket.Endpoint
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1718)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)
... 17 more
IF there is anything more I need to add, let me know! I really appreciate.
EDIT: Today was a good day, I got a new error! This might have something with the JDBC....
The last packet successfully received from the server was 33 921 291
milliseconds ago. The last packet sent successfully to the server was
1 milliseconds ago. No operations allowed after connection closed.
You can try installing Apache Tomcat v7.0.53 or higher.
Maybe you have a file descriptor leak, which could cause failure in class loading, you can check how many file descriptor are open by using lsof.
I found out the solution to this almost by random.
There was nothing related to:
org.apache.coyote.http11.AbstractHttp11Processor process
but it was rather a JDBC problem.. the connection closed after 8 hours, and I didn't get any errors in the Servlet' for this.
The solution for me was to add some lines in my application's Context:
I added:
url="jdbc:mysql://127.0.0.1:3306/test?autoReconnect=true"
dontTrackOpenResources="true"
testWhileIdle="true"
timeBetweenEvictionRunsMillis="300000"
This is my full Context now:
<Context>
<Resource name="jdbc/test" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="100" maxWait="30000"
username="test" password="bestpassword"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://127.0.0.1:3306/test?autoReconnect=true"
removeAbandoned="true" removeAbandonedTimeout="10"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
fairQueue="true"
dontTrackOpenResources="true"
testWhileIdle="true"
timeBetweenEvictionRunsMillis="300000"
/>
</Context>
My server has not crashed in a week now, and I believe it wont crash again.

Tomcat server failure error

Hi I am trying to learn Struts ans Tomcat with java ans every tutorial exemple is crashing. I have not found anything yet and I am searching for two days the solution. It says:
Infos: Parsing configuration file [struts-default.xml]
janv. 08, 2014 5:01:08 PM com.opensymphony.xwork2.config.providers.XmlConfigurat
ionProvider info
Infos: Parsing configuration file [struts-plugin.xml]
janv. 08, 2014 5:01:08 PM org.apache.struts2.dispatcher.Dispatcher error
Grave: Dispatcher initialization failed
Unable to load configuration. - bean - jar:file:/K:/StefanOprean/sop/java/code/.
metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Events/WEB-INF/lib
/struts2-gxp-plugin-2.3.16.jar!/struts-plugin.xml:8:162
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(Configu
rationManager.java:70)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatche
r.java:445)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:489)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperation
s.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(S
trutsPrepareAndExecuteFilter.java:57)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilte
rConfig.java:281)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilter
Config.java:262)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterCon
fig.java:107)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:47
75)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:
5452)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:15
59)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:15
49)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: Unable to load bean: type:org.apache.struts2.views.gxp.inject.Injecte
dObjectContainer class:org.apache.struts2.views.gxp.inject.InjectedObjectContain
er - bean - jar:file:/K:/StefanOprean/sop/java/code/.metadata/.plugins/org.eclip
se.wst.server.core/tmp0/wtpwebapps/Events/WEB-INF/lib/struts2-gxp-plugin-2.3.16.
jar!/struts-plugin.xml:8:162
and many more.
Some words are changed because the OS is in French (eg: Grave meanse Sever). Please help me!
Shall I post the xml or the jsp files?
Here are the jars that I use

Can I have some help translating some error messages into tangible information?

When trying to view a specific page on my web site it comes up blank in the browser but in Eclipse a long error message is generated from tomcat.
The page that is coming up blank is not a page I have modified yet. I have modified some other pages and they are working fine but now that I have modified them this particular page is generating the errors when visiting it.
The error is very long so I'm just going to post what I believe to be the important parts. If more of the error is needed please let me know.
I've read through the error but I'm not sure what exactly the server is trying to tell me is wrong.
Hopefully some one will be able to point me in the right direction. Thank you ahead of time.
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:tunestore' did not find a matching property.
Nov 22, 2011 6:25:28 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/root/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/tunestore/WEB-INF/lib/servlet-api-2.4.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
log4j:WARN No appenders could be found for logger (com.tunestore.util.DBUtil).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Nov 22, 2011 6:25:37 PM org.apache.jasper.compiler.TldLocationsCache tldScanJar
INFO: 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.
Nov 22, 2011 6:25:39 PM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 50 in the generated java file
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory
Stacktrace:
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:331)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:457)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
.....(continues)
Nov 22, 2011 6:25:39 PM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.ClassNotFoundException: org.apache.jsp.WEB_002dINF.tiles.comments_jsp
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:132)
at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:132)
at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:172)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
......(continues)
Nov 22, 2011 6:25:39 PM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.ClassNotFoundException: org.apache.jsp.WEB_002dINF.tiles.comments_jsp
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:132)
at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)
....(continues)
Nov 22, 2011 6:25:39 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [ActionServlet] in context with path [/tunestore] threw exception [org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: ServletException in '/WEB-INF/tiles/comments.jsp': org.apache.jsp.WEB_002dINF.tiles.comments_jsp] with root cause
java.lang.ClassNotFoundException: org.apache.jsp.WEB_002dINF.tiles.comments_jsp
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:132)
at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:132)
.....(continues)
Nov 22, 2011 6:25:40 PM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 35 in the generated java file
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory
Stacktrace:
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:331)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:457)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:644)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
.....continues
Nov 22, 2011 6:25:40 PM org.apache.catalina.core.StandardHostValve custom
SEVERE: Exception Processing ErrorPage[exceptionType=java.lang.Throwable, location=/error.jsp]
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 35 in the generated java file
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory
Stacktrace:
at
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:331)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:457)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
.....(continues)
And here is the list of my libraries:
antisamy-1.4.3.jar
antlr-2.7.2.jar
avalon-framework-4.1.3.jar
batik-css-1.7.jar
batik-ext-1.7.jar
batik-util-1.7.jar
bsh-core-2.0b4.jar
commons-beanutils-1.7.0.jar
commons-beanutils-core-1.7.0.jar
commons-chain-1.1.jar
commons-codec-1.2.jar
commons-collections.jar
commons-collections-3.2.jar
commons-configuration-1.5.jar
commons-dbcp.jar
commons-digester-1.8.jar
commons-fileupload-1.2.jar
commons-httpclient-3.1.jar
commons-lang-2.3.jar
commons-logging.jar
commons-logging-1.1.jar
commons-pool.jar
commons-validator-1.3.1.jar
derby.jar
derbyclient.jar
derbynet.jar
dom4j-1.6.1.jar
esapi-2.0.1.jar
jaxen-1.1-beta-8.jar
jdom-1.0.jar
jsp-api-2.0.jar
jstl.jar
log4j-1.2.16.jar
logkit-1.0.1.jar
nekohtml-1.9.12.jar
oro-2.0.8.jar
servlet-api-2.4.jar
spring-beans.jar
spring-context.jar
spring-core.jar
spring-web.jar
spring-webmvc-struts.jar
standard.jar
struts-core-1.3.8.jar
struts-extras-1.3.8.jar
struts-taglib-1.3.8.jar
struts-tiles-1.3.8.jar
xalan-2.7.0.jar
xercesImpl-2.6.2.jar
xml-apis-1.0.b2.jar
xml-apis-ext-1.3.04.jar
xmlParserAPIs-2.6.2.jar
xom-1.1.jar
You must not deploy the jsp-api and servlet-api jars in your web app.
Doing so makes the container go bananas and can cause all manner of error messages, generally not related to anything that makes much immediate sense or that's related directly to your code.

tomcat exception

I recently deployed a war file.
I got the following error:
[http-8080-Processor24] ERROR Exception sending context initialized
event o listener instance of class app.util.ApplicationEventsListener
[at org.apache.
atalina.core.StandardContext.listenerStart(StandardContext.java:3768)]
ava.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlObject
at app.util.ApplicationEventsListener.contextInitialized(ApplicationEven
sListener.java:31)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
.java:3764)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
16)
at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:
173)
at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServl
t.java:549)
at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServl
t.java:105)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
cationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
lterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
lve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
lve.java:172)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
orBase.java:525)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
va:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
va:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
e.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
875)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p
ocessConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
nt.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol
owerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ol.java:689)
at java.lang.Thread.run(Thread.java:619) aused by: java.lang.ClassNotFoundException: org.apache.xmlbeans.XmlObject
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
er.java:1386)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
er.java:1232)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 23 more un 23, 2009 2:19:46 PM org.apache.catalina.core.StandardContext start EVERE: Error
listenerStart un 23, 2009 2:19:46 PM
org.apache.catalina.core.StandardContext start EVERE: Context
[/omb-itbrs-web-1.5.3] startup failed due to previous errors
If anyone can help it would be great.
I think this is the cause:
java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlObject
You're missing a JAR that contains the org.apache.xmlbeans.XmlObject.class file.
Download it from one of these sites and put it in the server /lib directory for your Tomcat installation.
What version of Tomcat are you using? Which JDK version?

Categories