ActiveWeb war undeployable to TomEE - java

I just started a new ActiveWeb/ActiveJDBC project based on the activeweb-simple example. When I build and run it with Jetty as described in the ReadMe everything works fine but I can't get it to work with TomEE plus (7.0.2/1.7.5) and I would like to ask for help.
I tried several things out so I will split this in three parts.
1) Not running on Jetty, JSR-356 support unavailable
When building and deploying the war an error occurs no matter if I copy the war-file to the webapps-folder or if I use the tomee-maven-plugin:
FATAL: Error during ServletContainerInitializer processing
javax.servlet.ServletException: Not running on Jetty, JSR-356 support unavailable
at org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer.onStartup(WebSocketServerContainerInitializer.java:183)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5622)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1009)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:985)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1127)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:2020)
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)
The tomee-maven-plugin is defined as follows:
<plugin>
<groupId>org.apache.openejb.maven</groupId>
<artifactId>tomee-maven-plugin</artifactId>
<version>1.7.5</version>
<configuration>
<tomeeClassifier>plus</tomeeClassifier>
<systemVariables>
<activejdbc.log />
<active_reload>true</active_reload>
<activeweb.log.request>true</activeweb.log.request>
</systemVariables>
</configuration>
</plugin>
Searching for the error itself haven't lead me to a solution.
2) "Fixed" above error, still no server
I commented out all of the Jetty-related code and dependencies and redeployed afterwards. This time no error occurs but unfortunately there was no server available under localhost either.
3) Fatal error unexpected element
After this I added the 'tomcat-websocket' dependency as replacement for the 'javax-websocket-server-impl' dependency
<!-- <dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>javax-websocket-server-impl</artifactId>
<version>9.4.1.v20170120</version>
</dependency>-->
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-websocket</artifactId>
<version>9.0.10</version>
</dependency>
which lead to the error below:
INFORMATION: Configuring enterprise application:
C:\Users\...\activeweb-simple-master\target\apache-tomee\webapps\activeweb-simple-1.1-SNAPSHOT
[severity=FATAL_ERROR, message=unexpected element (URI:"http://xmlns.jcp.org/xml/ns/javaee", lokal:"web-fragment"). Expected elements are <{http://java.sun.com/xml/ns/javaee}handler-chains>,<{http://java.sun.com/xml/ns/javaee}web-fragment>, locator=[node=null, object=null, url=null, line=23,col=28,offset=-1]]
Jun 27, 2018 7:57:26 AM org.apache.openejb.config.ReadDescriptors mergeWebFragments
WARNING: can't read org.apache.openejb.config.ReadDescriptors$UrlSource#3d1db871
javax.xml.bind.UnmarshalException: unexpected element (URI:"http://xmlns.jcp.org/xml/ns/javaee", lokal:"web-fragment"). Expected elements are <{http://java.sun.com/xml/ns/javaee}handler-chains>,<{http://java.sun.com/xml/ns/javaee}web-fragment>
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:662)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:258)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:253)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:120)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRootLoader.childElement(UnmarshallingContext.java:1063)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:498)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:480)
at com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:150)
at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:551)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:613)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3132)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:852)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:258)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:229)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:214)
at org.apache.openejb.jee.JaxbJavaee.unmarshal(JaxbJavaee.java:174)
at org.apache.openejb.config.ReadDescriptors.mergeWebFragments(ReadDescriptors.java:578)
at org.apache.openejb.config.ReadDescriptors.readWebApp(ReadDescriptors.java:551)
at org.apache.openejb.config.ReadDescriptors.deploy(ReadDescriptors.java:129)
at org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:403)
at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:971)
at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1227)
at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1100)
at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:130)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5519)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1009)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:985)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1127)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:2020)
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)
All above errors happen for version 2.0 and 2.1-SNAPSHOT of ActiveWeb/ActiveJDBC.
So, is there a solution to get ActiveWeb to work with TomEE plus?

Related

Tomcat server at localhost failed to start

