Runs successfully in Tomcat7 but giving error in tomcat9 in centOS - java

I have a project in java. Which was currently running in Tomcat-7, JAVA-8 and postgres-9.3. I updated it to openjdk-11 and postgres-13 and tried to deploy it in tomcat9, but it is giving this error.
javax.servlet.ServletException: java.lang.NoSuchMethodError: 'java.lang.Object
org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(java.lang.String, java.lan$
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:666)
at org.apache.jsp.layout1_jsp._jspService(Unknown Source)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:71)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
I have tried solutions like playing with versions of jar in my WEB-INF/lib folder, but didn't work.
Also tried this and this solutions.

You should clean the $CATALINA_BASE/work directory of your Tomcat installation. You clearly have *.java and *.class files there which were compiled with the Tomcat 7 version of Jasper.
Before deleting the files, stop Tomcat.
This should solve your NoSuchMethodError, but the exception that triggered this message is still in your JSP. As remarked by Scary Wombat, you should consider using only EL expressions and JSTL tags in your JSP pages.

Related

Websphere Error SRVE0206E SRVE0187E SRVE0234I SRVE0266E

I'm currently wasting my time trying to figure out why WAS won't load my EAR and why said EAR have problem.
Context:
One of my colleague updated a version of a jar and then my m2e seem to have not picked up and was giving thousand of error (was working fine before)
I tried to check if it was Nexus (work fine). My encrypted password in the setting.xml (work fine).
I decided to try maven from the command line, everything worked fine there to.
When I tried again in RAD (IBM eclipse) everything was now ok, no more error.
I then proceeded to put the generated EAR in my websphere server via add and remove project and I get multiple error when I try to start the server with that ear. (see below)
I though that because it was compiled via maven cmd prompt, I might have compiled with the wrong jvm or something so I deleted my maven repo (.m2 in the user) and try to get the jar via m2e in RAD only.
It's worked until I started the server with the new EAR and got the same set of error.
Any idea on what to do to get rid of these error and have a healthy server.
Here some of the error:
[11/10/17 12:08:51:994 EST] 00000075 annotation W
com.ibm.ws.webcontainer.annotation.WASAnnotationHelper collectClasses
SRVE8000W: Skipped class that failed to initialize for annotation
scanning.
java.lang.ClassNotFoundException: org.springframework.web.servlet.tags.form.SelectTag at
java.lang.Class.forNameImpl(Native Method) at
java.lang.Class.forName(Class.java:219) ...
[11/10/17 12:09:00:282 EST] 00000075 wtp W
org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.TempZipFile
clearTempFile Failed to delete temporary file [
C:\IBM\WebSphere\AppServer-x86\profiles\chris_pro\wstemp\appdepl15fa68a2a21\AuthRenfClientWeb-2.0.26.war2406380505527260260.tmp
] [11/10/17 12:09:00:433 EST] 00000075 SinglePathCla E WSVR0120E: An
error occurred processing com.mycom.bla.testalive.TestAliveServlet
java.io.FileNotFoundException:
C:\IBM\WebSphere\AppServer-x86\profiles\chris_pro\wstemp\appdepl15fa68a2a21\Client-1.61.5-SNAPSHOT.jar6655053587500024283.tmp
(The system cannot find the file specified.) ...
SRVE0266E: Error occured while initializing servlets: {0}
javax.servlet.UnavailableException: SRVE0203E: Servlet [SecurityManager]:
com.mycom.bla.pres.request.http.HttpSecurityManagerServlet was found,
but is missing another required class. SRVE0206E: This error typically
implies that the servlet was originally compiled with classes which
cannot be located by the server. SRVE0187E: Check your class path to
ensure that all classes required by the servlet are present.SRVE0210I:
This problem can be debugged by recompiling the servlet using only the
classes in the application's runtime class path SRVE0234I: Application
class

JDBC via JT400 works on local Apache Tomcat 8 install but fails on Apache Tomcat 8 running on server

