Getting error in web service program in my pc but the same code is working fine in other pc. Any solution to this ?
SEVERE: Servlet.service() for servlet [ServletAdaptor] in context with path [/REST] threw exception [Servlet execution threw an exception] with root cause
java.lang.AbstractMethodError
at com.sun.jersey.core.spi.factory.MessageBodyFactory._getMessageBodyWriter(MessageBodyFactory.java:395)
at com.sun.jersey.core.spi.factory.MessageBodyFactory._getMessageBodyWriter(MessageBodyFactory.java:382)
at com.sun.jersey.core.spi.factory.MessageBodyFactory.getMessageBodyWriter(MessageBodyFactory.java:363)
at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:266)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1448)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1360)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1350)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
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 am not sure how much did you really searched for this.
Java document state specific reason behind this error.
http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/AbstractMethodError.html
I think your jar are mismatching... Jar that you are compiling at local and jar used while running the application at some other location in different. This is basic issue for most of such issue. You can verify version of your jars...
I looked few more options, but people talk about different versions of jars... Please have a better look on your jars.. It might help....
Related
Im facing an exception HTTP Status 500 - javax.servlet.ServletException: File "/common/IncludeGoogleKey.jsp" not found
Looking that system can not find file "/common/IncludeGoogleKey.jsp" where using statement <jsp:include page="/common/IncludeGoogleKey.jsp" /> to include the file, file is on the same location as mentioned and when i click on the page attribute by pressing the Ctrl key(as using eclipse) IDE takes me to that file it means that file exist on correct location but when i refresh the web page it gives exception.
EDIT
webapps/AppName/common/IncludeGoogleKey.jsp is the file need to be includ, where
webapps/AppName/PVS/P_Search.jsp is the file having the include statement.
full trace is
May 09, 2014 1:28:12 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [action] in context with path [/appName] threw exception [javax.servlet.ServletException: File "/common/IncludeGoogleKey.jsp" not found] with root cause
javax.servlet.ServletException: File "/common/IncludeGoogleKey.jsp" not found
at org.apache.jasper.servlet.JspServlet.handleMissingResource(JspServlet.java:412)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:392)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:690)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:599)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:536)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:954)
at org.apache.jsp.PVS.Partner_005fSearch_jsp._jspService(Partner_005fSearch_jsp.java:290)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:690)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:477)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.mind.common.CharsetEncoding.doFilter(CharsetEncoding.java:36)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at com.googlecode.psiprobe.Tomcat60AgentValve.invoke(Tomcat60AgentValve.java:30)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:336)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Fragment "/common/IncludeGoogleKey.jsp" should be present in :
/<WEB_Project_Name>/WebContent/
common/IncludeGoogleKey.jsp
Make sure IncludeGoogleKey.jsp is present in above location.
Have the similar problem - code just stopped working on Servlet-to-JSP forwarding.
org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.StackOverflowError
How to fix it:
Quit IDE (I used IDEA)
Reopen IDE
If you have something in red - push "Reimport ALL Maven Projects" (As I used Maven)
The common folder must be moved to WEB-INF directory. The statement is edited as follows (I use IntelliJ IDEA):
<jsp:include page="WEB-INF/common/IncludeGoogleKey.jsp" />
This question already has answers here:
How to solve this java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream?
(6 answers)
Closed 6 years ago.
I am trying to implement web plugin where i need file as an input. So i am using org.apache.commons.fileupload. It has internal dependency on org.apache.commons.io so included that in my plug-in as well as Bridge. But at run time am getting following error.
SEVERE: Servlet.service() for servlet [equinoxbridgeservlet] in context with path [/bridge] threw exception [Servlet execution threw an exception] with root cause
java.lang.ClassNotFoundException: org.apache.commons.io.output.DeferredFileOutputStream
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.apache.commons.fileupload.disk.DiskFileItemFactory.createItem(DiskFileItemFactory.java:195)
at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:343)
at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:115)
at sci2webbundle.UploadFile.doPost(UploadFile.java:122)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:91)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:110)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.eclipse.equinox.servletbridge.BridgeServlet.service(BridgeServlet.java:115)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
I did almost everything right. But i forget to add dependencies on imported Packages in MANIFEST.MF file. Just add org.apache.commons.io.output to dependencies thats it. It works :)
I am trying to load to Tomcat 7 in linux a java api of a C++ library (freeling). After reading several manuals about how to load a jni library (using LD_LIBRARY_PATH, Wl, rpath in the compilation, ldconfig...) I can't load the library.
I have to say that firstly I wrote a java standalone application and the library is loaded correctly. The problem appears when I transform the standalone application in a axis2 web service. I have followed the pojo axis2 approach to build the service, and them I have embebed axis2 in tomcat. The error appears when I try to run the service. Also, I have to say that the system.loadlibrary works, and the error is returned when the first method of the library is called.
The error that I get when I call the web application is the following:
[ERROR] edu.upc.freeling.freelingJNI.Util_initLocale(Ljava/lang/String;)V
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:212)
at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:117)
at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
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:724)
Caused by: java.lang.UnsatisfiedLinkError: edu.upc.freeling.freelingJNI.Util_initLocale(Ljava/lang/String;)V
at edu.upc.freeling.freelingJNI.Util_initLocale(Native Method)
at edu.upc.freeling.Util.initLocale(Util.java:39)
at es.ujaen.metaphor.FreelingNLP.<init>(Unknown Source)
at es.ujaen.metaphor.FigurativeLanguageWS.identifyFigurativeLanguageLemma(Unknown Source)
at es.ujaen.metaphor.TestMetaphor.main(Unknown Source)
... 29 more
Thanks
i'am using a library have structure below
i am adding vn.hus.nlp.tokenizer-4.1.1.jar file into libraries by Add JAR/Folder and copy the rest into my project. it work when i using java application. but when i try servlet, i got problem when using this library.
My project
Servlet: class Filter extends HttpServlet
try {
VietTokenizer v = new VietTokenizer(); // error here !
JSONObject jso=new JSONObject();
jso.put("status","A");
jso.put("label","true");
out.print(jso);
} finally {
out.close();
}
log
SEVERE: Servlet.service() for servlet [Filter] in context with path [/BadwordFilter] threw exception [Servlet execution threw an exception] with root cause
java.lang.ClassNotFoundException: org.apache.commons.cli.ParseException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
at badword.filter.Filter.processRequest(Filter.java:51)
at badword.filter.Filter.doGet(Filter.java:74)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
json-simple-1.1.1.jar is work well.
thank you!
You are missing the commons-cli library. You can find it for example here, included in the archive in the lib folder:
https://code.google.com/p/vntagger-gate-plugin/source/browse/lib/vn.hus.nlp.tokenizer-4.1.1.jar
You can add it the same way you added the first library.
I think, library don't import in libs when you deploy
Right click on your web project, select Libraries. In Complie Tab, make sure your library was checked!
I created a test vaadin project- and when I try to run it on local Tomcat 7 server, this is the error I am getting---
SEVERE: Allocate exception for servlet Spin the Bottle
javax.servlet.ServletException: Failed to load application class: com.anyaservices.spinthebottle.App_Main
at com.vaadin.terminal.gwt.server.ApplicationServlet.init(ApplicationServlet.java:71)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:857)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
What have i done wrong here? I just created a Vaadin project using the new project wizard...I did not even add/edit any code to it.
Check that "com.anyaservices.spinthebottle.App_Main" path points to a valid Java file contains public class which extends Vaadin Application class.