I am developing a simple servlet based web application. I am not using any IDE. Following are the steps that i have followed.
Folder Structure :
MyAPP -> Contains WEB-INF folder and index.html
WEB-INF contains 2 folders and web.xml.
Path to loginServlet.java : MyAPP\WEB-INF\classes\servletclass\loginServlet.java
WEB_INF contains lib folder which conatins servlet-api.jar
index.html contains a form and the action attribute of the form contains "login" as value.
MyAPP\WEB-INF\web.xml looks like below :
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>loginServlet</servlet-name>
<servlet-class>servletclass.loginServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>loginServlet</servlet-name>
<url-pattern>/login</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
</web-app>
Compiled the loginServlet.java using command prompt. It created a loginServlet.class file.
Now built a war file using command prompt and deployed it on Tomcat server.
Now when i run the application, it succesfully loads index.html. But as soon as click on Submit button in the form it shows the following error:
java.lang.NoClassDefFoundError: servletclass/loginServlet (wrong name: loginServlet)
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(Unknown Source)
java.security.SecureClassLoader.defineClass(Unknown Source)
org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2260)
org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:803)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1244)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1109)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:456)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:784)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:802)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1452)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Unknown Source)
Alan is right, do you have the following declaration in your Java file?
package servletclass;
This question already has answers here:
Struts 2 : There is no Action mapped for namespace [/]
(5 answers)
Closed 6 years ago.
I followed a Javabrains tutorial and when run my Struts 2 application on Tomcat on Eclipse, it gives following error:
HTTP Status 404 - /Struts2Starter/
description- The requested resource is not available.
Jul 3, 2015 1:10:11 PM org.apache.struts2.dispatcher.Dispatcher error
SEVERE: Dispatcher initialization failed
Unable to load configuration. - action - file:/C:/Software_Installation/Apache/apache-tomcat-7.0.62/wtpwebapps/Struts2Starter/WEB-INF/classes/struts.xml:10:83
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:967)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:435)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:479)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4854)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5546)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
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:619)
Caused by: Action class [org.koushik.javabrains.action.TutorialAction] not found - action - file:/C:/Software_Installation/Apache/apache-tomcat-7.0.62/wtpwebapps/Struts2Starter/WEB-INF/classes/struts.xml:10:83
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:486)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:429)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:556)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:295)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:264)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
... 18 more
Jul 3, 2015 1:10:11 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
Unable to load configuration. - action - file:/C:/Software_Installation/Apache/apache-tomcat-7.0.62/wtpwebapps/Struts2Starter/WEB-INF/classes/struts.xml:10:83
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:493)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4854)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5546)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
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:619)
Caused by: Unable to load configuration. - action - file:/C:/Software_Installation/Apache/apache-tomcat-7.0.62/wtpwebapps/Struts2Starter/WEB-INF/classes/struts.xml:10:83
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:967)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:435)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:479)
... 15 more
struts.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//apache software foundation//DTD StrutsConfiguration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="default" namespace="/tutorials" extends="struts-default">
<action name="getTutorial" class="org.koushik.javabrains.action.TutorialAction">
<result name="success">/success.jsp</result>
<result name="failure">/error.jsp</result>
</action>
</package>
</struts>
web.xml
<?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>Struts2Starter</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-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
TutorialAction.java
package org.koushik.javabrains.action;
public class TutorialAction {
public String execute(){
System.out.println("Hello from execute");
return "failure" ;
}
}
I created the success.jsp, error.jsp & index.jsp files as well. I'm using eclipse-indigo & Apache tomcat 7.0.62. When I run the project on Tomcat server it shows this error message on console and shows HTTP Status 404 - /Struts2Starter description The requested resource is not available. error message on a new tab named Apache Tomcat.
Copy the .jar files into the WebContent/WEB-INF/lib folder,the Deployment assembly definition you would have provided as per the tutorials for struts library might not be working when you deploy your application. It worked for me.
I'm having some issues deploying a Spring Boot application to a Weblogic 10.3.3 Server. I'm desperately crossing my fingers in hopes that someone has seen this issue before. I use Weblogic's admin console to perform the deployment (and that seems to go well), but I get an error from Weblogic when I attempt to start the application:
Caused By: java.lang.IllegalArgumentException: Invalid source 'com.example.Application'
at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:223)
at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:144)
at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:127)
at org.springframework.boot.SpringApplication.load(SpringApplication.java:620)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:139)
at org.springframework.boot.legacy.context.web.SpringBootContextLoaderListener.initWebApplicationContext(SpringBootContextLoaderListener.java:61)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1863)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3126)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1512)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:486)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:1267)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:409)
at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:43)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116)
at weblogic.deploy.internal.targetserver.operations.StartOperation.doCommit(StartOperation.java:143)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
The app is deployed as a WAR file using spring-boot-legacy and a web.xml. It runs fine on Tomcat 6/7/8. Here are my relevant config files:
web.xml
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>com.example.Application</param-value>
</context-param>
<listener>
<listener-class>org.springframework.boot.legacy.context.web.SpringBootContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>ERROR</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<servlet>
<servlet-name>helloWorld</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextAttribute</param-name>
<param-value>org.springframework.web.context.WebApplicationContext.ROOT</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>helloWorld</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
weblogic.xml
<wls:weblogic-web-app
xmlns:wls="http://www.bea.com/ns/weblogic/weblogic-web-app"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app
http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
<wls:context-root>helloWorld</wls:context-root>
<wls:container-descriptor>
<wls:prefer-application-packages>
<wls:package-name>org.slf4j.*</wls:package-name>
</wls:prefer-application-packages>
</wls:container-descriptor>
Tracing through the stack trace, it appears that Spring Boot's BeanDefinitionLoader class attempts to load the source classes (in my case, just com.example.Application) but fails because it doesn't see it as a class, resource, or package. Looking at the BeanDefinitionLoader class here: BeanDefinitionLoader.java (line 187), it appears that my Application class should get loaded as a Class. Like I mentioned, it does work great in Tomcat, just not in Weblogic.
Is there something Weblogic-specific that I'm missing? Could it be a file encoding issue? Am I missing something from my web.xml?
Thanks for your time!
Update #1
After exhausting Google and StackOverflow for things to try, I added the spring.main.sources: com.example.Application to my application.yml. It had no effect.
My current hunch right now is that the contextAttribute parameter in my web.xml might have something to do with my issue. Just unsure what else I can change it to. Thoughts?
Check that your building your war with the same version of Java as the Weblogic server is running. Eg if it's 1.6 set JAVA_HOME to your 1.6 JDK before running gradle build.
Does boot need higher version of servlet version than Weblogic 10.3.3 Server supports? Does this version bit old??
I am trying to create hibernate listener.I was created listener by help of this article.http://www.developer.am/documentation/struts2/?page=struts-2-hibernate-integration-example
In web.xml i configured listener..I am getting following error.How can i fix this issue??
SEVERE: Exception sending context initialized event to listener instance of class
com.it.utils.HibernateListener
java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at com.it.utils.HibernateListener.contextInitialized(HibernateListener.java:31)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
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:662)
Caused by: java.lang.ClassNotFoundException: org.dom4j.DocumentException
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
... 11 more
I will share web.xml..
<?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>WelcomeStruts</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>register.jsp</welcome-file>
</welcome-file-list>
<listener>
<listener-class>
com.itac.utils.HibernateListener
</listener-class>
</listener>
I am using following jar files in buildpath
x-wrapper-comp-1.8.0.jar
antlr.jar
antlr-2.7.6rc1.jar
antlr-4.0-complete.jar
apache-mime4j-0.6.jar
asm.jar
asm-attrs.jar
c3p0-0.9.2-pre1.jar
cglib-2.1.3.jar
commons-beanutils.jar
commons-codec-1.3.jar
commons-collections-3.2.1.jar
commons-digester.jar
commons-discovery-0.2.jar
commons-fileupload.jar
commons-fileupload-1.2.1.jar
commons-fileupload-1.2.2.jar
commons-httpclient-3.1.jar
commons-io-1.3.2.jar
commons-io-2.0.1.jar
commons-lang-2.3.jar
commons-lang-2.4.jar
commons-lang3-3.1.jar
commons-logging.jar
commons-logging-1.1.1.jar
commons-logging-api-1.1.jar
commons-validator.jar
datafile.jar
displaytag-1.2.jar
displaytag-export-poi-1.2.jar
dom4j-1.6.1.jar
ehcache-1.1.jar
freemarker-2.3.15.jar
freemarker-2.3.19.jar
gson-2.2.2.jar
hibernate.cfg.xml
hibernate3.jar
httpclient-4.0.1.jar
httpcore-4.0.1.jar
httpmime-4.0.1.jar
iText-2.1.7.jar
jaas.jar
jackson-all-1.9.4.jar
jakarta-oro.jar
jasperreports-3.7.4.jar
javassist-3.11.0.GA.jar
jaxen-1.1-beta-7.jar
jaxrpc.jar
jcommon-1.0.16.jar
jdbc2_0-stdext.jar
jfreechart-1.0.13.jar
jsfcompounds-0.0.2.jar
json-lib-2.1.jar
jstl.jar
jta.jar
log4j-1.2.11.jar
log4j-over-slf4j-1.7.2.jar
mchange-commons-0.2.jar
mysql-connector-java-5.0.8-bin.jar
notifier.jar
ognl-2.7.3.jar
ognl-3.0.5.jar
org.json-0.0.1.jar
poi-3.5-beta5-20090219.jar
saaj.jar
slf4j-simple-1.7.2.jar
standard.jar
struts.xml
struts2-core-2.1.8.1.jar
struts2-core-2.3.7.jar
struts2-dojo-plugin-2.1.8.1.jar
struts2-jasperreports-plugin-2.1.8.1.jar
struts2-json-plugin-2.1.8.1.jar
struts2-portlet-plugin-2.1.8.1.jar
struts2-tiles-plugin-2.1.8.1.jar
tiles-api-2.0.6.jar
tiles-core-2.0.6.jar
tiles-jsp-2.0.6.jar
util-bridges.jar
util-java.jar
util-taglib.jar
vssver2.scc
webservices-api.jar
webservices-extra.jar
webservices-extra-api.jar
webservices-rt.jar
webservices-tools.jar
wsdl4j.jar
xwork-core-2.1.6.jar
xwork-core-2.3.7.jar
Glassfish log
[#|2019-10-22T19:16:12.273+0530|SEVERE|glassfish 5.0|javax.enterprise.web.core|_ThreadID=87 _ThreadName=pool-8-thread-1;_TimeMillis=1571751972273;_LevelValue=1000;_MessageID=AS-WEB-CORE 00108;|
ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Unable to add listener of type: com.ipaccess.nos.service.web.NosContextLoaderListener, because it does not implement any of the required ServletContextListener, ServletContextAttributeListener, ServletRequestListener, ServletRequestAttributeListener, HttpSessionListener, or HttpSessionAttributeListener interfaces
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5537)
at com.sun.enterprise.web.WebModule.start(WebModule.java:540)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:877)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:860)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:644)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2044)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1690)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:107)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:500)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.osgijavaeebase.OSGiDeploymentRequest.deploy(OSGiDeploymentRequest.java:185)
at org.glassfish.osgijavaeebase.OSGiDeploymentRequest.execute(OSGiDeploymentRequest.java:120)
at org.glassfish.osgijavaeebase.AbstractOSGiDeployer.deploy(AbstractOSGiDeployer.java:123)
at org.glassfish.osgijavaeebase.OSGiContainer.deploy(OSGiContainer.java:154)
at org.glassfish.osgijavaeebase.JavaEEExtender.deploy(JavaEEExtender.java:109)
at org.glassfish.osgijavaeebase.JavaEEExtender.access$200(JavaEEExtender.java:61)
at org.glassfish.osgijavaeebase.JavaEEExtender$HybridBundleTrackerCustomizer$1.call(JavaEEExtender.java:153)
at org.glassfish.osgijavaeebase.JavaEEExtender$HybridBundleTrackerCustomizer$1.call(JavaEEExtender.java:150)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Unable to add listener of type: com.ipaccess.nos.service.web.NosContextLoaderListener, because it does not implement any of the required ServletContextListener, ServletContextAttributeListener, ServletRequestListener, ServletRequestAttributeListener, HttpSessionListener, or HttpSessionAttributeListener interfaces
at org.apache.catalina.core.StandardContext.addListener(StandardContext.java:2867)
at org.apache.catalina.core.StandardContext.addApplicationListener(StandardContext.java:2073)
at com.sun.enterprise.web.TomcatDeploymentConfig.configureApplicationListener(TomcatDeploymentConfig.java:236)
at com.sun.enterprise.web.TomcatDeploymentConfig.configureWebModule(TomcatDeploymentConfig.java:95)
at com.sun.enterprise.web.WebModuleContextConfig.start(WebModuleContextConfig.java:239)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:295)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:122)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5534)
... 24 more
Caused by: java.lang.IllegalArgumentException: Unable to add listener of type: com.ipaccess.nos.service.web.NosContextLoaderListener, because it does not implement any of the required ServletContextListener, ServletContextAttributeListener, ServletRequestListener, ServletRequestAttributeListener, HttpSessionListener, or HttpSessionAttributeListener interfaces
at org.apache.catalina.core.StandardContext.createListener(StandardContext.java:2982)
at org.apache.catalina.core.StandardContext.loadListener(StandardContext.java:5057)
at com.sun.enterprise.web.WebModule.loadListener(WebModule.java:1637)
at org.apache.catalina.core.StandardContext.addListener(StandardContext.java:2865)
... 31 more
MANIFEST.MF
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: NOS TR69 AP Service
Bundle-SymbolicName: com.ipaccess.nos.service.tr69ap
Bundle-Version: 3.0.0
Bundle-Vendor: ip.access
Export-Package: com.ipaccess.nos.service.tr69ap.southbound.api
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: com.ipaccess.nos.business.cm.api,
javax.servlet,
javax.servlet.http,
org.osgi.framework;version="1.5.0",
org.slf4j,
org.springframework.osgi.web.context.support;version="1.2.1",
org.springframework.remoting.rmi,
org.springframework.util;version="3.0.5.RELEASE",
org.springframework.web.bind.annotation;version="3.0.5.RELEASE",
org.springframework.web.context;version="3.0.5.RELEASE",
org.springframework.web.context.support;version="3.0.5.RELEASE",
org.springframework.web.servlet;version="3.0.5.RELEASE",
org.aspectj.lang,
org.aspectj.lang.annotation,
org.aspectj.lang.reflect,
org.aspectj.runtime.internal,
org.aspectj.runtime.reflect,
org.aopalliance.aop,
org.aopalliance.intercept,
com.ipaccess.nos.service.web
Bundle-ClassPath: lib/com.ipaccess.nos.Tr69Stack.jar,
WEB-INF/classes,.
Require-Bundle: org.springframework.beans;bundle-version="3.0.5",
org.springframework.core;bundle-version="3.0.5",
org.springframework.context,
org.springframework.osgi.web;bundle-version="1.2.1";bundle-version:=optional,
org.springframework.osgi.core;bundle-version="1.2.1",
org.springframework.osgi.extender;bundle-version="1.2.1",
org.springframework.osgi.io;bundle-version="1.2.1",
com.ipaccess.nos.business,
com.springsource.org.aopalliance;bundle-version="1.0.0",
org.springframework.aop;bundle-version="3.0.5",
org.springframework.osgi.extender,
com.springsource.javax.servlet;bundle-version="2.5.0"
Web-ContextPath: /
Spring-Context: *;timeout:=600
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app metadata-complete="false" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<listener>
<listener-class>com.ipaccess.nos.service.web.NosContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</context-param>
<servlet>
<servlet-name>nos-tr069</servlet-name>
<servlet-class>com.ipaccess.nos.service.tr69ap.southbound.AcsController</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>nos-tr069</servlet-name>
<url-pattern>/acs</url-pattern>
</servlet-mapping>
<filter>
<filter-name>lockStatusFilter</filter-name>
<filter-class>com.ipaccess.nos.service.web.HttpAdminLockStateFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>lockStatusFilter</filter-name>
<servlet-name>nos-tr069</servlet-name>
</filter-mapping>
</web-app>
NosContextLoaderListener (it present in other jar). issue explanation.
Details are given below
We are using OSGi Felix in Glassfish 5.0.1. We are facing this issue while upgrading our
project from Java 6 to Java 8 (Oracle JDK version 1.8.0_221), from Glassfish 3.1.1 to Glassfish
5.0.1 and OSGi Equinox to OSGi Felix.