I have a Java application running and tested on my development workstation running Apache Tomcat 8. I have an established IBM i (AS/400) database connection working locally using the JT400.jar file. When I build and deploy the application to our production server running Apache Tomcat 8 with the same JT400.jar file, the database connection seems to fail and I cannot figure out why.
I get the following "HTTP Status 500 - Servlet execution threw an exception" error:
<code>
java.lang.AbstractMethodError
org.apache.tomcat.dbcp.dbcp2.DelegatingConnection.isValid(DelegatingConnection.java:913)
org.apache.tomcat.dbcp.dbcp2.PoolableConnection.validate(PoolableConnection.java:218)
org.apache.tomcat.dbcp.dbcp2.PoolableConnectionFactory.validateConnection(PoolableConnectionFactory.java:302)
org.apache.tomcat.dbcp.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2164)
org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2147)
org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:1902)
org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1412)
utilities.SerialSearch.doSearch(SerialSearch.java:81)
processes.ProcessScan.getSerialScreenDetail(ProcessScan.java:66)
processes.ProcessScan.ProcessScanRequest(ProcessScan.java:103)
controller.MetricServlet.performTask(MetricServlet.java:145)
controller.MetricServlet.doPost(MetricServlet.java:43)
javax.servlet.http.HttpServlet.service(HttpServlet.java:644)
javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
</code>
What is different and how do I resolve the issue?
Thanks!
I had the same error while using the current latest version (as of today 9.3).
The problem was that I was using the JDK 8, and using maven to fetch the package I received a version that was not appropriate for this JDK.
To solve this problem I used the proper maven qualifier:
<dependency>
<groupId>net.sf.jt400</groupId>
<artifactId>jt400</artifactId>
<version>9.3</version>
<classifier>jt400_jdk8</classifier>
</dependency>
Note that if you download the zip with the full suite, all version of the jar do have the same name (i.e. jt400.jar) which makes them hard to distinguish.
Problem solved. Rookie mistake. I inadvertently left the old jt400 jar files in the lib folder on the Apache Tomcat 8 server by renaming them. Once I deleted the old jar files my issues were solved with the new jt400 jar that I installed last week that started the conflict to begin with. Thanks!

ADBException in using WebEnv & QueryKey example for EFetch

