I'm receiving this error while accessing in the index page of my JSP project.
Sep 3, 2013 12:03:14 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [jsp] in context with path [/MyProject] threw exception [java.lang.NullPointerException] with root
cause
java.lang.NullPointerException
at org.apache.jsp.index_jsp._jspService(index_jsp.java:126)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
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: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.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
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:936)
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:1004)
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$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
I guess this is a "standard error" from TomCat but I can't find out what is the real problem.
It's a java.lang.NullPointerException in your JSP page, but I take it you'd figured that out already.
JSP pages are converted/compiled to Java - thus the (index_jsp.java:126) in the stacktrace - but unfortunately you can't use the line number for figuring out the problem as it doesn't relate to your JSP file, but the resulting Java source.
You should, however, be able to figure out where the NPE happens by inspection, since your JSP is of course a thin presentation layer, right :-) A usual mistake could be referencing attributes that aren't provided on entry to the page, eg. request.getParameter( "something" ).equals( "somethingelse" ) <-- possible NPE on .equals()
If you were to share the JSP page (perhaps in the form of an SSCCE), this community can help much better.
Cheers,
It's not a "Tomcat standard" error. Its an error in your source code. JSP is translated to java and java.lang.NullPointerException signifies that somewhere you are trying to use some variable without properly initializing it. Or you may have expected it to be initialized but it hasn't due to some resource being unavailable.
You CAN use the line number to find the error. (The answer by Anders R. Bystrup incorrectly says the opposite "...unfortunately you can't use the line number for figuring out the problem".)
It's true the JSP pages are converted to Java and thus the line number does not correspond to the line number in your JSP, but you can find the converted Java file in your work directory, somewhere like:
${TOMCAT_HOME}/work/Catalina/localhost/_/org/apache/jsp/index_jsp.java
and looking at the given line number (126) in that file should point you toward the problem in your JSP (there will likely be an identical line in your JSP).
As others have already pointed out, in this case you have an NPE.
Related
While opening the window getting this error in version 9.0.1.2. And it's working fine in 8.5.0 version. After upgrading the version from 8.5.0 to 9.0.1.2 this error occurred.
window = (Window) Executions.createComponents(url, parent, params);
window.doModal();
java.lang.NumberFormatException: For input string: "auto"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Integer.parseInt(Integer.java:615)
at org.zkoss.zul.Grid.isVflex(Grid.java:420)
at org.zkoss.zkmax.zul.impl.LiveGridDataLoader.isCropper(LiveGridDataLoader.java:392)
at org.zkoss.zul.Grid.renderProperties(Grid.java:1791)
at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:2175)
at org.zkoss.zk.ui.AbstractComponent.redrawChildren(AbstractComponent.java:2266)
at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:2207)
at org.zkoss.zk.ui.AbstractComponent.redrawChildren(AbstractComponent.java:2266)
at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:2207)
at org.zkoss.zk.ui.AbstractComponent.redrawChildren(AbstractComponent.java:2266)
at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:2207)
at org.zkoss.zk.ui.AbstractComponent.redrawChildren(AbstractComponent.java:2266)
at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:2207)
at org.zkoss.zk.ui.impl.UiVisualizer.redraw(UiVisualizer.java:1016)
at org.zkoss.zk.ui.impl.UiVisualizer.redrawComponents(UiVisualizer.java:1030)
at org.zkoss.zk.ui.impl.UiVisualizer.addResponsesForCreatedPerSiblings(UiVisualizer.java:882)
at org.zkoss.zk.ui.impl.UiVisualizer.getResponses(UiVisualizer.java:746)
at org.zkoss.zk.ui.impl.UiEngineImpl.getResponses(UiEngineImpl.java:1575)
at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1345)
at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:611)
at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:487)
at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:495)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
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:222)
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:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
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:1002)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
you forgot to ask a question that can be answered / solved.
The error can be explained by the source code of the isVflex method on grid itself (however that information might not help your actual problem, whatever that might be)
v8.5.0: https://github.com/zkoss/zk/blob/v8.5.0/zul/src/org/zkoss/zul/Grid.java#L399-L408
v9.0.1.2:
https://github.com/zkoss/zk/blob/v9.0.1.2/zul/src/org/zkoss/zul/Grid.java#L412-L421
The value 'auto' is not handled by this method, leading to this error.
If you provide a correct value (null, '', 'true', 'min' or a number) the error will go away.
The same exception should have happened in both versions 8.5.0 and 9.0.1.2 given the value 'auto'.
Unfortunately you didn't provide a working/failing example to investigate so I can't comment on that.
I have a problem with Liferay (liferay-portal-6.2-ce-ga2 installed on a Linux CentOS) :
I create a simple Web Content
I click on "Add translation" :
An empty (blank) popup shows up :
The StackTrace is :
[root#localhost liferay-portal-6.2-ce-ga2]# 16:11:40,280 ERROR [http-bio-8080-exec-5][IncludeTag:129] Current URL /group/control_panel/manage?p_p_auth=4sFFw6Rw&p_p_id=15&p_p_lifecycle=0&p_p_state=pop_up&p_p_mode=view&doAsGroupId=10197&refererPlid=11419&controlPanelCategory=sites&_15_groupId=10197&_15_struts_action=/journal/edit_article&_15_articleId=11555&_15_toLanguageId=en_GB&yui_patched_v3_11_0_1_1418400688901_2444=1418400720708 generates exception: 1
java.lang.ArrayIndexOutOfBoundsException: 1
at org.apache.jsp.html.portlet.journal.edit_005farticle_jsp._jspService(edit_005farticle_jsp.java:824)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:295)
at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:192)
at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:83)
at org.apache.jsp.html.common.themes.portlet_jsp._jspService(portlet_jsp.java:3141)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
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:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:96)
I found the edit_005farticle_jsp.java:824 but I can't understand what's causing the ArrayIndexOutOfBoundsException.
Install has been done and redone properly several times.
Every help would be very appreciated.
Thanks in advance.
OK, I found what was wrong : one of our hooks had an impact on this popup (causing the ArrayIndexOutOfBoundsException).
#Pawel : thanks for your concern anyway.
I am trying to load some Freemarker templating from the DB using stringLoader and executing them through template.process, but here is the problem, freemarker stuff like <#if... is executing but when I try to execute assign JspTaglibs it breaks.
Here is a simple example:
From the DB I get <#assign bean=JspTaglibs["/WEB-INF/struts-bean.tld]>, which i put in a in StringTemplateLoader. I create configuration, template.. so far everything is working. When I do template.process(data, out), the page reports:
Starting output:FreeMarker template error: The following has evaluated to null or missing: ==> JspTaglibs [in template "temp" at line 1, column 15] Tip: If the failing expression is known to be legally null/missing, either specify a default value with myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthessis: (myOptionVar.foo)!myDefault, (myOptionVar.foo)?? The failing instruction (FTL stack trace): ---------- ==> #assign bean = JspTaglibs["/WEB-INF/s... [in template "temp" at line 1, column 1] ---------- Java stack trace (for programmers): ---------- freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...] at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:98) at freemarker.core.DynamicKeyName._eval(DynamicKeyName.java:87) at freemarker.core.Expression.eval(Expression.java:111) at freemarker.core.Assignment.accept(Assignment.java:106) at freemarker.core.Environment.visit(Environment.java:265) at freemarker.core.Environment.process(Environment.java:243) at freemarker.template.Template.process(Template.java:277) at org.apache.jsp.test5_jsp._jspService(test5_jsp.java:109) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) 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:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2440) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2429) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source)
Scenario that I have is that I have some code stored in the database and I would like to execute it by freemarker during template.process().
Is that even possible, and if it is, what am I doing wrong?
The problem is that JspTaglibs is not a core FreeMarker feature, but something that the FreemarkerServlet puts into the data-model, and something that requires Servlet environment and a HTTP request (as JSP requires that). Out of the box, there's no way to separate this feature from the FreemarkerServlet. However, maybe you can extend it so that you can still use it for your purpose. Most of the magic happens inside createModel, where among others, it adds JspTaglibs to the data-model.
It might also useful to know that FreeMarker (and thus FreemarkerServlet) can load templates directly from the database, if you give it a such TemplateLoader implementation through the FreeMarker Configuration. If all you want is serving templates from the database instead of where Struts traditionally stores them, you just need to provide the proper TemplateLoader.
I have made a simple Repository containing all the persons in my system, everything seems to work fine. I can add, remove and even retrieve single persons based on a given key and value but for some reason i can't retrieve all persons stored in the Repository directly. I tried do it by using the findAll() method, which should return an iterable. I then try to iterate with the iterable and store each person in an arraylist which i want the function to return.
public List<Person> getAllPersons() {
Iterable<Person> p = personRepository.findAll();
System.out.println("person count: " + personRepository.count());
List<Person> persons = new ArrayList<Person>();
for (Person person : p) {
System.out.println("person");
persons.add(person);
}
return persons;
}
The printline prints "3" so the repository is not empty but still i get a nullpointerexception in the error below.
apr 16, 2014 3:45:54 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [bmsapp] in context with path [/bmsapp] threw exception [Request processing failed; nested exception is org.neo4j.graphdb.TransactionFailureException: Failed to mark transaction as rollback only.] with root cause
java.lang.NullPointerException
at org.neo4j.kernel.TopLevelTransaction.markAsRollbackOnly(TopLevelTransaction.java:93)
at org.neo4j.kernel.TopLevelTransaction.failure(TopLevelTransaction.java:86)
at org.neo4j.cypher.internal.spi.v2_0.TransactionBoundExecutionContext.close(TransactionBoundExecutionContext.scala:58)
at org.neo4j.cypher.internal.compiler.v2_0.spi.DelegatingQueryContext.close(DelegatingQueryContext.scala:32)
at org.neo4j.cypher.internal.compiler.v2_0.spi.ExceptionTranslatingQueryContext.org$neo4j$cypher$internal$compiler$v2_0$spi$ExceptionTranslatingQueryContext$$super$close(ExceptionTranslatingQueryContext.scala:34)
at org.neo4j.cypher.internal.compiler.v2_0.spi.ExceptionTranslatingQueryContext$$anonfun$close$1.apply$mcV$sp(ExceptionTranslatingQueryContext.scala:34)
at org.neo4j.cypher.internal.compiler.v2_0.spi.ExceptionTranslatingQueryContext$$anonfun$close$1.apply(ExceptionTranslatingQueryContext.scala:34)
at org.neo4j.cypher.internal.compiler.v2_0.spi.ExceptionTranslatingQueryContext$$anonfun$close$1.apply(ExceptionTranslatingQueryContext.scala:34)
at org.neo4j.cypher.internal.compiler.v2_0.spi.ExceptionTranslatingQueryContext.org$neo4j$cypher$internal$compiler$v2_0$spi$ExceptionTranslatingQueryContext$$translateException(ExceptionTranslatingQueryContext.scala:149)
at org.neo4j.cypher.internal.compiler.v2_0.spi.ExceptionTranslatingQueryContext.close(ExceptionTranslatingQueryContext.scala:34)
at org.neo4j.cypher.internal.compiler.v2_0.ClosingIterator.failIfThrows(ClosingIterator.scala:94)
at org.neo4j.cypher.internal.compiler.v2_0.ClosingIterator.next(ClosingIterator.scala:45)
at org.neo4j.cypher.internal.compiler.v2_0.PipeExecutionResult.next(PipeExecutionResult.scala:168)
at org.neo4j.cypher.internal.compiler.v2_0.PipeExecutionResult.next(PipeExecutionResult.scala:34)
at scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
at scala.collection.convert.Wrappers$IteratorWrapper.next(Wrappers.scala:30)
at org.neo4j.cypher.internal.compiler.v2_0.PipeExecutionResult$$anon$1.next(PipeExecutionResult.scala:76)
at org.neo4j.helpers.collection.IteratorWrapper.next(IteratorWrapper.java:47)
at org.neo4j.helpers.collection.IteratorWrapper.next(IteratorWrapper.java:47)
at bmsapp.repository.NeoPersonDao.getAllPersons(NeoPersonDao.java:33)
at bmsapp.service.SimplePersonManager.getPersons(SimplePersonManager.java:32)
at bmsapp.web.HelloController.HelloHandler(HelloController.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:175)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:446)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:434)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
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:472)
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:936)
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:1004)
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:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:744)
I already wasted hours in order to fix this but without any luck. Can anybody please help me out here?
Try mark your personRepository.findAll() as #Transactional.
If it still doesn't work, can you post your personRepository.findAll() method plz?
Thanks for the answers! I have managed to solve the problem by adding
"<tx:annotation-driven mode="proxy"/>
to my application context xml file. It's working perfectly now! However i'm still not sure what this statemant does and why i only need it for the findAll() method and not any of the other's i've used. (count(), findOne(), findBySchemaPropertyValue() etc)
I tried the mode="proxy" and it didn't work for me, this should only have an impact if you are using non-injected transactional methods to call each other (explanation here).
This 'TransactionFailureException' is probably related to the issue: https://jira.spring.io/browse/DATAGRAPH-531. If that's the case, you need to change
service.findAll()
to:
service.findAll().as(Collection.class)
... and the it should go away.
I have created a new web service project which works fine, when trying to access using correct url i am able to view the wsdl on the browser.
But when a wrong url is typed stack trace is being shown on the browser as below :
org.apache.axis2.AxisFault: The endpoint reference (EPR) for the Operation not found is //services/TestService?wsdlkdfl and the WSA Action = null. If this EPR was previously reachable, please contact the server administrator.
at org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:102)
at org.apache.axis2.engine.Phase.invoke(Phase.java:329)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:262)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:168)
at org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:144)
at org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:139)
at org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:837)
at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:273)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
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:472)
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:947)
how to handle this scenario to show a blank page rather than showing stack trace?
I was able to solve this issue by changes in axis2.xml file as below :
"sendStacktraceDetailsWithFaults" parameter to > false
"DrillDownToRootCauseForFaultReason" parameter to > false
Previously these two parameters were true, due to which whole of the stack trace was getting displayed.
Hope this helps for some one with same issue. I couldn't find much in the internet.