I am trying to write a simple login page web application in a maven project in eclipse IDE. I have included Maven dependency for mysql-connector as follows :
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.15</version>
<scope>compile</scope>
</dependency>
</dependencies>
But whenever I am trying to run the server I am getting the error that Tomcat server failed to start. However when I change the scope of the dependency from compile to provided as follow
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.15</version>
<scope>provided</scope>
</dependency>
</dependencies>
the tomcat server runs just fine but when I am trying to call fetch values from database I get the following error
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1365)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1188)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:333)
at com.myfirstApp.checkDB.checklogin(checkDB.java:17)
at com.myfirstApp.MyServlet.doGet(MyServlet.java:40)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
...
I am unable to understand the proper flow of how maven uses the dependency, why i am getting the class not found error and why the server is unable to start when the scope is compile.
I read a previous answer and tried running the code with dependency scope as "provided" and including the jar file in the tomcat server lib folder but still got the same class not found error.
Edit 1: I am getting the following error when the scope is set to compile
Tomcat error
and when the scope is set to provided I am getting an error at the first line of the following code
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection(url,user,pass);
PreparedStatement st = con.prepareStatement(query);
Edit 2
The error I am getting while starting the server with scope as compile
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet#7a1a3478]
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:633)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:343)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:474)
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet#7a1a3478]
...
The full error report can be found here

java.lang.NoSuchMethodError: ognl.SimpleNode.isSequence(Lognl/OgnlContext;)Z

I am trying to upgrade my struts version from 2.3.3 to 2.3.33.post running the apache tomcat 7 I am getting the below error.
SEVERE: Exception starting filter struts2
java.lang.NoSuchMethodError: ognl.SimpleNode.isSequence(Lognl/OgnlContext;)Z
at com.opensymphony.xwork2.ognl.OgnlUtil.isEvalExpression(OgnlUtil.java:320)
at com.opensymphony.xwork2.ognl.OgnlUtil.checkEnableEvalExpression(OgnlUtil.java:431)
at com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecute(OgnlUtil.java:386)
at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:298)
at com.opensymphony.xwork2.ognl.OgnlUtil.internalSetProperty(OgnlUtil.java:627)
at com.opensymphony.xwork2.ognl.OgnlUtil.setProperties(OgnlUtil.java:190)
at com.opensymphony.xwork2.ognl.OgnlUtil.setProperties(OgnlUtil.java:217)
at com.opensymphony.xwork2.ognl.OgnlUtil.setProperties(OgnlUtil.java:204)
at com.opensymphony.xwork2.ognl.OgnlReflectionProvider.setProperties(OgnlReflectionProvider.java:58)
at com.opensymphony.xwork2.factory.DefaultInterceptorFactory.buildInterceptor(DefaultInterceptorFactory.java:43)
at com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:209)
at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:70)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:1114)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStack(XmlConfigurationProvider.java:932)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStacks(XmlConfigurationProvider.java:945)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptors(XmlConfigurationProvider.java:968)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:537)
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)
at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:978)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490)
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:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5633)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1260)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2002)
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:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
I am using ognl-3.0.4 jar
For googlers, the problem in my case (when I got a similar exception) was a mismatch between thymeleaf and ognl versions.
The versions I used later that worked fine together:
<dependency>
<groupId>ognl</groupId>
<artifactId>ognl</artifactId>
<version>3.0.12</version>
</dependency>
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring5</artifactId>
<version>3.0.12.RELEASE</version>
</dependency>
The problem has been resolved now,it is the jar issue after upgrading the struts version step by step 2.3.3 to 2.3.15 then 2.3.28 and then 2.3.33, i have not faced this problem.

ClassNotFoundException: com.allen_sauer.gwt.log.client.WrappedClientThrowable

