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
Related
Following struts jars are used in project:
activation.jar, asm-5.2.jar, asm-commons-5.2.jar ,asm-tree-5.2.jar, commons-beanutils-1.9.2.jar , commons-collections-3.2.2.jar, commons-fileupload-1.3.3.jar , commons-io-2.5.jar , commons-lang-2.5.jar, commons-lang3-3.6.jar, commons-logging-1.1.3.jar, commons-logging-api-1.1.jar , freemarker-2.3.23.jar, javassist-3.20.0-GA.jar , javax.servlet.jar ,log4j-api-2.8.2.jar mail.jar , ognl-3.1.15.jar, struts2-convention-plugin-2.5.13.jar , struts2-core-2.5.13.jar, struts2-rest-plugin-2.5.13.jar , xstream-1.4.10.jar, xwork-core-2.3.34.jar
also tomcat 8.5 and java 8 installed on system.
I am getting the following error after startup, anyone got any ideas please!!!
04-Dec-2017 11:17:29.066 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.filterStart Exception starting filter [struts2]
Unable to load configuration. - bean - jar:file:/apache-tomcat-8.5.23/webapps/WebTool/WEB-INF/lib/struts2-core-2.5.13.jar!/struts-default.xml:137:154
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:512)
at org.apache.struts2.dispatcher.InitOperations.initDispatcher(InitOperations.java:75)
at org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:63)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:285)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:266)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4591)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5233)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1144)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1878)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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: Unable to load bean: type:com.opensymphony.xwork2.TextProviderFactory class:com.opensymphony.xwork2.StrutsTextProviderFactory - bean - jar:file:/apache-tomcat-8.5.23/webapps/WebTool/WEB-INF/lib/struts2-core-2.5.13.jar!/struts-default.xml:137:154
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:247)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:98)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:240)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
... 21 more
Caused by: java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2283)
at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:811)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1260)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
at com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:144)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:218)
... 24 more
Any help will be appreciated.
Here is my web.xml structure :
I have updated the filter dispatcher to the newest statement
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
<?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>WebTool</display-name>
<welcome-file-list>
<welcome-file>Home.html</welcome-file>
</welcome-file-list>
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/WEBTOOLDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
<init-param>
<param-name>actionPackages</param-name>
<param-value>com.webtool.ktt.servlet</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
Encountered the same problem. It turned out to be due to having both struts2-core (v2.5.14.1) and xwork-core (2.3.34) as dependencies.
struts2-core.jar since v2.5 contains TextProviderFactory as an interface, but xwork-core had the older version of the same class as a true class.
Dropping the xwork-core dependency solved the problem for me.
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 have application and I want to use jstl tag lib.
I have two jars JSTL.jar and standard.jar. I put both in my WEB-INF/lib folder.
I configure it in web.xml like
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<taglib>
<taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
<taglib-location>/WEB-INF/fmt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
<taglib-location>/WEB-INF/sql.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/x</taglib-uri>
<taglib-location>/WEB-INF/x.tld</taglib-location>
</taglib>
<servlet>
<servlet-name>loadingServlet</servlet-name>
<servlet-class>loadingServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>loadingServlet</servlet-name>
<url-pattern>/loadingServlet</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>homepage.jsp</welcome-file>
</welcome-file-list>
</web-app>
and on page i am using following code
<%#taglib prefix="k" uri="http://java.sun.com/jsp/jstl/core" %>
and still i am getting error. like
INFO: Deploying web application directory ServletExample
13 Apr, 2012 4:00:31 PM org.apache.tomcat.util.digester.Digester startElement
SEVERE: Begin event threw exception
java.lang.IllegalArgumentException: taglib definition not consistent with specification version
at org.apache.catalina.startup.TaglibLocationRule.begin(WebRuleSet.java:1167)
at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1282)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1359)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1543)
at org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1714)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1208)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:316)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5103)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1055)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:978)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1322)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:379)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:324)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1041)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.startup.Catalina.start(Catalina.java:620)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:303)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:431)
13 Apr, 2012 4:00:31 PM org.apache.catalina.startup.ContextConfig parseWebXml
SEVERE: Parse error in application web.xml file at jndi:/localhost/ServletExample/WEB-INF/web.xml
java.lang.IllegalArgumentException: taglib definition not consistent with specification version
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2687)
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2713)
at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1285)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1359)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1543)
at org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1714)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1208)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:316)
You made several mistakes:
You should not manually redefine JAR's own taglibs in web.xml. This is a myth.
You should be using a Servlet 3.0 compatible web.xml for Tomcat 7.
You should be using JSTL 1.2, not 1.0.
Remove them all. Remove all <taglib> from web.xml. Remove the both JARs from /WEB-INF/lib. Then follow the following steps:
Download jstl-1.2.jar and drop it in /WEB-INF/lib.
Fix your web.xml to be Servlet 3.0 compatible.
<?xml version="1.0" encoding="UTF-8"?>
<web-app
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"
version="3.0">
<!-- Config here. No taglibs! -->
</web-app>
Use the documented taglib declaration:
<%# taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
See also:
Our JSTL wiki page
I have a vague suspicion that you're using Roseindia.net as a Java EE resource. Your invalid approach is also mentioned in there. You should not do that. You should put that site in your Internet blacklist. This site is so full of bad answers and bad practices. Use Oracle's official resources instead, or Stackoverflow.com of course.
If you are one of the lucky few that have to support old code and removing taglib in your web.xml is not an option. You can enclose it in <jsp-config> like so:
<jsp-config>
<taglib>
<taglib-uri>/taglibs/custom-taglib</taglib-uri>
<taglib-location>/WEB-INF/custom-taglib.tld</taglib-location>
</taglib>
</jsp-config>
You don't need to configure taglibs in web.xml anymore. Plus you're defining different taglib urls (iirc the web.xml ones are correct).
Use the uris from your web.xml in the jsp and remove the web.xml taglib defs.
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.