Pagination in Struts 1.2.9 in Java EE - java

I tried pagination in Struts in Objectweb Lomboz eclipse version 3.3. But I got a "no class found" error.
The errors are
exception
javax.servlet.ServletException: org/apache/commons/lang/UnhandledException
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:272)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NoClassDefFoundError: org/apache/commons/lang/UnhandledException
java.lang.Class.getDeclaredConstructors0(Native Method)
java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
java.lang.Class.getConstructor0(Unknown Source)
java.lang.Class.newInstance0(Unknown Source)
java.lang.Class.newInstance(Unknown Source)
java.beans.Introspector.instantiate(Unknown Source)
java.beans.Introspector.findExplicitBeanInfo(Unknown Source)
java.beans.Introspector.<init>(Unknown Source)
java.beans.Introspector.getBeanInfo(Unknown Source)
org.apache.jasper.compiler.Generator$TagHandlerInfo.<init>(Generator.java:3728)
org.apache.jasper.compiler.Generator$GenerateVisitor.getTagHandlerInfo(Generator.java:2130)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1599)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Generator.generate(Generator.java:3320)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
I don't know what is wrong with the code. I copied it from viralpatel.net. I've got a feeling that this code is only applicable for struts 2. So, if you have any pagination program for struts 1.2.9, please provide this in an answer.

Please, check the root cause of the error. It clearly states:
java.lang.NoClassDefFoundError: org/apache/commons/lang/UnhandledException
Which means that the class UnhandledException (from org.apache.commons.lang package) is not found (anywhere in your classpath).
Download the latest Apache Commons library from Apache Commons and put the jar inside your project's WEB-INF/lib directory or declare the path in the classpath.

Related

Getting "A corrupt or unuseable certificate was received" exception from jsp

I'm calling one web service from unix batch file and successfully made request and got the response too.
But when I call the same web service from the jsp page, then I'm getting BAD_CERTIFICATE error.
FATAL Alert:BAD_CERTIFICATE - A corrupt or unuseable certificate was received.
javax.net.ssl.SSLKeyException: FATAL Alert:BAD_CERTIFICATE - A corrupt or unuseable certificate was received.
at com.certicom.tls.interfaceimpl.TLSConnectionImpl.fireException(Unknown Source)
at com.certicom.tls.interfaceimpl.TLSConnectionImpl.fireAlertSent(Unknown Source)
at com.certicom.tls.record.handshake.HandshakeHandler.fireAlert(Unknown Source)
at com.certicom.tls.record.handshake.HandshakeHandler.handleHandshakeMessages(Unknown Source)
at com.certicom.tls.record.MessageInterpreter.interpretContent(Unknown Source)
at com.certicom.tls.record.MessageInterpreter.decryptMessage(Unknown Source)
at com.certicom.tls.record.ReadHandler.processRecord(Unknown Source)
at com.certicom.tls.record.ReadHandler.readRecord(Unknown Source)
at com.certicom.tls.record.ReadHandler.readUntilHandshakeComplete(Unknown Source)
at com.certicom.tls.interfaceimpl.TLSConnectionImpl.completeHandshake(Unknown Source)
at com.certicom.tls.record.WriteHandler.write(Unknown Source)
at com.certicom.io.OutputSSLIOStreamWrapper.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at java.io.FilterOutputStream.flush(FilterOutputStream.java:123)
at weblogic.net.http.HttpURLConnection.writeRequests(HttpURLConnection.java:150)
at weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.java:364)
at weblogic.net.http.SOAPHttpsURLConnection.getInputStream(SOAPHttpsURLConnection.java:37)
at jsp_servlet._test._util.__testservice._jspService(__testservice.java:590)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:124)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:394)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:309)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3392)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2140)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2046)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1366)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
Need help on this.
Thanks.
The usual solution for this is to enable JSSE but you are on very old WLS version. Anyways, as per Oracle KM:
Set the following JAVA_OPTIONS depending on your case and restart servers.
Post WLS 10.3.3
-Dweblogic.ssl.JSSEEnabled=true
-Dweblogic.wsee.client.ssl.usejdk=true
-Dweblogic.wsee.skip.async.response=true
-Dweblogic.wsee.client.ssl.stricthostchecking=false
-Dweblogic.webservice.client.ssl.adapterclass=weblogic.webservice.client.JSSEAdapter
Pre WLS 10.3.2
-Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol
-Dssl.SocketFactory.provider=com.sun.net.ssl.internal.SSLSocketFactoryImpl
-DUseSunHttpHandler=true
-Dweblogic.wsee.client.ssl.usejdk=true
-Dweblogic.wsee.skip.async.response=true
-Dweblogic.wsee.client.ssl.stricthostchecking=false
-Dweblogic.webservice.client.ssl.adapterclass=weblogic.webservice.client.JSSEAdapter
Reference:FATAL Alert:BAD_CERTIFICATE - When handshaking with an external WebService with certificates unsupported by Certicom (Doc ID 1671346.1)