I'm getting class not found exception for com.allen_sauer.gwt.log.client.WrappedClientThrowable while starting my application in tomcat 8.0.36.
Libraries used
- gwt-user-2.8
- gwt-servlet-2.7.0
- spring4gwt-0.0.1
- gwt-log-3.1.2
This class is present in gwt-log but in package com.allen_sauer.gwt.log.shared. My application code is referring to the correct package but still I'm getting this exception:
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:940)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1816)
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:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: com/allen_sauer/gwt/log/client/WrappedClientThrowable
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at org.apache.catalina.util.Introspection.getDeclaredMethods(Introspection.java:127)
at org.apache.catalina.startup.WebAnnotationSet.loadMethodsAnnotation(WebAnnotationSet.java:273)
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:133)
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:65)
at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:335)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:782)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:306)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5202)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 10 more
Caused by: java.lang.ClassNotFoundException: com.allen_sauer.gwt.log.client.WrappedClientThrowable
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)
... 24 more
Not sure which library is referring to the old package. Any help is appreciated. Thanks in advance.
Seems like you have a gwt-user and gwt-servlet in different versions.
It would be great if you could post your full "mvn dependency:tree" (or gradle equivalent)
EDIT:
Feels like you are using a somewhat outdated logging library.
https://github.com/fredsa/gwt-log/wiki/GettingStarted
Try adding this guy to your dependencies: compile 'com.allen-sauer.gwt.log:gwt-log:3.3.2
Seems this issue was introduced due to some duplicate compiled classes. I got the application from a different team who have recently converted it to gradle build. When I checked the project structure and gradle scripts, I found many inconsistencies. Basically project was not converted correctly.
After I converted it correctly, this error was gone.
Thanks for the insights, really appreciate it

Exception while visiting module-info.class java.lang.IllegalArgumentException, Payara Server