I used the example code "Using WebEnv & QueryKey example" from http://www.ncbi.nlm.nih.gov/books/NBK55696/ - the ESearch part seems to work fine, but not EFetch. I added the command "e.printStackTrace()" to get the full error message:
WebEnv: NCID_1_160921978_130.14.18.34_9001_1392822285_1227953195
QueryKey: 1
org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement {http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_pubmed}Affiliation
org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement {http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_pubmed}Affiliation
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at gov.nih.nlm.ncbi.www.soap.eutils.EFetchPubmedServiceStub.fromOM(EFetchPubmedServiceStub.java)
at gov.nih.nlm.ncbi.www.soap.eutils.EFetchPubmedServiceStub.run_eFetch(EFetchPubmedServiceStub.java:190)
at preparation.Client.main(Client.java:39)
Caused by: java.lang.Exception: org.apache.axis2.databinding.ADBException: Unexpected subelement {http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_pubmed}Affiliation
at gov.nih.nlm.ncbi.www.soap.eutils.EFetchPubmedServiceStub$AuthorType$Factory.parse(EFetchPubmedServiceStub.java:47561)
at gov.nih.nlm.ncbi.www.soap.eutils.EFetchPubmedServiceStub$AuthorListType$Factory.parse(EFetchPubmedServiceStub.java:12284)
at gov.nih.nlm.ncbi.www.soap.eutils.EFetchPubmedServiceStub$ArticleType$Factory.parse(EFetchPubmedServiceStub.java)
at gov.nih.nlm.ncbi.www.soap.eutils.EFetchPubmedServiceStub$MedlineCitationType$Factory.parse(EFetchPubmedServiceStub.java:27035)
at gov.nih.nlm.ncbi.www.soap.eutils.EFetchPubmedServiceStub$PubmedArticleType$Factory.parse(EFetchPubmedServiceStub.java:17841)
at gov.nih.nlm.ncbi.www.soap.eutils.EFetchPubmedServiceStub$PubmedArticleSetChoiceE$Factory.parse(EFetchPubmedServiceStub.java)
at gov.nih.nlm.ncbi.www.soap.eutils.EFetchPubmedServiceStub$PubmedArticleSet_type0$Factory.parse(EFetchPubmedServiceStub.java:54143)
at gov.nih.nlm.ncbi.www.soap.eutils.EFetchPubmedServiceStub$EFetchResult$Factory.parse(EFetchPubmedServiceStub.java:48494)
... 3 more
Caused by: org.apache.axis2.databinding.ADBException: Unexpected subelement {http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_pubmed}Affiliation
at gov.nih.nlm.ncbi.www.soap.eutils.EFetchPubmedServiceStub$AuthorType$Factory.parse(EFetchPubmedServiceStub.java:47555)
... 10 more
I am using Eclipse (Version: 3.7.2) with Ubuntu 12.04 LTS and java-7-openjdk-amd64 as JRE. The NCBI page mentions to use this command before runnning Client.java:
wsdl2java -uri http://eutils.ncbi.nlm.nih.gov/soap/v2.0/efetch_pubmed.wsdl
Instead of that, I simply included the jar files (only binaries) that have been shown as output in console, because this worked fine for all other exapmles on http://www.ncbi.nlm.nih.gov/books/NBK55696/ except the ELink example:
org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement {http://www.ncbi.nlm.nih.gov/soap/eutils/elink}error
I will describe which jar files I included in my project.
As the FTP link for downloading eutils_axis2.jar on the above mentioned page did not work, I searched for the current path and added it to my Eclipse project.
Their README says that JDK version 7.0.45 and Axis2 version 1.6.2 should be used and that it was released in December 2013.
I searched for "download wsdl2java.sh" in Google to get the Axis2 version in connection to WSDL and found the package axis2-eclipse-service-plugin-1.6.2.zip . I downloaded the package and added all jar files to my project:
apache-mime4j-core-0.7.2.jar
axiom-api-1.2.13.jar
axiom-impl-1.2.13.jar
axis2-adb-1.6.2.jar
axis2-codegen-1.6.2.jar
axis2-kernel-1.6.2.jar
commons-codec-1.3.jar
commons-fileupload-1.2.jar
commons-httpclient-3.1.jar
geronimo-jta_1.1_spec-1.1.jar
geronimo-ws-metadata_2.0_spec-1.1.2.jar
jaxen-1.1.1.jar
jsr311-api-1.0.jar
neethi-3.0.2.jar
servlet-api-2.3.jar
woden-api-1.0M9.jar
woden-impl-commons-1.0M9.jar
woden-impl-dom-1.0M9.jar
wsdl4j-1.6.2.jar
XmlSchema-1.4.7.jar
Then I searched the packages for the remaining error messages:
axis2-transport-http-1.6.2.jar
axis2-transport-local-1.6.2.jar
commons-logging-1.1.3.jar
geronimo-javamail_1.4_spec-1.7.1.jar
httpcore-4.3.2.jar
I searched for similar cases with Google, but I did not find a solution. How can I fix this message mentioned at the beginning?
The corresponding wsdl file mentioned in the NCBI tutorial is from 2010. Maybe it is outdated, but first, be sure that creating the specified java classes works fine. Do the following steps result in an error?
Download and extract axis2-1.6.2.
Set the environment variables
export AXIS2_HOME=<path/to/axis2-1.6.2>
export JAVA_HOME=<path/to/java-7-openjdk-amd64>
Download the following files
http://eutils.ncbi.nlm.nih.gov/soap/v2.0/efetch_pubmed.xsd
http://eutils.ncbi.nlm.nih.gov/soap/v2.0/efetch_db_pubmed.xsd
http://eutils.ncbi.nlm.nih.gov/soap/v2.0/efetch_pubmed.wsdl
and execute bin/wsdl2java.sh within the axis2-1.6.2 directory using the efetch_pubmed.wsdl file.
sh wsdl2java.sh -uri <path/to/efetch_pubmed.wsdl>
Two java classes should appear in
src/gov/nih/nlm/ncbi/www/soap/eutils
(still in your axis/bin directory). Import and use these files with your Client.java (pointing to the filename in the tutorial).
Works fine for me. Hope that helps.

Using Java Within PHP - Class Not Found

I'm using Tomcat and PHP5 with JavaBridge. I have bridged PHP and Java so I can screencap web pages within PHP. This was working on another server but after moving to a new server I can not get it working, so I'm reaching for straws here.
require_once("http://localhost:8080/JavaBridge/java/Java.inc");
java_autoload("/web/sites/madfrog/domain.com/cron/bin/html2image.jar");
$JavaHTML2Image = new Java("com.elance.proposal.html2image.client.MainBridge");
It should have loaded all of the project html2image.jar when the script _autoloaded it, however when you create the new Java object I get the error
Class Not Found: Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: CreateInstance failed: new com.elance.proposal.html2image.client.MainBridge. Cause: java.lang.ClassNotFoundException: com.elance.proposal.html2image.client.MainBridge
I asked the guys over in Java and they said I needed to put the jar file in the lib so Java could find it, so I dumped it into Tomcat's webapps folder an into /usr/share/java. But that did nothing. With that said the PHP has a direct reference to it, so it should be loaded.
I'm at a lost after two days. any help is appreciated!
Which version of Tomcat do you use?
For Tomcat 6 or Tomcat 7 put the jar either in ${tomcat.home}/lib or in ${tomcat.home}/webapps/${your.war}/lib
While tomcat.home is your tomcat installation directory. And your.war is the name of your war file.

Deploying WAR with CXF in Glassfish V3

I'm trying to deploy a WAR in GF V3 that has CXF as a dependency and I get the following exception:
[#|2011-02-08T07:34:15.736-0800|WARNING|oracle-glassfish3.0.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=32;_ThreadName=http-thread-pool-8080-(2);|StandardWrapperValve[MyServlet]: PWC1406: Servlet.service() for servlet MyServlet threw exception
com.sun.xml.ws.util.ServiceConfigurationError: com.sun.xml.ws.api.pipe.TransportPipeFactory: Provider com.sun.enterprise.jbi.serviceengine.bridge.transport.JBITransportPipeFactory is specified in bundle://254.0:0/META-INF/services/com.sun.xml.ws.api.pipe.TransportPipeFactory but not found
at com.sun.xml.ws.util.ServiceFinder.fail(ServiceFinder.java:241)
at com.sun.xml.ws.util.ServiceFinder.access$100(ServiceFinder.java:141)
at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(ServiceFinder.java:376)
at com.sun.xml.ws.api.pipe.TransportTubeFactory.create(TransportTubeFactory.java:129)
at com.sun.xml.ws.transport.DeferredTransportPipe.<init>(DeferredTransportPipe.java:82)
at com.sun.xml.ws.api.pipe.ClientTubeAssemblerContext.createTransportTube(ClientTubeAssemblerContext.java:311)
at com.sun.xml.ws.assembler.jaxws.TransportTubeFactory.createTube(TransportTubeFactory.java:62)
at com.sun.xml.ws.assembler.TubeCreator.createTube(TubeCreator.java:77)
at com.sun.xml.ws.assembler.TubelineAssemblerFactoryImpl$MetroTubelineAssembler.createClient(TubelineAssemblerFactoryImpl.java:121)
at com.sun.xml.ws.client.Stub.createPipeline(Stub.java:224)
at com.sun.xml.ws.client.Stub.<init>(Stub.java:201)
at com.sun.xml.ws.client.Stub.<init>(Stub.java:174)
at com.sun.xml.ws.client.sei.SEIStub.<init>(SEIStub.java:81)
at com.sun.xml.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:602)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:344)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:326)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:308)
at javax.xml.ws.Service.getPort(Service.java:99)
at com.mycompany.myapp.webserviceclient.SomeWebserviceService.getSomeWebservicePort(SomeWebserviceService.java:58)
This sorta indicates to me that there is a bundle in my WAR\lib directory that is causing problems, but when I expand the WAR and do a search on META-INF\services I do not find anything that is close what is outlined in the exception.
I originally had CXF and it's transitive dependencies in the war\lib dir, but I've since removed that and still encounter the same error.
Nothing useful comes up when searching google and I'm at a loss here.
Does anyone know what might be going on here?
EDIT #1
Another symptom of this is that the tester pages for deployed web services will not work properly.
I had a similar problem with my glassfish3.1. Below is a stack trace
Caused by: com.sun.xml.ws.util.ServiceConfigurationError: com.sun.xml.ws.api.pipe.TransportPipeFactory: Provider com.sun.enterprise.jbi.serviceengine.bridge.transport.JBITransportPipeFactory is specified in bundle://96.0:0/META-INF/services/com.sun.xml.ws.api.pipe.TransportPipeFactory but not found
at com.sun.xml.ws.util.ServiceFinder.fail(ServiceFinder.java:245)
at com.sun.xml.ws.util.ServiceFinder.access$100(ServiceFinder.java:145)
at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(ServiceFinder.java:380)
at com.sun.xml.ws.api.pipe.TransportTubeFactory.create(TransportTubeFactory.java:133)
at com.sun.xml.ws.transport.DeferredTransportPipe.<init>(DeferredTransportPipe.java:86)
at com.sun.xml.ws.api.pipe.ClientTubeAssemblerContext.createTransportTube(ClientTubeAssemblerContext.java:315)
at com.sun.xml.ws.assembler.jaxws.TransportTubeFactory.createTube(TransportTubeFactory.java:67)
at com.sun.xml.ws.assembler.TubeCreator.createTube(TubeCreator.java:84)
at com.sun.xml.ws.assembler.TubelineAssemblerFactoryImpl$MetroTubelineAssembler.createClient(TubelineAssemblerFactoryImpl.java:130)
at com.sun.xml.ws.client.Stub.createPipeline(Stub.java:228)
at com.sun.xml.ws.client.Stub.<init>(Stub.java:205)
at com.sun.xml.ws.client.Stub.<init>(Stub.java:178)
at com.sun.xml.ws.client.sei.SEIStub.<init>(SEIStub.java:85)
at com.sun.xml.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:608)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:348)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:330)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:312)
at javax.xml.ws.Service.getPort(Service.java:134)
at org.glassfish.webservices.monitoring.WebServiceTesterServlet.initializePort(WebServiceTesterServlet.java:563)
at org.glassfish.webservices.monitoring.WebServiceTesterServlet.doGet(WebServiceTesterServlet.java:169)
at org.glassfish.webservices.monitoring.WebServiceTesterServlet.invoke(WebServiceTesterServlet.java:104)
at org.glassfish.webservices.EjbWebServiceServlet.service(EjbWebServiceServlet.java:114)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at com.sun.grizzly.http.servlet.ServletAdapter$FilterChainImpl.doFilter(ServletAdapter.java:1002)
... 20 more
The problem was traced to the conflicting mappings for "com.sun.xml.ws.api.pipe.TransportPipeFactory" inside two different modules.
prompt> grep -rl com.sun.xml.ws.api.pipe.TransportPipeFactory /usr/local/glassfish-3.1/glassfish/domains/modules*
modules/webservices-osgi.jar
modules/sun-javaee-engine.jar
prompt> grep -rl com.sun.enterprise.jbi.serviceengine.bridge.transport.JBITransportPipeFactory /usr/local/glassfish-3.1/glassfish/domains/modules/*
modules/sun-javaee-engine.jar
Clearly, the required file was sitting in the wrong jar "sun-javaee-engine.jar".
Above, "sun-javaee-engine.jar" is loaded by the "Java EE Service Engine Module". Once I removed the module (using glassfish update tool) everything started working fine.
EDIT #1:
Here is how to remove the module using the update tool on the Unix command line:
sudo ./pkg uninstall sun-javaee-engine

Categories