Embedded Tomcat failed to scan

I work on Eclipse with an embedded Tomcat (8.0.24). I ran mvn clean package install and got a build success.
However, when I start tomcat by running a main method in Eclipse (as it's an embedded Tomcat), I got lots of error like :
mai 11, 2018 3:26:20 PM org.apache.tomcat.util.scan.StandardJarScanner processURLs
WARNING: Failed to scan [file:/C:/Users/username/.m2/repository/com/sun/xml/ws/jaxws-rt/2.1.7/saaj-impl.jar] from classloader hierarchy
java.io.FileNotFoundException: C:\Users\username\.m2\repository\com\sun\xml\ws\jaxws-rt\2.1.7\saaj-impl.jar (The system cannot find the file specified)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at org.apache.tomcat.util.compat.JreCompat.jarFileNewInstance(JreCompat.java:188)
at org.apache.tomcat.util.scan.JarFileUrlJar.<init>(JarFileUrlJar.java:65)
at org.apache.tomcat.util.scan.JarFactory.newInstance(JarFactory.java:49)
at org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:374)
at org.apache.tomcat.util.scan.StandardJarScanner.processURLs(StandardJarScanner.java:309)
at org.apache.tomcat.util.scan.StandardJarScanner.doScanClassPath(StandardJarScanner.java:266)
at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:229)
at org.apache.catalina.startup.ContextConfig.processJarsForWebFragments(ContextConfig.java:1888)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1116)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:765)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5138)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1421)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1411)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I listed some of the concerned .jar :
com\sun\xml\bind\jaxb-xjc\2.1.7\jsr173_1.0_api.jar
com\sun\xml\bind\jaxb-xjc\2.1.7\activation.jar
com\sun\xml\bind\jaxb-xjc\2.1.7\jaxb-impl.jar
com\sun\xml\bind\jaxb-xjc\2.1.7\jaxb-api.jar
com\sun\xml\bind\jaxb-xjc\2.1.7\activation.jar
com\sun\xml\bind\jaxb-impl\2.1.7\jaxb1-impl.jar
com\sun\xml\bind\jaxb-impl\2.1.7\jsr173_1.0_api.jar
com\sun\xml\bind\jaxb-impl\2.1.7\activation.jar
com\sun\xml\bind\jaxb-impl\2.1.7\jaxb-api.jar
com\sun\xml\messaging\saaj\saaj-impl\1.3.3\activation.jar
com\sun\xml\messaging\saaj\saaj-impl\1.3.3\saaj-api.jar
com\sun\xml\ws\jaxws-rt\2.1.7\stax-utils.jar
com\sun\xml\ws\jaxws-rt\2.1.7\streambuffer.jar
com\sun\xml\ws\jaxws-rt\2.1.7\stax-ex.jar
com\sun\xml\ws\jaxws-rt\2.1.7\activation.jar
com\sun\xml\ws\jaxws-rt\2.1.7\jaxb-impl.jar
com\sun\xml\ws\jaxws-rt\2.1.7\jaxb-api.jar
com\sun\xml\ws\jaxws-rt\2.1.7\resolver.jar
com\sun\xml\ws\jaxws-rt\2.1.7\woodstox.jar
com\sun\xml\ws\jaxws-rt\2.1.7\sjsxp.jar
com\sun\xml\ws\jaxws-rt\2.1.7\jsr173_api.jar
com\sun\xml\ws\jaxws-rt\2.1.7\saaj-impl.jar
com\sun\xml\ws\jaxws-rt\2.1.7\saaj-api.jar
com\sun\xml\ws\jaxws-rt\2.1.7\jsr250-api.jar
com\sun\xml\ws\jaxws-rt\2.1.7\jsr181-api.jar
com\sun\xml\ws\jaxws-rt\2.1.7\jaxws-api.jar
javax\xml\soap\saaj-api\1.3\servlet.jar
javax\xml\soap\saaj-api\1.3\jax-qname.jar
javax\xml\soap\saaj-api\1.3\activation.jar
javax\xml\soap\saaj-api\1.3\jaxp-api.jar
I already deleted the content of repository in .m2 and eclipse->project->maven->update project->update project (and force update of snapshot/release).
I checked in the indicated locations and indeed those .jar don't exist. I am a maven's beginner so maybe my error is stupid...