When I try to start my payara server unknown illegalArgumentException on module-info.class error occurs,
2017-07-17T20:06:58.042+0530|Info: Created HTTP listener http-listener-1 on host/port 0.0.0.0:8080
2017-07-17T20:06:58.057+0530|Info: Created HTTP listener http-listener-2 on host/port 0.0.0.0:8181
2017-07-17T20:06:58.057+0530|Info: Created HTTP listener admin-listener on host/port 0.0.0.0:4848
2017-07-17T20:06:58.073+0530|Info: Created virtual server server
2017-07-17T20:06:58.073+0530|Info: Created virtual server __asadmin
2017-07-17T20:06:58.709+0530|Info: Setting JAAS app name glassfish-web
2017-07-17T20:06:58.709+0530|Info: Virtual server server loaded default web module
2017-07-17T20:06:59.010+0530|Info: Java security manager is disabled.
2017-07-17T20:06:59.011+0530|Info: Entering Security Startup Service.
2017-07-17T20:06:59.013+0530|Info: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.
2017-07-17T20:06:59.094+0530|Info: Security Service(s) started successfully.
2017-07-17T20:07:00.849+0530|Info: Initializing Mojarra 2.2.14 ( 20161114-2152 unable to get svn info) for context ''
2017-07-17T20:07:02.397+0530|Severe: Exception while visiting module-info.class of size 281
java.lang.IllegalArgumentException
at org.glassfish.hk2.external.org.objectweb.asm.ClassReader.<init>(ClassReader.java:170)
at org.glassfish.hk2.external.org.objectweb.asm.ClassReader.<init>(ClassReader.java:153)
at org.glassfish.hk2.external.org.objectweb.asm.ClassReader.<init>(ClassReader.java:424)
at org.glassfish.hk2.classmodel.reflect.Parser$5.on(Parser.java:359)
at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.handleEntry(ReadableArchiveScannerAdapter.java:165)
at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.onSelectedEntries(ReadableArchiveScannerAdapter.java:127)
at org.glassfish.hk2.classmodel.reflect.Parser.doJob(Parser.java:345)
at org.glassfish.hk2.classmodel.reflect.Parser.access$300(Parser.java:68)
at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:304)
at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:293)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2017-07-17T20:07:02.461+0530|Severe: Exception while visiting module-info.class of size 330
java.lang.IllegalArgumentException
at org.glassfish.hk2.external.org.objectweb.asm.ClassReader.<init>(ClassReader.java:170)
at org.glassfish.hk2.external.org.objectweb.asm.ClassReader.<init>(ClassReader.java:153)
at org.glassfish.hk2.external.org.objectweb.asm.ClassReader.<init>(ClassReader.java:424)
at org.glassfish.hk2.classmodel.reflect.Parser$5.on(Parser.java:359)
at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.handleEntry(ReadableArchiveScannerAdapter.java:165)
at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.onSelectedEntries(ReadableArchiveScannerAdapter.java:127)
at org.glassfish.hk2.classmodel.reflect.Parser.doJob(Parser.java:345)
at org.glassfish.hk2.classmodel.reflect.Parser.access$300(Parser.java:68)
at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:304)
at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:293)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2017-07-17T20:07:02.461+0530|Severe: Exception while visiting module-info.class of size 449
java.lang.IllegalArgumentException
at org.glassfish.hk2.external.org.objectweb.asm.ClassReader.<init>(ClassReader.java:170)
at org.glassfish.hk2.external.org.objectweb.asm.ClassReader.<init>(ClassReader.java:153)
at org.glassfish.hk2.external.org.objectweb.asm.ClassReader.<init>(ClassReader.java:424)
at org.glassfish.hk2.classmodel.reflect.Parser$5.on(Parser.java:359)
at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.handleEntry(ReadableArchiveScannerAdapter.java:165)
at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.onSelectedEntries(ReadableArchiveScannerAdapter.java:127)
at org.glassfish.hk2.classmodel.reflect.Parser.doJob(Parser.java:345)
at org.glassfish.hk2.classmodel.reflect.Parser.access$300(Parser.java:68)
at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:304)
at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:293)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2017-07-17T20:07:02.477+0530|Severe: Exception while visiting module-info.class of size 267
java.lang.IllegalArgumentException
at org.glassfish.hk2.external.org.objectweb.asm.ClassReader.<init>(ClassReader.java:170)
at org.glassfish.hk2.external.org.objectweb.asm.ClassReader.<init>(ClassReader.java:153)
at org.glassfish.hk2.external.org.objectweb.asm.ClassReader.<init>(ClassReader.java:424)
at org.glassfish.hk2.classmodel.reflect.Parser$5.on(Parser.java:359)
at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.handleEntry(ReadableArchiveScannerAdapter.java:165)
at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.onSelectedEntries(ReadableArchiveScannerAdapter.java:127)
at org.glassfish.hk2.classmodel.reflect.Parser.doJob(Parser.java:345)
at org.glassfish.hk2.classmodel.reflect.Parser.access$300(Parser.java:68)
at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:304)
at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:293)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2017-07-17T20:07:02.539+0530|Info: Loading application [__admingui] at [/]
2017-07-17T20:07:02.555+0530|Info: Loading application __admingui done in 5,492 ms
2017-07-17T20:07:02.850+0530|Info: WELD-000900: 2.4.1 (Final)
2017-07-17T20:07:03.459+0530|Info: WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(#Observes ProcessAnnotatedType) receives events for all annotated types. Consider restricting events using #WithAnnotations or a generic type with bounds.
2017-07-17T20:07:03.475+0530|Info: WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(#Observes ProcessAnnotatedType) receives events for all annotated types. Consider restricting events using #WithAnnotations or a generic type with bounds.
2017-07-17T20:07:04.820+0530|Info: Cannot find the resource bundle for the name com.sun.logging.enterprise.system.core.naming for class org.glassfish.concurrent.runtime.deployer.ConcurrentObjectFactory using org.glassfish.main.concurrent.impl [41]
2017-07-17T20:07:05.185+0530|Info: Loading application [test-service] at [/test-service]
2017-07-17T20:07:05.524+0530|Info: test-service was successfully deployed in 3,672 milliseconds.
Environment used,
1. Kepler Service Release 2
2. JDK 1.8 with Java compiler level set to 1.7 in Eclipse
3. pom.xml
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.2</version>
<scope>test</scope>
</dependency>
4. Payara Server 4.1.1.171
Unable to load application, what would be the possible cause for this? How to resolve?
Using Java 7 (u80) or Java 8 (u121, u151), this error could not be eliminated with Payara versions:
4.1.2.172
4.1.1.171.0.1
5.0 beta 1
Instead, Java 8 (u151) with GlassFish 5 eliminated the class incompatibility error.
Downgrading Payara server from payara-4.1.2.172 to payara-4.1.1.171.0.1 is the fix, the possible cause would be compiler mismatch between servers, Wherein payara-4.1.1.171.0.1 works great with Java 7. More explanation from the community would be helpful for more clarity on the possible cause of error.

Facing issue in AMQP Connector while deployng war file in tomcat

I am getting error in AMQP Connector while deploying war file in mule tomcat.
In Anypoint studio its working fine, but while deployng in tomcat i am getting following error
org.mule.api.lifecycle.LifecycleException: Failed to invoke lifecycle phase "start" on object: AmqpConnector
{
name=AMQP_0_9_Connector
lifecycle=initialise
this=3eb847dc
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=false
supportedProtocols=[amqp]
serviceOverrides=<none>
}
at org.mule.lifecycle.phases.DefaultLifecyclePhase.applyLifecycle(DefaultLifecyclePhase.java:248)
at org.mule.lifecycle.RegistryLifecycleCallback.doApplyLifecycle(RegistryLifecycleCallback.java:91)
at org.mule.lifecycle.RegistryLifecycleCallback.onTransition(RegistryLifecycleCallback.java:67)
at org.mule.lifecycle.RegistryLifecycleManager.invokePhase(RegistryLifecycleManager.java:140)
at org.mule.lifecycle.RegistryLifecycleManager.fireLifecycle(RegistryLifecycleManager.java:111)
at org.mule.registry.AbstractRegistryBroker.fireLifecycle(AbstractRegistryBroker.java:88)
at org.mule.registry.MuleRegistryHelper.fireLifecycle(MuleRegistryHelper.java:141)
at org.mule.lifecycle.MuleContextLifecycleManager$MuleContextLifecycleCallback.onTransition(MuleContextLifecycleManager.java:91)
at org.mule.lifecycle.MuleContextLifecycleManager$MuleContextLifecycleCallback.onTransition(MuleContextLifecycleManager.java:87)
at org.mule.lifecycle.MuleContextLifecycleManager.invokePhase(MuleContextLifecycleManager.java:69)
at org.mule.lifecycle.MuleContextLifecycleManager.fireLifecycle(MuleContextLifecycleManager.java:61)
at org.mule.DefaultMuleContext.start(DefaultMuleContext.java:294)
at org.mule.config.builders.MuleXmlBuilderContextListener.initialize(MuleXmlBuilderContextListener.java:96)
at org.mule.config.builders.MuleXmlBuilderContextListener.contextInitialized(MuleXmlBuilderContextListener.java:70)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5099)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5615)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1092)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1984)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
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.LinkageError: loader constraint violation: loader (instance of org/apache/catalina/loader/WebappClassLoader) previously initiated loading for a different type with name "org/apache/commons/logging/Log"
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.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:3175)
at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:1372)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1860)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1734)
I am using mule 3.8.0 , my flow is as follow
<amqp:connector name="AMQP_0_9_Connector" validateConnections="true" host="XXX.XX" username="XX" password="XX" doc:name="AMQP-0-9 Connector"/>
<flow name="rabbitmq_mavenFlow">
<servlet:inbound-endpoint path="/message" responseTimeout="10000" doc:name="Servlet"/>
<set-payload value="test message " doc:name="Set Payload"/>
<amqp:outbound-endpoint queueName="orders" queueDurable="true" responseTimeout="10000" exchange-pattern="request-response" connector-ref="AMQP_0_9_Connector" doc:name="AMQP-0-9"/>
Please help me to solve it
Thanks
#user3855589, you probably have two different versions of commons-logging: one in your war and one in tomcat. You should put the one in your war in provided scope (if you are using maven) or just exclude it from your war, and than deploy it in Tomcat. Check out a similar error.

Categories

Resources