Upgrading jboss server 4.0 with jdk6 to wildfly15 with jdk8 - java

previously my project was on jdk 6 with jboss 4.i upgraded from jdk6 to jdk8 . When i was using jdk 8 with jboss4 it was working properly but after upgrading jboss 4 with wildfly 15 i am getting below error.
in web.xml i configured crystalReportViewer as given below .wildfly 15 is giving error but when i removed the crystalReportConfiguration line then its working properly..
enter code here
<context-param>
<param-name>crystal_image_uri</param-name>
<param-value>crystalreportviewers</param-value>
</context-param>
<context-param>
<param-name>crystal_image_use_relative</param-name>
<param-value>webapp</param-value>
</context-param>
<servlet>
<servlet-name>CrystalReportViewerServlet</servlet-name>
<servlet-class>com.crystaldecisions.report.web.viewer.CrystalReportViewerServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>CrystalReportViewerServlet</servlet-name>
<url-pattern>/CrystalReportViewerHandler</url-pattern>
</servlet-mapping>
Caused by:
org.jboss.as.server.deployment.DeploymentUnitProcessingException:
java.lang.ClassNotFoundException:
com.crystaldecisions.report.web.viewer.CrystalReportViewerServlet from
[Module "deployment.ubarms.war" from Service Module Loader] at
org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.checkDeclaredApplicationClassAsServlet(JaxrsScanningProcessor.java:437)
at
org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.scanWebDeployment(JaxrsScanningProcessor.java:278)
at
org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.deploy(JaxrsScanningProcessor.java:109)
at
org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:144)
... 8 more

Related

Liquibase changelog does not exist - ChangeLogParseException