javafx running application outside Netbeans IDE

I'm having trouble running a javaFX application through the .jar in the "dist folder" later that I have clean and build project by NetBeans.
C:\NetBeansProjects\Gestore\dist>java -jar
Gestore.jar
log4j:ERROR Could not read configuration file [conf\log4j.properties].
java.io.FileNotFoundException: conf\log4j.properties (Impossibile trovare il per
corso specificato)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurato
r.java:372)
at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.
java:403)
at gestore.Gestore.<init>(Gestore.java:97)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherIm
pl.java:276)
at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:
47)
at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)
at java.lang.Thread.run(Unknown Source)
log4j:ERROR Ignoring configuration file [conf\log4j.properties].
log4j:WARN No appenders could be found for logger (gestore.Utility).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more in
fo.
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.javafx.main.Main.launchApp(Main.java:642)
at com.javafx.main.Main.main(Main.java:805)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherIm
pl.java:403)
at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:
47)
at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.SecurityException: class "javafx.scene.control.Dialogs"'s s
igner information does not match signer information of other classes in the same
package
at java.lang.ClassLoader.checkCerts(Unknown Source)
at java.lang.ClassLoader.preDefineClass(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at gestore.Gestore.loadEserciziFromDB(Gestore.java:407)
at gestore.Gestore.start(Gestore.java:178)
at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:215)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179
)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176
)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29
)
at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:73)
... 1 more
But if I run project from netBeans everything works perfectly. And if I try (later to run in NetBeans) to launch application from dist folder everything work perfectly. In fact
C:\NetBeansProjects\Gestore\dist>java -jar
Gestore.jar
log4j:ERROR Could not read configuration file [conf\log4j.properties].
java.io.FileNotFoundException: conf\log4j.properties (Impossibile trovare il per
corso specificato)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurato
r.java:372)
at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.
java:403)
at gestore.Gestore.<init>(Gestore.java:97)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherIm
pl.java:276)
at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:
47)
at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)
at java.lang.Thread.run(Unknown Source)
log4j:ERROR Ignoring configuration file [conf\log4j.properties].
log4j:WARN No appenders could be found for logger (gestore.Utility).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more in
fo.
So I think that problem is caused by Java.Lang.SecurityException (yes I know there is a problem with log4j properties), and maybe here https://github.com/marcojakob/javafx-ui-sandbox/issues/5 there is a solution, but why??
What the problem is
The javafx-ui-sandbox project you link to is obsolete and incompatible with later JavaFX versions under some circumstances.
How to fix it
I advise using ControlsFX instead. ControlsFX has all of the functions of the javafx-ui-sandbox (and more) and is built so that it does not clash with JavaFX system classes. It is also a much more actively maintained and developed project.
If you cannot use the minimum Java 8 version required for the latest version of ControlsFX, there used to be a ControlsFX 2.x backport, but it no longer has any relevant content.
Long and unnecessary explanation follows
javafx-ui-sandbox was a prototyping system that includes classes which clash with classes included in some Java distributions - which is why you get:
Caused by: java.lang.SecurityException: class "javafx.scene.control.Dialogs"'s
signer information does not match signer information of other classes
in the same package.
What is happening here is that you are including a javafx-ui-sandbox class (javafx.scene.control.Dialogs) in your a jar and signing it (probably you are using NetBeans and have the checkbox to self-sign jars switched on, but there are other ways you could be signing). So you are signing your jars with a different certificate than Oracle used to sign the JavaFX jars. The JavaFX jars include the bulk of the code in the javafx.scene.control package. As part of some obscure rule of Java, you can't sign code in the same package with two different certificates or it will generate a security exception.
Likely you don't see the issue when you are executing within NetBeans because you aren't signing your application to execute it within the development environment, but when you build the jar file you are executing, you are also signing the jar file, at which point the jar won't work.
The easy fix for you is just to copy the javafx-ui-sandbox source into your project and change the package name from javafx.scene.control to something else (e.g. com.yourcompany.control). That way the class packages won't clash with the default packages provided for the JavaFX system and you can sign your code (including the com.yourcompany.control.Dialogs class) without causing any issues. But again, you are probably better off using the ControlsFX library instead.

