I have implement a certain spring-ws service and when I sent a soap message I receive in spring webapplication 1 (running on tomcat 6.0.32):
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:gen="http://www.foo.com/bar/webservice/generated">
<soapenv:Header/>
<soapenv:Body>
<gen:GetAllPanelWSRequest/>
</soapenv:Body>
</soapenv:Envelope>
Response
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<ns2:GetAllPanelWSResponse xmlns:ns2="http://www.foo.com/bar/webservice/generated">
<ns2:PanelWS ns2:Id="5">
<ns2:name>all</ns2:name>
<ns2:code>all</ns2:code>
</ns2:PanelWS>
<ns2:PanelWS ns2:Id="9">
<ns2:name>test</ns2:name>
<ns2:code>test1</ns2:code>
</ns2:PanelWS>
</ns2:GetAllPanelWSResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
So far no problem. From a webappliction 2 (not using spring MVC etc.) I made a function and when I run this function it works:
Main.java:
...
public class Main {
public static void main(String[] args) {
List<PanelWS> panelWSs = CallServices.getPanelWSs();
for (PanelWS p : panelWSs) {
System.out.println("\t" + makeString(p));
}
}
...
CallServices.java
public static List<PanelWS> getPanelWSs() {
ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
PanelClient client = (PanelClient) ctx.getBean("client");
PanelWS panelWS = null;
// Get all panelWS
System.out.println("Get all panels...");
List<PanelWS> panelWSs = client.getAllPanelWS();
return panelWSs;
}
Output:
Get all panels...
[id=5, name=all, code=all]
[id=9, name=test, code=test1]
So this works great and as expected. But when I want to call the function
<%
List<PanelWS> panelWSs = CallServices.getPanelWSs();
%>
within a JSP (runnning on the same tomcat server) or a simple class I get the following error:
Server:
13-mei-2011 17:57:37 com.sun.xml.internal.messaging.saaj.soap.MessageImpl saveChanges
SEVERE: SAAJ0539: Unable to get header stream in saveChanges
13-mei-2011 17:57:37 com.sun.xml.internal.messaging.saaj.soap.MessageImpl saveChanges
SEVERE: SAAJ0540: Error during saving a multipart message
Client:
org.springframework.ws.soap.saaj.SaajSoapMessageException: Could not write message to OutputStream: Error during saving a multipart message; nested exception is com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Error during saving a multipart message
I'm using the following Java version pointing to myeclipse and tomcat (runs on):
*JDK 1.6.0_13*
Jars:
xercesImpl-2.9.1.jar
xalan-2.7.1.jar
serializer-2.7.1.jar
spring-ws-1.5.9-all.jar
spring.jar(2.5.6)
xml-apis-1.3.04.jar
xml-apis-ext-1.3.04.jar
Full stacktrace of client
Message: org.springframework.ws.soap.saaj.SaajSoapMessageException: Could not write message to OutputStream: Error during saving a multipart message; nested exception is com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Error during saving a multipart message
Error ID: #9yb3mzb7
Stack trace: org.springframework.ws.soap.saaj.SaajSoapMessage.writeTo(SaajSoapMessage.java:169)
org.springframework.ws.client.core.WebServiceTemplate.sendRequest(WebServiceTemplate.java:580)
org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:549)
org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:502)
org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:351)
org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:345)
org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:337)
com.foo.bar.webservice.client.PanelMGMClientImpl.getAllPanelWS(PanelMGMClientImpl.java:22)
com.foo.bar.webservice.client.CallServices.getPanelWSs(CallServices.java:22)
org.apache.jsp.workspace.aclusers_jsp._jspService(aclusers_jsp.java:786)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
Fullstacktrace of server
**
**SEVERE: Servlet.service() for servlet spring-ws threw exception
java.io.IOException: org.apache.xml.serializer.ToXMLSAXHandler cannot be cast to org.apache.xml.serializer.SerializationHandler
at com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl.output(EnvelopeImpl.java:298)
at com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl.output(EnvelopeImpl.java:309)
at com.sun.xml.internal.messaging.saaj.soap.SOAPPartImpl.getContentAsStream(SOAPPartImpl.java:305)
at com.sun.xml.internal.messaging.saaj.soap.MessageImpl.getHeaderBytes(MessageImpl.java:947)
at com.sun.xml.internal.messaging.saaj.soap.MessageImpl.saveChanges(MessageImpl.java:1098)
at org.springframework.ws.soap.saaj.Saaj13Implementation.writeTo(Saaj13Implementation.java:268)
at org.springframework.ws.soap.saaj.SaajSoapMessage.writeTo(SaajSoapMessage.java:165)
at org.springframework.ws.transport.AbstractWebServiceConnection.send(AbstractWebServiceConnection.java:45)
at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:97)
at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57)
at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:230)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.foo.bar.support.gzip.CompressionFilter.doFilter(CompressionFilter.java:30)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:168)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:864)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665)
at java.lang.Thread.run(Thread.java:619)
16-mei-2011 14:20:12 com.sun.xml.internal.messaging.saaj.soap.EnvelopeFactory createEnvelope
SEVERE: SAAJ0511: Unable to create envelope from given source**
**
hopefully this is enough information to solve the problem. I found some messages and bugs the pointing to the fact that I need to delete some Jars (xalan,xercesImpl and serializer) from the projects and add these jars to the jdk\lib\endorsed\ folder and add to tomcat the argument: -Djava.endorsed.dirs=. This works but I can't do this because the applications is running on several servers already.
Thx in advance
Alternative solution
Solved It for now while using the Apache CXF on the client. And spring-ws 1.5.9 on the server... apparently spring-ws sucks with jdk > 1.5
Maybe you should try considering updating to xerces-2.10.x, the problem can be that in jdk6 (rt.jar) there is a com.sun.org.apache.xerces package which seem to contain a jaxp 1.4 implementation, so does xerces 2.10+:
"It also contains an implementation of
the parser related portions of JAXP
1.4"
quote from here.
Are you building the binary containing the jsp as a separate process or you are building everything together? If it's separated, you can try to remove xerces and xalan from the buildpath of that package only? - If you cannot, try upgrading maybe it'll help.
Still think it would be better to have a service calling your ws and you'd invoke that service from the jsp, that way you could test it separately, but perhaps you can't do that for some reason.
If both of these fail, can you post a) full stacktrace b) some of the errors which appear if you remove xerces and xalan alltogether?
Solved It for now using the Apache CXF 2.4.0 on the client. And spring-ws 1.5.9 on the server... apparently spring-ws sucks with jdk > 1.5
This is a known issue with Spring-WS and Java 6, see ticket SWS-175. According to this ticket the solution is to remove Xalan and Xerces from your webapp classpath.
Related
I'm trying to create a XML file and from this and a XSL file a new PDF should be created. The problem is that yesterday everything worked fine.
Today I rerun the program and all of a sudden it crashes everytime I want to create the PDF.
I'm using Apache FOP 9.5 to create the PDF and the last lines I see in the log before the error occures are
Blockquote
javax.servlet.ServletException: Servlet execution threw an exception
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:314)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.t_systems.pif_frontend.tools.UTF8Filter.doFilter(UTF8Filter.java:164)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1085)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.StackOverflowError
After that line I'm getting a lot of lines like this:
Blockquote at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:709)
at java.lang.StringBuffer.append(StringBuffer.java:421)
at org.apache.fop.fo.properties.PercentLength.toString(PercentLength.java:121)
at java.lang.String.valueOf(String.java:2981)
at java.lang.StringBuffer.append(StringBuffer.java:265)
at org.apache.fop.fo.flow.table.TableColumn.toString(TableColumn.java:233)
at java.lang.String.valueOf(String.java:2981)
at java.lang.StringBuffer.append(StringBuffer.java:265)
at org.apache.fop.datatypes.LengthBase.toString(LengthBase.java:135)
at java.lang.String.valueOf(String.java:2981)
at java.lang.StringBuffer.append(StringBuffer.java:265)
at org.apache.fop.fo.properties.PercentLength.toString(PercentLength.java:121)
at java.lang.String.valueOf(String.java:2981)
at java.lang.StringBuffer.append(StringBuffer.java:265)
at org.apache.fop.fo.flow.table.TableColumn.toString(TableColumn.java:233)
These lines repeat several times.
From my logging I see that the program reaches this code section:
Fop fop;
fop = FopFactory.newInstance().newFop(MimeConstants.MIME_PDF, pdf);
logger.debug("FactoryManager created");
Source xml = new StreamSource(xmlFile);
Source xsl = new StreamSource(xslFile);
logger.debug("StreamSources created");
Result sax = new SAXResult(fop.getDefaultHandler());
logger.debug("Result created");
Transformer transformer = TransformerFactory.newInstance().newTransformer(xsl);
logger.debug("Tranformator created"); //This is the last line that gets printed before the crashing occures
transformer.transform(xml, sax);
logger.debug("Transformation done"); //This line is not printed out
I think that the
transformer.transform(xml, sax);
line is causing the error but it worked fine several days before without any changes. Has anybody an idea what migth be the problem here? I've seen some people writing about a never ending recursive call but that's not the case here because I only call the function once and based on the result I'm forwarding to another page.
okay so the answear seems to be a missing log4j.properties file.
In the project this file went missing and thats what causes the crashes. After adding the properties file everything is working fine.
I'm trying to Download a pdf from a MySQL-DB ( I get it as a Blob, and up to that point everything works just fine. But when I try to get the ServletOutputstream to send it to the client the programm crashes.
AFAIK the exception is thrown when the method has been called before or the getwriter-method has. But I don't use the getwriter-method in my code at all and the other getOutPutStream-methods in the programm are not reached (I commented them out to make sure).
(The whole thing happens in a JSP if that matters for any reason)
Heres my code snippet and the Exception:
Code
Blob pdf = null;
if(request.getParameter("reportId") != null){
pdf = testszenario.getReportErgebnisPdf(Integer.parseInt(request.getParameter("reportId")), request.getParameter("erzeugung"));
}
byte[] buf = new byte[(int)pdf.length()];
InputStream inputStream = pdf.getBinaryStream();
inputStream.read(buf);
inputStream.close();
response.setContentType("application/pdf");
response.setHeader("Content-disposition","attachment; filename=test.pdf");
ServletOutputStream sos = response.getOutputStream();
// response.getOutputStream().write(buf);
Exception
26.03.2013 09:28:29 org.apache.catalina.core.ApplicationDispatcher invoke
SCHWERWIEGEND: Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException
at org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(ServletResponseWrapperInclude.java:63)
at org.apache.jsp.jsp.modules.Testszenario.PostReportResultOverview_jsp._jspService(PostReportResultOverview_jsp.java:115)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
at org.apache.jsp.jsp.McFrame_jsp._jspService(McFrame_jsp.java:284)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Please check if your response is committed. If you try to do something on a committed response then IllegalStateException may arise. Response will be committed, if page buffer size is exceeded.
It might indeed matter that you're doing this in a JSP. Keep in mind that the JSP is part of the output rendering phase of a web application request, so the container might have obtained the writer object already. Try moving your code into a servlet instead. It'll give you more control over the writer/streams.
I am having a wicket application and I am using Ebean ORM mapping. I have set all the credential in ebean.properties. But I am getting an error message "Could not initialize class com.avaje.ebean.Ebean" when I deployed it on server, Its gives error as follows
Last cause: Could not initialize class com.avaje.ebean.Ebean
WicketMessage: Can't instantiate page using constructor 'public com.zipgrocery.pages.HomePageNew(org.apache.wicket.request.mapper.parameter.PageParameters)' and argument ''. Might be it doesn't exist, may be it is not visible (public).
Stacktrace
Root cause:
java.lang.NoClassDefFoundError: Could not initialize class com.avaje.ebean.Ebean
at com.zipgrocery.data.Merchant.getMerchantsByZone(Merchant.java:374)
at com.zipgrocery.pages.HomePageNew.<init>(HomePageNew.java:77)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:173)
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:77)
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:47)
at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:103)
at org.apache.wicket.request.handler.PageProvider.resolvePageInstance(PageProvider.java:264)
at org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:165)
at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:105)
at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:224)
at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784)
at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:244)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:311)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)
Complete stack:
org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor 'public com.zipgrocery.pages.HomePageNew(org.apache.wicket.request.mapper.parameter.PageParameters)' and argument ''. Might be it doesn't exist, may be it is not visible (public).
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:196)
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:77)
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:47)
at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:103)
at org.apache.wicket.request.handler.PageProvider.resolvePageInstance(PageProvider.java:264)
at org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:165)
at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:105)
at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:224)
at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784)
at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:173)
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:77)
at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:47)
at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:103)
at org.apache.wicket.request.handler.PageProvider.resolvePageInstance(PageProvider.java:264)
at org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:165)
at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:105)
at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:224)
at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784)
at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
But it works fine when I deploy it on my localhost. I tried to find the solutions for this but not getting. So Help me out...
I'm not familiar with this guy "Ebean ORM", but the error track is pretty generic and seems has nothing really to do with "Ebean ORM" itself. Based on my past exp, it is more like a classloader issue. You said it was running fine locally and then? where is it broken? when you have such issues like "NoClassDefFoundError", always check what classloader is being used. And also it is worth to check whether your broken environment has multiple versions of the class/jar as well as if the server has its embedded version of this class/jar.
i've created this webpage using jsf,prettyfaces and hibernate
i looked around and most people says that this error is because of cache
most of them found this error after login,logout and try to login back
but i found this error when i log in,and when i try to navigate to any other page,any link that i clicked will produce this error
what makes it harder is that this error doesnt occur everytime
sometimes when i try restart the server,login back,everythin work just fine
but sometimes when this error occur again, i tried restart the server and try login back.the same error still occur
javax.faces.application.ViewExpiredException: viewId:/ePortfolio.jsf - View /ePortfolio.jsf could not be restored.
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:212)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:110)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:112)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
JSF keeps a (configurable) number of views in the session. You will get this ViewExpiredException if you do a post to a view that cannot be restored anymore, ie. not present anymore in the list of views for that session.
There can be multiple reasons for this. Two possible scenario's I can think of right now are:
Session invalidated/expired
Multiple (> configured number of sessions in view) views being created after the one that should be restored
To my understanding this is caused by the combination of several things:
A JSF-form containing an internal id for a field has been generated.
The JSF-page has been changed, or the whole application redeployed, causing the internal ids to change.
The JSF-form with the old internal id is submitted (a login page?) and the old internal id cannot be found in the new ids for the JSF-page.
You must have the page refreshed in the browser (getting the new id's) before attempting to submit again.
I am developing web based application in Java [GWT]
I am facing problem with TwitterException.
I used valid credential.
Twitter twitter = new Twitter(myTwitterId, myTwiterPwd);
when I call twitter.getFollowers() method
I got following Error Message
twitter4j.TwitterException: 401:Authentication credentials were missing or incorrect.
<?xml version="1.0" encoding="UTF-8"?>
<errors>
<error code="53">Basic authentication is not supported</error>
</errors>
at twitter4j.http.HttpClient.httpRequest(HttpClient.java:469)
at twitter4j.http.HttpClient.get(HttpClient.java:412)
at twitter4j.Twitter.get(Twitter.java:276)
at twitter4j.Twitter.get(Twitter.java:228)
at twitter4j.Twitter.getFollowersStatuses(Twitter.java:1363)
at twitter4j.Twitter.getFollowers(Twitter.java:1350)
at com.vaibhav.dealelephant.server.impl.TwitterServiceImpl.getTwitterFollowers(TwitterServiceImpl.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:562)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:188)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:224)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
I want to display My followers Images into My Website, but it throws exception after calling this method twitter.getFollowers() method. SO unable to get My follwers Images :(
Please provide me Easy solution for the same
Hope for the best co-operation from your side
Thanks in advance !!!
Yes, your authentication is not working because Twitter made some recent changes
regarding how it lets 3rd party code authenticate.
http://news.techworld.com/security/3237604/twitter-turns-on-oauth-api-authentication/
http://www.networkworld.com/news/2010/083110-twitter-api-has-new-third.html?hpg1=bn
http://www.wired.com/epicenter/2010/08/twitter-login-errors/
http://groups.google.com/group/twitter-api-announce/browse_thread/thread/f71eb68600996af8
In other words, Basic authentication has been turned off for the API.
https://apiwiki.twitter.com/Authentication
As Allain mentions, oAuth is the way to go.
The code you posted is different than what I've seen in the past for connecting. I think (though I'm not sure) that oAuth is the preferred way of authenticating now.
Here's a blog that details using oAuth to connect.
I was having that trouble, finally the solution was to put a valid Callback url in my twitter API at (https://dev.twitter.com/), I used google+ url, saved changes (it could take a minutes before the changes are made, refresh the page to be sure) and it worked.