I am trying to use liquibase on startup in my JEE+WildFly app.
When launching AS, liquibase throws ChangeLogParseException:
09:41:40,602 ERROR [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0021: Deploy of deployment "bets.war" was rolled back with the following failure message:
{
"WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host./bets" => "java.lang.RuntimeException: java.lang.RuntimeException: liquibase.exception.ChangeLogParseException: :classpath/WEB-INF/db-changelog.xml does not exist
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: liquibase.exception.ChangeLogParseException: :classpath/WEB-INF/db-changelog.xml does not exist
Caused by: java.lang.RuntimeException: liquibase.exception.ChangeLogParseException: :classpath/WEB-INF/db-changelog.xml does not exist
Caused by: liquibase.exception.ChangeLogParseException: :classpath/WEB-INF/db-changelog.xml does not exist"},
Liquibase params are set in web.xml:
<!-- liquibase auto startup -->
<context-param>
<param-name>liquibase.changelog</param-name>
<param-value>:classpath/WEB-INF/db-changelog.xml</param-value>
</context-param>
<context-param>
<param-name>liquibase.datasource</param-name>
<param-value>java:jboss/datasources/BetsDS</param-value>
</context-param>
<context-param>
<param-name>liquibase.onerror.fail</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>liquibase.contexts</param-name>
<param-value>production</param-value>
</context-param>
<listener>
<listener-class>liquibase.integration.servlet.LiquibaseServletListener</listener-class>
</listener>
Structure is as below:
Looked through subjects here in SO, db-changelog is in .war package:
Tried already renaming liquibase.changelog value to WEB-INF/db-changelog.xml and /WEB-INF/db-changelog.xml, still the same.
Already figured it out.
Moved db-changelog to main/resources/META-INF and set param to
<param-value>META-INF/db-changelog.xml</param-value>
Everything works now:
[2018-05-27 11:27:42,823] Artifact bets:war: Artifact is deployed successfully
[2018-05-27 11:27:42,823] Artifact bets:war: Deploy took 13 582 milliseconds

Websphere 7 cannot find ActionServlet

I am using Webshpere 7 and my Java version is 1.6. My Struts version is 1.1. When I start my server I get the following error:
com.ibm.ws.webcontainer.servlet.ServletWrapper run [Servlet Error]-[class java.lang.ClassNotFoundException: org.apache.struts.action.ActionServlet]: java.lang.ClassNotFoundException: class java.lang.ClassNotFoundException: org.apache.struts.action.ActionServlet
at java.beans.Beans.instantiate(Unknown Source)
at java.beans.Beans.instantiate(Unknown Source)
at com.ibm.ws.webcontainer.servlet.ServletWrapper$1.run(ServletWrapper.java:1682)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet(ServletWrapper.java:1673)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1581)
at com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:98)
at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:936)
at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:857)
at com.ibm.ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:538)
at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:360)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:292)
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:99)
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:167)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:722)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:607)
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:376)
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:668)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1162)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1313)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:611)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:938)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:740)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2092)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:437)
at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:122)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:380)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$300(CompositionUnitMgrImpl.java:105)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:928)
at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:349)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)
I have included the struts jar and it is in my build path. My servlet is defined in web.xml as:
<servlet id="Servlet_1165231311172">
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet
</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>mapping</param-name>
<param-value>mj.cchp.actionMapping.CCHPActionMapping</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
I uninstalled the application from my server, deleted the files from the profile and tried to redeploy the application but I got the following error:
java.lang.UnsupportedOperationException
at com.genuitec.eclipse.j2eedt.core.internal.project.WTPEarProject.getWorkareaDirectoryPath(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.packaging.DefaultPackagerStrategy.getBuildFolder(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.packaging.DefaultPackagerStrategy.initBuildArea(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.DeploymentUtil.copyDeploymentAssemblyLibraries(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.EARDeployment.ą(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.EARDeployment.doProjectTypeSpecificPostResyncAll(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.Deployment.resyncAll(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.EARDeployment.resyncAll(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.Deployment.resyncAll(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.EARDeployment.deployAsExplodedArchive(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.Deployment.deploy(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.jobs.C.ā(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.jobs.C.run(Unknown Source)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
There was the a problem with the EAR being created. I deleted the application, restarted the server and redeployed the application which solved it.
You need to add jar with Struts to your application. Build path is good in your development environment, but to run it must be somehow in the classpath during runtime. The easiest is as Steve C suggested - to add struts.jar to your WEB-INF/lib.
This kind of java.lang.ClassNotFoundException can manifest sometimes when a dependent class is not available.
Make sure that you application has access to the dependent jars as well, such as:
commons-beanutils
commons-digester
commons-logging
etc

CXF : java.lang.ClassNotFoundException: org.apache.cxf.transport.servlet.CXFServlet

I am trying to deploy a rest web service in WAS 8.0
The application EAR is getting installed successfully.
However, both on publishing as well as on hitting the service from web browser after publishing, I am getting below error:
[3/13/14 13:42:20:652 IST] 00000024 servlet E com.ibm.ws.webcontainer.servlet.ServletWrapper run SRVE8052E: Logging ClassNotFoundException
java.lang.ClassNotFoundException: class java.lang.ClassNotFoundException: org.apache.cxf.transport.servlet.CXFServlet
at java.beans.Beans.instantiate(Beans.java:190)
at java.beans.Beans.instantiate(Beans.java:75)
at com.ibm.ws.webcontainer.servlet.ServletWrapper$1.run(ServletWrapper.java:1471)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet(ServletWrapper.java:1460)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.load(ServletWrapper.java:1358)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:982)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3751)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:962)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1690)
However, the jar containing the class viz. cxf-rt-transports-http-2.7.4.jar is present inside lib directory of the WAR inside the EAR installed.
What is the cause of the issue ?
How can I resolve it ?
Update: My web.xml is as below:
<web-app>
<display-name>MyService</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<display-name>CXF Servlet</display-name>
<servlet-class>
org.apache.cxf.transport.servlet.CXFServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
</web-app>
I see that you mentioned the word "publish", which hints that you might be using Eclipse, or possibly IBM's RAD or even MyEclipse Blue.
In case that's true, read on...
While your .ear, generated by m2e/Maven, may have the .jar file present in the .war file, there's a chance that the .ear and .war file, generated by m2e-wtp, is missing the .jar file. m2e-wtp's generated .ear file is what's used when you publish/republish your application to WAS from within Eclipse/RAD/MyEclipse Blue.
Try removing the app from your local WAS, finding the location of that m2e-wtp-generated .ear file, and deleting it. From there, m2e-wtp should automatically generate a fresh .ear file if you clean your project (all associated pom, ear, war, etc.)
When you publish your app, it should find the class. I've had the same problem happen to me in the past. My suggestion has fixed the problem.
Other than that, you may need to set the Classloader Policy to PARENT_LAST and check that you're using a single classloader for the entire app (the 2nd set of radio buttons below the Classloader Policy radio buttons) within the WAS admin console. However, I doubt that the Classloader Policy is the issue.

Jersey error with tomcat WAR

I cannot get My tomcat server to work with my WAR file.
I am using jersey 1.14 and It is running fine through tomcat 6 in eclipse. But when I upload the war to my remote tomcat 6 server I receive the following error when i try access the site.
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet.init() for servlet Jersey REST Service threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Thread.java:679)
root cause
java.lang.UnsupportedClassVersionError: com/shafer/server/server : Unsupported major.minor version 51.0 (unable to load class com.shafer.server.server)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2822)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:264)
com.sun.jersey.core.reflection.ReflectionHelper.classForNameWithException(ReflectionHelper.java:238)
com.sun.jersey.spi.scanning.AnnotationScannerListener$AnnotatedClassVisitor.getClassForName(AnnotationScannerListener.java:222)
com.sun.jersey.spi.scanning.AnnotationScannerListener$AnnotatedClassVisitor.visitEnd(AnnotationScannerListener.java:186)
org.objectweb.asm.ClassReader.accept(Unknown Source)
org.objectweb.asm.ClassReader.accept(Unknown Source)
com.sun.jersey.spi.scanning.AnnotationScannerListener.onProcess(AnnotationScannerListener.java:136)
com.sun.jersey.core.spi.scanning.uri.FileSchemeScanner$1.f(FileSchemeScanner.java:86)
com.sun.jersey.core.util.Closing.f(Closing.java:71)
com.sun.jersey.core.spi.scanning.uri.FileSchemeScanner.scanDirectory(FileSchemeScanner.java:83)
com.sun.jersey.core.spi.scanning.uri.FileSchemeScanner.scan(FileSchemeScanner.java:71)
com.sun.jersey.core.spi.scanning.PackageNamesScanner.scan(PackageNamesScanner.java:225)
com.sun.jersey.core.spi.scanning.PackageNamesScanner.scan(PackageNamesScanner.java:141)
com.sun.jersey.api.core.ScanningResourceConfig.init(ScanningResourceConfig.java:80)
com.sun.jersey.api.core.PackagesResourceConfig.init(PackagesResourceConfig.java:104)
com.sun.jersey.api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:78)
com.sun.jersey.api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:89)
com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:700)
com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:678)
com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:203)
com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:374)
com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:557)
javax.servlet.GenericServlet.init(GenericServlet.java:212)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Thread.java:679)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.35 logs.`
here is my 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>shafer</display-name>
<servlet>
<servlet-name>Jersey REST Service</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>com.shafer.server</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Jersey REST Service</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
Your .war was compiled under a newer JDK than the JRE that is available on the remote tomcat. Either install a matching JRE on the remote server or recompile your project with the correct version of the JDK.
This line should give you a clou:
java.lang.UnsupportedClassVersionError: com/shafer/server/server :
Unsupported major.minor version 51.0
(unable to load class com.shafer.server.server)
What is com.shafer.server.server? Check the versions of your libraries.
The UnsupportedClassVersionError means that the class was compiled with a more recent Java compiler than the one you are using in your runtime.
I don't know the version numbers by hearth, but you should probably use a JRE 6 or higher to run Tomcat.

Servlet "newspring" is not available

Trying to set up a new spring project and im having this issue where I get this error (HTTP Status 404 - Servlet newspring is not available) when I navigate to a page that I expect to get routed through to a controller.
web.xml
<servlet>
<servlet-name>springapp</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springapp</servlet-name>
<url-pattern>/app/*</url-pattern>
</servlet-mapping>
So I looked in the tomcat logs and I see this exception:
SEVERE: Error loading
WebappClassLoader delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader: org.apache.catalina.loader.StandardClassLoader#a1807c
org.springframework.web.servlet.DispatcherServlet
java.lang.ClassNotFoundException:
org.springframework.web.servlet.DispatcherServlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1095)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)
but the supposedly missing class is actually present in the spring-webmvc.jar which is present in the WEB-INF/libs(at tomcatfolder/webapp/newSpring/WEB-INF/libs).
Is it unable to look here ?
Assuming I read correctly, the folder should be /WEB-INF/lib, not /WEB-INF/libs - note the lack of s at the end!

Categories

Resources