JAX-WS on Tomcat server

I am trying to deploy a JAX-WS on a Tomcat server. I have looked around the web and followed instructions I found here and here but to no avail. I get the following error and have no idea how to correct the issue.
SEVERE: WSSERVLET11: failed to parse runtime descriptor: java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:103)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4343)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:903)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216)
at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256)
at org.apache.commons.digester.Rule.end(Rule.java:276)
at org.apache.commons.digester.Digester.endElement(Digester.java:1058)
at org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:76)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1567)
at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:488)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:863)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:483)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
at org.apache.catalina.core.StandardService.start(StandardService.java:480)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
- Error listenerStart
- Context startup failed due to previous errors
Jun 30, 2011 10:04:25 AM com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextDestroyed
INFO: WSSERVLET13: JAX-WS context listener destroyed
here is my sun-jaxws.xml file
<?xml version="1.0" encoding="UTF-8"?> <endpoints xmlns="http://java.sun.com/xml.ns/jax-ws/ri/runtime" version="2.0">
<endpoint name="ActionMutatorProxy" implementation="com.hyr.boa.transport.ActionMutatorProxy" url-pattern="/action_mutator_proxy" />
A NoClassDefFoundError thrown at deploy time means that a class definition that was present on the build path (e.g. the Java code compiles) cannot be found at runtime. The compile-time class path is not the same as the deploy-time class path with Tomcat (and other containers).
You need to put jaxp-api.jar into WEB-INF/lib or $CATALINA_HOME/lib.

EJB exception while try to run the client

javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interf
aces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: o
rg.jnp.interfaces.NamingContextFactory]
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at Client_TestPortal.main(Client_TestPortal.java:54)
Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFac
tory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
... 5 more
That exception says that initializing of the InitialContext has failed for your Client_TestPortal application. The resaon is that it has been unable to load the class org.jnp.interfaces.NamingContextFactory which (I presume) the default Java Naming provider for your platform.
It appears that your apps classpath is missing a required JAR file. According to this findjar query it could be one of the following:
[LOCAL] jbossall-client.jar
[LOCAL] jbossjmx-ant.jar
[MAVEN2] jnpserver-3.2.3.jar
[MAVEN2] jbossall-client-3.2.1.jar
[MAVEN2] jbossall-client-3.2.3.jar
[MAVEN2] jbossjmx-ant-3.2.3.jar
[MAVEN2] jnp-client-3.2.1.jar
[MAVEN2] jnp-client-4.0.2.jar
... or something like that. Which (if any) of the above JARs is most appropriate is hard to say.
You have not provided enough information like the environment you are using, The app server etc.
Any way it lloks like JNDI related JAR is not on the classpath. If it is in place and still not working, then you may have missed to put the correct context information, so pass the JNDI information to the constuctor of InitialContext.
I had the same problem but I found how to fix it. All you have to do is add the jbossall-client.jar library to the clients project, and done!!! You can find the file inside the client folder.
e.g jboss-6.1.0.Final_GPT\client
I was using Jboss 6.1.0
You can also get help from this link
https://community.oracle.com/thread/1157701?start=0
Hope it helps.

Categories