I've gone thru various links on SO but none of those work for me.
Here is the exception which I get while trying to fetch data using Rest Controller
java.lang.IllegalStateException: getOutputStream() has already been called for this response
at org.apache.catalina.connector.Response.getWriter(Response.java:678) ~[catalina.jar:7.0.57]
at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:213) ~[catalina.jar:7.0.57]
at org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$SpelView.render(ErrorMvcAutoConfiguration.java:227) ~[spring-boot-autoconfigure-1.5.1.RELEASE.jar:1.5.1.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1271) ~[spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1037) ~[spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:980) ~[spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) ~[spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) ~[spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) ~[spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:620) ~[servlet-api.jar:na]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) ~[spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) ~[servlet-api.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) [catalina.jar:7.0.57]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.57]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat7-websocket.jar:7.0.57]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.57]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.57]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.57]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.57]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101) [spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.57]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.57]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101) [spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.57]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.57]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101) [spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.57]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.57]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101) [spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.boot.web.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:108) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.57]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.57]
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748) ~[catalina.jar:7.0.57]
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486) ~[catalina.jar:7.0.57]
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411) ~[catalina.jar:7.0.57]
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338) ~[catalina.jar:7.0.57]
at org.springframework.boot.web.support.ErrorPageFilter.handleErrorStatus(ErrorPageFilter.java:149) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
at org.springframework.boot.web.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:117) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
at org.springframework.boot.web.support.ErrorPageFilter.access$000(ErrorPageFilter.java:59) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
at org.springframework.boot.web.support.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:90) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.boot.web.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:108) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.57]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.57]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) [catalina.jar:7.0.57]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) [catalina.jar:7.0.57]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503) [catalina.jar:7.0.57]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) [catalina.jar:7.0.57]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) [catalina.jar:7.0.57]
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) [catalina.jar:7.0.57]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) [catalina.jar:7.0.57]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421) [catalina.jar:7.0.57]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070) [tomcat-coyote.jar:7.0.57]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) [tomcat-coyote.jar:7.0.57]
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314) [tomcat-coyote.jar:7.0.57]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_20]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_20]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-coyote.jar:7.0.57]
at java.lang.Thread.run(Unknown Source) [na:1.8.0_20]
I have two Entity Class mapped using #ManyToOne mapping.
#Entity
#Table(name = "products")
public class ProductInfo {
#ManyToOne(fetch = FetchType.LAZY, cascade= CascadeType.ALL)
#JoinColumn(name = "names")
private ProductDetails names;
}
//Getter setter
#Entity
#Table(name = "product_details")
public class ProductDetails {
#Id
private String name;
}
//Getter Setter
Here is the controller code
#RequestMapping(value = "/getProducts", method = RequestMethod.GET, produces = "application/json")
public ResponseEntity<Iterable<ProductInfo>> getProductInfo() {
Iterable<ProductInfo> products = repo.findAll();
logger.debug("Found Products ::" + products );
return new ResponseEntity<Iterable<ProductInfo>>(products, HttpStatus.OK);
}
I was able to get the product information when there was no mapping. When I added mapping I got LazyInitialization exception. And I added spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true in the application.properties file. Now I get the above exception.
Any help much appreciated!
Had the same issue, I changed fetch type form lazy to eager and it solved my problem as PRATHAP commented
Related
I am converting all entities to JSON using Gson. I am using the Oracle 11g database, and when I open dialog the following exception occurs when I want to convert:
org.hibernate.exception.SQLGrammarException: ORA-01722: número no válido
at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:82)
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110)
at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:129)
at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)
at com.sun.proxy.$Proxy321.executeQuery(Unknown Source)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1897)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1698)
at org.hibernate.loader.Loader.doQuery(Loader.java:832)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:293)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:263)
at org.hibernate.loader.Loader.loadCollection(Loader.java:2094)
at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:61)
at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:678)
at org.hibernate.event.internal.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:82)
at org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:1801)
at org.hibernate.collection.internal.AbstractPersistentCollection$4.doWork(AbstractPersistentCollection.java:524)
at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:212)
at org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:520)
at org.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:125)
at org.hibernate.collection.internal.PersistentBag.iterator(PersistentBag.java:266)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.write(CollectionTypeAdapterFactory.java:95)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.write(CollectionTypeAdapterFactory.java:60)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:113)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:240)
at com.google.gson.Gson.toJson(Gson.java:605)
at com.google.gson.Gson.toJson(Gson.java:584)
at com.google.gson.Gson.toJson(Gson.java:539)
at com.google.gson.Gson.toJson(Gson.java:519)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.el.parser.AstValue.invoke(AstValue.java:278)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:273)
at org.apache.myfaces.view.facelets.el.ContextAwareTagMethodExpression.invoke(ContextAwareTagMethodExpression.java:96)
at org.apache.myfaces.view.facelets.tag.jsf.core.EventHandler$Listener.processEvent(EventHandler.java:273)
at javax.faces.component.UIComponent$EventListenerWrapper.processEvent(UIComponent.java:1579)
at javax.faces.event.SystemEvent.processListener(SystemEvent.java:43)
at org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:2493)
at org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:586)
at org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:616)
at javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:336)
at javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:336)
at javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:336)
at org.apache.deltaspike.jsf.impl.injection.InjectionAwareApplicationWrapper.publishEvent(InjectionAwareApplicationWrapper.java:148)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:84)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:241)
at org.apache.deltaspike.jsf.impl.listener.request.DeltaSpikeLifecycleWrapper.render(DeltaSpikeLifecycleWrapper.java:111)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:199)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:100)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
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 util.HibernateSessionRequestFilter.executeChain(HibernateSessionRequestFilter.java:91)
at util.HibernateSessionRequestFilter.doFilter(HibernateSessionRequestFilter.java:70)
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.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
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.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
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:748)
And how do I convert using the following code?
builder = new GsonBuilder();
builder.excludeFieldsWithoutExposeAnnotation()
.setFieldNamingPolicy(FieldNamingPolicy.UPPER_CAMEL_CASE)
.registerTypeAdapterFactory(HibernateProxyTypeAdapter.FACTORY)
.excludeFieldsWithModifiers(Modifier.STATIC)
.serializeNulls();
gson2 = builder.create();
this.setJson(gson2.toJson(obj));
I don't use native SQL queries before executing.
I am developing a little webapp meant to be run on Tomcat. The webapp works fine on my Windows machine (Windows 7, Java 1.8, Tomcat 7) but fails to run on my raspberry pi 3 (Raspian with the lastest update, Java 1.8, Tomcat 7). Starting Tomcat is fine until one try to load the login page. Then I got the following output :
Error when loading localhost:8080/Timbreuse/connection
java.lang.NullPointerException
at ch.cpnv.timbreuse.servlets.Connection.doGet(Connection.java:39)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
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.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338)
at ch.cpnv.timbreuse.filters.ConnectedFilter.doFilter(ConnectedFilter.java:39)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
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:503)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
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:421)
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.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
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)
Message : null
java.lang.NullPointerException
at ch.cpnv.timbreuse.servlets.Connection.doGet(Connection.java:39)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
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.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338)
at ch.cpnv.timbreuse.filters.ConnectedFilter.doFilter(ConnectedFilter.java:39)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
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:503)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
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:421)
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.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
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)
Connection.java:39
public static final String VIEW_CONNECTION = "/WEB-INF/connection.jsp";
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
this.getServletContext().getRequestDispatcher(VIEW_CONNECTION).forward(request, response);
}
Folder architecture when the .war is deployed on the Pi
./student
./student/info.jsp
./display
./display/welcomeDisplay.jsp
./display/showDisplay.jsp
./WEB-INF
./WEB-INF/header.jsp
./WEB-INF/changePassword.jsp
./WEB-INF/classes
./WEB-INF/classes/ch
./WEB-INF/classes/ch/cpnv
./WEB-INF/classes/ch/cpnv/timbreuse
./WEB-INF/classes/ch/cpnv/timbreuse/automation
./WEB-INF/classes/ch/cpnv/timbreuse/automation/Automation.java
./WEB-INF/classes/ch/cpnv/timbreuse/automation/Automation.class
./WEB-INF/classes/ch/cpnv/timbreuse/automation/EndOfDay$EndOfDayTask.class
./WEB-INF/classes/ch/cpnv/timbreuse/automation/EndOfDay.class
./WEB-INF/classes/ch/cpnv/timbreuse/automation/EndOfDay.java
./WEB-INF/classes/ch/cpnv/timbreuse/forms
./WEB-INF/classes/ch/cpnv/timbreuse/forms/AddTimeStudentsForm.class
./WEB-INF/classes/ch/cpnv/timbreuse/forms/CreateStudentForm.java
./WEB-INF/classes/ch/cpnv/timbreuse/forms/ChangePasssowordForm.java
./WEB-INF/classes/ch/cpnv/timbreuse/forms/CreateStudentForm.class
./WEB-INF/classes/ch/cpnv/timbreuse/forms/StudentResearchForm.class
./WEB-INF/classes/ch/cpnv/timbreuse/forms/AddTimeStudentsForm.java
./WEB-INF/classes/ch/cpnv/timbreuse/forms/CreateAdminForm.class
./WEB-INF/classes/ch/cpnv/timbreuse/forms/DeleteStudentForm.class
./WEB-INF/classes/ch/cpnv/timbreuse/forms/ConnectionForm.java
./WEB-INF/classes/ch/cpnv/timbreuse/forms/DeleteStudentForm.java
./WEB-INF/classes/ch/cpnv/timbreuse/forms/DeleteTeacherForm.class
./WEB-INF/classes/ch/cpnv/timbreuse/forms/ChangePasssowordForm.class
./WEB-INF/classes/ch/cpnv/timbreuse/forms/StudentResearchForm.java
./WEB-INF/classes/ch/cpnv/timbreuse/forms/DeleteAdminForm.java
./WEB-INF/classes/ch/cpnv/timbreuse/forms/CreateTeacherForm.class
./WEB-INF/classes/ch/cpnv/timbreuse/forms/DeleteAdminForm.class
./WEB-INF/classes/ch/cpnv/timbreuse/forms/ConnectionForm.class
./WEB-INF/classes/ch/cpnv/timbreuse/forms/SetHolydaysForm.java
./WEB-INF/classes/ch/cpnv/timbreuse/forms/CreateAdminForm.java
./WEB-INF/classes/ch/cpnv/timbreuse/forms/CreateTeacherForm.java
./WEB-INF/classes/ch/cpnv/timbreuse/forms/SetHolydaysForm.class
./WEB-INF/classes/ch/cpnv/timbreuse/forms/DeleteTeacherForm.java
./WEB-INF/classes/ch/cpnv/timbreuse/beans
./WEB-INF/classes/ch/cpnv/timbreuse/beans/Teacher.class
./WEB-INF/classes/ch/cpnv/timbreuse/beans/Teacher.java
./WEB-INF/classes/ch/cpnv/timbreuse/beans/Student.class
./WEB-INF/classes/ch/cpnv/timbreuse/beans/Student.java
./WEB-INF/classes/ch/cpnv/timbreuse/beans/Log.class
./WEB-INF/classes/ch/cpnv/timbreuse/beans/Log.java
./WEB-INF/classes/ch/cpnv/timbreuse/beans/User.class
./WEB-INF/classes/ch/cpnv/timbreuse/beans/Holyday.java
./WEB-INF/classes/ch/cpnv/timbreuse/beans/Holyday.class
./WEB-INF/classes/ch/cpnv/timbreuse/beans/User.java
./WEB-INF/classes/ch/cpnv/timbreuse/config
./WEB-INF/classes/ch/cpnv/timbreuse/config/DAOFactoryInitialisation.class
./WEB-INF/classes/ch/cpnv/timbreuse/config/DAOFactoryInitialisation.java
./WEB-INF/classes/ch/cpnv/timbreuse/dao
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOUtility.class
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOImplUser.class
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOImplTeacher.java
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOUser.class
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOLog.class
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOStudent.java
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOUtility.java
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOTeacher.java
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOException.java
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOImplStudent.class
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOImplTeacher.class
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOImplHolyday.class
./WEB-INF/classes/ch/cpnv/timbreuse/dao/dao.properties
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOImplUser.java
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOImplHolyday.java
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOFactory.java
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOImplLog.class
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOImplAdmin.class
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOImplStudent.java
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOHolyday.class
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOFactory.class
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOTeacher.class
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOImplAdmin.java
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOException.class
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOUser.java
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOHolyday.java
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOLog.java
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOStudent.class
./WEB-INF/classes/ch/cpnv/timbreuse/dao/DAOImplLog.java
./WEB-INF/classes/ch/cpnv/timbreuse/servlets
./WEB-INF/classes/ch/cpnv/timbreuse/servlets/SetTimetable.class
./WEB-INF/classes/ch/cpnv/timbreuse/servlets/AdminPanel.java
./WEB-INF/classes/ch/cpnv/timbreuse/servlets/Display.java
./WEB-INF/classes/ch/cpnv/timbreuse/servlets/Connection.java
./WEB-INF/classes/ch/cpnv/timbreuse/servlets/Logout.class
./WEB-INF/classes/ch/cpnv/timbreuse/servlets/SetTimetable.java
./WEB-INF/classes/ch/cpnv/timbreuse/servlets/ChangePassword.java
./WEB-INF/classes/ch/cpnv/timbreuse/servlets/Logout.java
./WEB-INF/classes/ch/cpnv/timbreuse/servlets/SetHolydays.class
./WEB-INF/classes/ch/cpnv/timbreuse/servlets/AdminPanel.class
./WEB-INF/classes/ch/cpnv/timbreuse/servlets/StudentInfo.java
./WEB-INF/classes/ch/cpnv/timbreuse/servlets/ChangePassword.class
./WEB-INF/classes/ch/cpnv/timbreuse/servlets/EndDay.class
./WEB-INF/classes/ch/cpnv/timbreuse/servlets/ManageStudents.java
./WEB-INF/classes/ch/cpnv/timbreuse/servlets/ManageStudents.class
./WEB-INF/classes/ch/cpnv/timbreuse/servlets/Display.class
./WEB-INF/classes/ch/cpnv/timbreuse/servlets/Connection.class
./WEB-INF/classes/ch/cpnv/timbreuse/servlets/EndDay.java
./WEB-INF/classes/ch/cpnv/timbreuse/servlets/StudentInfo.class
./WEB-INF/classes/ch/cpnv/timbreuse/servlets/SetHolydays.java
./WEB-INF/classes/ch/cpnv/timbreuse/mathTime
./WEB-INF/classes/ch/cpnv/timbreuse/mathTime/Math.class
./WEB-INF/classes/ch/cpnv/timbreuse/mathTime/Math.java
./WEB-INF/classes/ch/cpnv/timbreuse/mathTime/Date.class
./WEB-INF/classes/ch/cpnv/timbreuse/mathTime/SecondsPastMidnight.class
./WEB-INF/classes/ch/cpnv/timbreuse/mathTime/SecondsPastMidnight.java
./WEB-INF/classes/ch/cpnv/timbreuse/mathTime/Date.java
./WEB-INF/classes/ch/cpnv/timbreuse/filters
./WEB-INF/classes/ch/cpnv/timbreuse/filters/ConnectedFilter.class
./WEB-INF/classes/ch/cpnv/timbreuse/filters/ConnectionFilter.class
./WEB-INF/classes/ch/cpnv/timbreuse/filters/StudentFilter.class
./WEB-INF/classes/ch/cpnv/timbreuse/filters/TeacherFilter.java
./WEB-INF/classes/ch/cpnv/timbreuse/filters/ConnectionFilter.java
./WEB-INF/classes/ch/cpnv/timbreuse/filters/AdminFilter.java
./WEB-INF/classes/ch/cpnv/timbreuse/filters/AdminFilter.class
./WEB-INF/classes/ch/cpnv/timbreuse/filters/ConnectedFilter.java
./WEB-INF/classes/ch/cpnv/timbreuse/filters/TeacherFilter.class
./WEB-INF/classes/ch/cpnv/timbreuse/filters/StudentFilter.java
./WEB-INF/footer.jsp
./WEB-INF/.gitignore
./WEB-INF/lib
./WEB-INF/lib/bonecp-0.8.1-20131105.191813-1.jar
./WEB-INF/lib/jasypt-1.9.0.jar
./WEB-INF/lib/jstl-1.2.jar
./WEB-INF/lib/java-json.jar
./WEB-INF/lib/slf4j-api-1.6.6.jar
./WEB-INF/lib/joda-time-2.1.jar
./WEB-INF/lib/mysql-connector-java-5.1.38-bin.jar
./WEB-INF/lib/guava-13.0.1.jar
./WEB-INF/web.xml
./WEB-INF/connection.jsp
./connecting.jsp
./form.css
./META-INF
./META-INF/MANIFEST.MF
./teacher
./teacher/setTimeTable.jsp
./teacher/manageStudents.jsp
./teacher/setHolydays.jsp
./admin
./admin/adminPanel.jsp
How can I prevent that ?
The only objects that can be null are request and response, or dispatcher. If you can't place a breakpoint there, I would check tomcat's messages/logs before the exception
I'm a problem with apache-poi, using:
poi-3.7.jar
poi-ooxml-3.7.jar
When I try to instace a new workbook:
XSSFWorkbook workbook = new XSSFWorkbook(someInputStream());
The application throw this exception:
java.lang.NoClassDefFoundError cannot be cast to java.lang.Exception
Complete stacktrace:
java.lang.ClassCastException: java.lang.NoClassDefFoundError cannot be cast to java.lang.Exception
at br.com.bradesco.web.aq.view.exceptionhandler.BradescoExceptionHandler.getOriginalException(Unknown Source)
at br.com.bradesco.web.aq.view.exceptionhandler.BradescoExceptionHandler.handle(Unknown Source)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:191)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:189)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at br.com.bradesco.web.aq.application.adapter.sso.sharedata.ShareDataFilter.doFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at br.com.bradesco.web.aq.view.cryptography.filter.CryptoFilter.doFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at br.com.bradesco.web.aq.view.filters.impl.AbstractBradescoFilterManager.doFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at br.com.bradesco.web.aq.application.session.filter.BradescoSessionFilter.doFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at br.com.bradesco.web.aq.application.util.BeanResolverFilter.doFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at br.com.bradesco.web.aq.view.components.UIFileUpload.FileUploadFilter.doFilter(FileUploadFilter.java:238)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at br.com.bradesco.web.aq.view.filters.impl.CharacterEncodingFilter.doFilter(Unknown Source)
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:614)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:662)
Thanks for some help.
Every once in a while a user on production system, chooses a big date range for a report and this times out after a while.
I don't know where this is configured, but this is the error I get:
03/02/2016 11:29:23 [ajp-apr-8009-exec-21] ERROR - Exception thrown while calling web service.
jasper.wsclient.WSException
at jasper.wsclient.JasperServerWSClient.get(JasperServerWSClient.java:65)
at jasper.wsclient.JasperServerWSClient.get(JasperServerWSClient.java:95)
at jasper.JasperReportServiceImpl.getReports(JasperReportServiceImpl.java:93)
at web.bean.ReportListBean.getReports(ReportListBean.java:47)
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.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:400)
at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:71)
at org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(ELParserHelper.java:532)
at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:378)
at javax.faces.component.UIData.getValue(UIData.java:779)
at org.apache.myfaces.component.html.ext.HtmlDataTableHack.createDataModel(HtmlDataTableHack.java:350)
at org.apache.myfaces.component.html.ext.HtmlDataTableHack.getDataModel(HtmlDataTableHack.java:333)
at org.apache.myfaces.component.html.ext.HtmlDataTable.getDataModel(HtmlDataTable.java:428)
at org.apache.myfaces.component.html.ext.HtmlDataTableHack.getRowCount(HtmlDataTableHack.java:75)
at org.apache.myfaces.renderkit.html.HtmlTableRendererBase.encodeInnerHtml(HtmlTableRendererBase.java:124)
at org.apache.myfaces.renderkit.html.HtmlTableRendererBase.encodeChildren(HtmlTableRendererBase.java:94)
at org.apache.myfaces.renderkit.html.ext.HtmlTableRenderer.encodeChildren(HtmlTableRenderer.java:57)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:319)
at javax.faces.webapp.UIComponentTag.encodeChildren(UIComponentTag.java:343)
at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:251)
at org.apache.myfaces.taglib.UIComponentBodyTagBase.doEndTag(UIComponentBodyTagBase.java:55)
at org.apache.jsp.web.reports_jsp._jspx_meth_t_005fdataTable_005f0(reports_jsp.java:191)
at org.apache.jsp.web.reports_jsp._jspx_meth_h_005fform_005f0(reports_jsp.java:124)
at org.apache.jsp.web.reports_jsp._jspService(reports_jsp.java:88)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:604)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:543)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:954)
at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:656)
at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:101)
at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:137)
at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:758)
at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:890)
at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:460)
at org.apache.jsp.WEB_002dINF.jsp.layouts.BodyLayoutNoStatusBar_jsp._jspx_meth_tiles_005finsert_005f0(BodyLayoutNoStatusBar_jsp.java:207)
at org.apache.jsp.WEB_002dINF.jsp.layouts.BodyLayoutNoStatusBar_jsp._jspx_meth_f_005fsubview_005f0(BodyLayoutNoStatusBar_jsp.java:181)
at org.apache.jsp.WEB_002dINF.jsp.layouts.BodyLayoutNoStatusBar_jsp._jspService(BodyLayoutNoStatusBar_jsp.java:102)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:604)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:543)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:954)
at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:656)
at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:101)
at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:137)
at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:758)
at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:890)
at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:460)
at org.apache.jsp.WEB_002dINF.jsp.layouts.ClassicLayout_jsp._jspx_meth_tiles_005finsert_005f1(ClassicLayout_jsp.java:459)
at org.apache.jsp.WEB_002dINF.jsp.layouts.ClassicLayout_jsp._jspx_meth_f_005fsubview_005f1(ClassicLayout_jsp.java:433)
at org.apache.jsp.WEB_002dINF.jsp.layouts.ClassicLayout_jsp._jspx_meth_f_005ffacet_005f1(ClassicLayout_jsp.java:402)
at org.apache.jsp.WEB_002dINF.jsp.layouts.ClassicLayout_jsp._jspx_meth_f_005fview_005f0(ClassicLayout_jsp.java:207)
at org.apache.jsp.WEB_002dINF.jsp.layouts.ClassicLayout_jsp._jspService(ClassicLayout_jsp.java:106)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
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.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338)
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:415)
at org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl.dispatch(JspTilesViewHandlerImpl.java:233)
at org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl.renderView(JspTilesViewHandlerImpl.java:219)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
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 web.AuthorizationFilter.doFilter(AuthorizationFilter.java:80)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
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:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
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:423)
at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:188)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2476)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2465)
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)
web.bean.ReportListBean.java
39 public List getReports()
40 {
41 List<JasperReportInfo> reports = new ArrayList<JasperReportInfo>();
42 ValueBinding visitBinding = FacesContext.getCurrentInstance().getApplication().createValueBinding("#{"+Constants.VISIT_KEY_SCOPE+Constants.VISIT_KEY+"}");
43
44 try
45 {
46 JasperReportService service = new JasperReportServiceImpl(PropertiesManager.load("jasper.properties"), securityCode);
47 reports = service.getReports("/organization/reports");
48 } catch (WSException e) {
49 log.error("Exception thrown while calling web service.",e);
50 } catch (InvalidPropertiesFormatException e) {
51 log.error("Exception thrown while instantiating web service.",e);
52 }
53 return reports;
54 }
jasper.JasperReportServiceImpl.java
#SuppressWarnings("unchecked")
72 public List<JasperReportInfo> getReports(String folder) throws WSException
73 {
74 List<JasperReportInfo> reports = new ArrayList<JasperReportInfo>();
75
76 List<ResourceDescriptor> results = wsclient.list(folder);
.
80 for(ResourceDescriptor descriptor : results)
81 {
82 JasperReportInfo info = new JasperReportInfo();
83 info.setName(descriptor.getLabel());
84 info.setUri(descriptor.getUriString());
85 info.setParentFolder(descriptor.getParentFolder());
86 info.setDescription(descriptor.getDescription());
87 info.setControls(new ArrayList<InputControl>());
.
93 ResourceDescriptor reportUnit = wsclient.get(descriptor.getUriString());
94 List<ResourceDescriptor> children = reportUnit.getChildren();
...
}
return reports;
}
jasper.wsclient.JasperServerWSClient.java
58 public ResourceDescriptor get(String uri, List args) throws WSException{
59 ResourceDescriptor descriptor = new ResourceDescriptor();
60 descriptor.setWsType(ResourceDescriptor.TYPE_REPORTUNIT);
61 descriptor.setUriString(uri);
62 try {
63 return server.getWSClient().get(descriptor, null, args);
64 } catch (Exception e) {
65 throw new WSException("Exception called during list.", e.getCause());
66 }
67 }
.
94 public ResourceDescriptor get(String uri) throws WSException{
95 return get(uri, null);
96 }
This is all I see in web.xml:
<servlet>
<servlet-name>Report Servlet</servlet-name>
<servlet-class>web.servlet.ReportServlet</servlet-class>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Report Servlet</servlet-name>
<url-pattern>/servlet/report</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
Does anyone know where I can configure this property?
I'm in code of a project. I got a error when I try to convert a object RRREC type into RR_REC type.
The RRREC class:
public class RRREC{
protected String owner;
protected RRINFRATYPE infraType;
// getter and setter
}
The RR_REC class:
public class RR_REC{
protected String localOwner;
protected RR_INFRA_TYPE localInfraType;
// getter and setter
}
The RRINFRATYPE class:
public enum RRINFRATYPE {
V_6_ADDRESS("V6ADDRESS"),
OBJECT("OBJECT"),
ZONE("ZONE"),
V_4_REVERSEZONE("V4REVERSEZONE"),
V_6_REVERSEZONE("V6REVERSEZONE"),
NODE("NODE"),
ALL("ALL");
private final String value;
RRINFRATYPE(String v) {
value = v;
}
public String value() {
return value;
}
public static RRINFRATYPE fromValue(String v) {
for (RRINFRATYPE c: RRINFRATYPE.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}
And the RR_INFRA_TYPE:
public class RR_INFRA_TYPE{
protected String localRR_INFRA_TYPE;
private static java.util.HashMap _table_ = new java.util.HashMap();
// Constructor
protected RR_INFRA_TYPE(String value, boolean isRegisterValue) {
localRR_INFRA_TYPE = value;
if (isRegisterValue) {
_table_.put(localRR_INFRA_TYPE, this);
}
}
When I debug code
// getMapper will return DozerBeanMapper object
// and request is a RRREC object
getMapper().map(request, RR_REC.class);
I got a error, below is stack trace
Nov 17, 2015 2:46:44 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [RESTfulServlet] in context with path [] threw exception [Request processing failed; nested exception is org.dozer.MappingException: java.lang.NoSuchMethodException: com.qip.nb.ws.RR_INFRA_TYPE.<init>()] with root cause
java.lang.NoSuchMethodException: com.qip.nb.ws.RR_INFRA_TYPE.<init>()
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getDeclaredConstructor(Unknown Source)
at org.dozer.factory.ConstructionStrategies$ByConstructor.newInstance(ConstructionStrategies.java:257)
at org.dozer.factory.ConstructionStrategies$ByConstructor.create(ConstructionStrategies.java:245)
at org.dozer.factory.DestBeanCreator.create(DestBeanCreator.java:65)
at org.dozer.MappingProcessor.mapCustomObject(MappingProcessor.java:477)
at org.dozer.MappingProcessor.mapOrRecurseObject(MappingProcessor.java:434)
at org.dozer.MappingProcessor.mapFromFieldMap(MappingProcessor.java:330)
at org.dozer.MappingProcessor.mapField(MappingProcessor.java:276)
at org.dozer.MappingProcessor.map(MappingProcessor.java:245)
at org.dozer.MappingProcessor.map(MappingProcessor.java:187)
at org.dozer.MappingProcessor.map(MappingProcessor.java:124)
at org.dozer.MappingProcessor.map(MappingProcessor.java:119)
at org.dozer.DozerBeanMapper.map(DozerBeanMapper.java:111)
at com.qip.nb.ws.restful.controller.RRController.buildSOAPRequest(RRController.java:488)
at com.qip.nb.ws.restful.controller.RRController.getRRs(RRController.java:374)
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.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
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.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:151)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at com.qip.nb.ws.restful.security.AuthenticationTokenProcessingFilter.doFilter(AuthenticationTokenProcessingFilter.java:52)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
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:503)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
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.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
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)
Dozer normally expects a default constructor. Your class RR_INFRA_TYPE doesn't have one as you defined a constructor other than the default constructor.
To tell dozer how to instanciate your target class you have to implement a custom bean factory. There you can initialize all parameters needed for your RR_INFRA_TYPE object and this instance will be further processed/filled by dozer then.
More Info here:
http://dozer.sourceforge.net/documentation/custombeanfactories.html
I got the same error using Dozer with an inner class written for a JUnit test. Nothing I tried would make this error go away (Lombok #NoArgConstructor, explicit default constructor, fully qualified class names, accessor levels, etc).
Only thing that fixed it was moving the inner classes to their own explicit Class files. That resolved the problem immediately despite any combination of the previous changes.
So if you find yourself in the same situation and all else fails, you can fall back on that.