Results 1 to 12 of 12
  1. #1
    Join Date
    Feb 2009
    Posts
    28
    Rep Power
    0

    Default While writing image to outputstream exception raises

    I have to display image in browser.This image is stored in database. While writing this image to outputstream following exception is occurred.

    10:20:30,122 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/nsc].[jsp]] Servlet.service() for servlet jsp threw exception: javax.persistence.PersistenceException: Invalid persistence.xml.
    Error parsing XML (line-1 : column -1): cvc-complex-type.3.2.2: Attribute 'xsi:schemalocation' is not allowed to appear in element 'persistence'.
    Error parsing XML (line-1 : column -1): cvc-complex-type.2.4.a: Invalid content was found starting with element 'provider'. One of '{"http://java.sun.com/xml/ns/persistence":non-jta-data-source, "http://java.sun.com/xml/ns/persistence":mapping-file, "http://java.sun.com/xml/ns/persistence":jar-file, "http://java.sun.com/xml/ns/persistence":class, "http://java.sun.com/xml/ns/persistence":exclude-unlisted-classes, "http://java.sun.com/xml/ns/persistence"

    Caused by: java.net.SocketException: Connection reset by peer: socket write error

    Java Code:
      public void showImage(HttpServletRequest request,HttpServletResponse response){
    try{
    
    OutputStream outStream = response.getOutputStream();
    String PERSISTENCE_UNIT_NAME = "mpower1";
    response.setHeader("Cache-Control", "no-cache");
    response.setHeader("pragma","no-cache");
    EntityManagerFactory entityManagerFactory= Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);
    EntityManager entityManager = entityManagerFactory.createEntityManager();
    
    String regId = request.getParameter("id");
    String consId = request.getParameter("consid");
    System.out.println("RegId " + regId + " ConsID " + consId);
    Query query = null;
    
    if(regId!=null && regId.length()>0) 
       query = entityManager.createQuery("FROM ImageRegTVO where registrationId='"+regId+"'");
    else
       query = entityManager.createQuery("FROM ImageRegTVO where consumerId='"+consId+"' order by createDate desc");
    
    System.out.println(":::: Query :::" + query);
    
    if(query.getResultList().size()>0)
    {
    ImageRegTVO imageRegTVO =(ImageRegTVO)query.getResultList().get(0);
    System.out.println("imageRegTVO.get(0)==="+imageRegTVO.getId());
    
    	byte[] bytearray = imageRegTVO.getApplicantImg();
    	System.out.println("Size >0 ");
    	response.setContentLength(bytearray.length);	
    	outStream.write(bytearray, 0, bytearray.length);	
    }
    
    outStream.flush();
    outStream.close();
    
    return;
    }catch(IOException e){e.printStackTrace();
    
    }
    }
    outStream.write() raises this exception.

    thanks in advance

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,817
    Rep Power
    19

    Default Re: While writing image to outputstream exception raises

    Can you show us the stack trace and all root causes?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    Join Date
    Feb 2009
    Posts
    28
    Rep Power
    0

    Default Re: While writing image to outputstream exception raises

    15:10:27,762 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/nsc].[jsp]] Servlet.service() for servlet jsp threw exception: javax.persistence.PersistenceException: Invalid persistence.xml.
    Error parsing XML (line-1 : column -1): cvc-complex-type.3.2.2: Attribute 'xsi:schemalocation' is not allowed to appear in element 'persistence'.
    Error parsing XML (line-1 : column -1): cvc-complex-type.2.4.a: Invalid content was found starting with element 'provider'. One of '{"http://java.sun.com/xml/ns/persistence":non-jta-data-source, "http://java.sun.com/xml/ns/persistence":mapping-file, "http://java.sun.com/xml/ns/persistence":jar-file, "http://java.sun.com/xml/ns/persistence":class, "http://java.sun.com/xml/ns/persistence":exclude-unlisted-classes, "http://java.sun.com/xml/ns/persistence":shared-cache-mode, "http://java.sun.com/xml/ns/persistence":validation-mode, "http://java.sun.com/xml/ns/persistence":properties}' is expected.

    at org.hibernate.ejb.packaging.PersistenceXmlLoader.l oadURL(PersistenceXmlLoader.java:145) [:3.6.4.Final]
    at org.hibernate.ejb.packaging.PersistenceXmlLoader.d eploy(PersistenceXmlLoader.java:169) [:3.6.4.Final]
    at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3 Configuration.java:317) [:3.6.4.Final]
    at org.hibernate.ejb.HibernatePersistence.createEntit yManagerFactory(HibernatePersistence.java:56) [:3.6.4.Final]
    at javax.persistence.Persistence.createEntityManagerF actory(Persistence.java:48) [:1.0.0.Final]
    at javax.persistence.Persistence.createEntityManagerF actory(Persistence.java:32) [:1.0.0.Final]
    at org.apache.jsp.WEB_002dINF.jsp.ShowSignature_jsp._ jspService(ShowSignature_jsp.java:75)
    at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70) [:6.1.0.Final]
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:847) [:1.0.0.Final]
    at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:369) [:6.1.0.Final]
    at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:326) [:6.1.0.Final]
    at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:253) [:6.1.0.Final]
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:847) [:1.0.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:324) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:242) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationDispatcher.inv oke(ApplicationDispatcher.java:734) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationDispatcher.pro cessRequest(ApplicationDispatcher.java:541) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationDispatcher.doF orward(ApplicationDispatcher.java:479) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationDispatcher.for ward(ApplicationDispatcher.java:407) [:6.1.0.Final]
    at org.springframework.web.servlet.view.InternalResou rceView.renderMergedOutputModel(InternalResourceVi ew.java:238) [:3.0.5.RELEASE]
    at org.springframework.web.servlet.view.AbstractView. render(AbstractView.java:250) [:3.0.5.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet. render(DispatcherServlet.java:1047) [:3.0.5.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:817) [:3.0.5.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:719) [:3.0.5.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:644) [:3.0.5.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:549) [:3.0.5.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:734) [:1.0.0.Final]
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:847) [:1.0.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:324) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:242) [:6.1.0.Final]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 343) [:]
    at org.springframework.security.web.access.intercept. FilterSecurityInterceptor.invoke(FilterSecurityInt erceptor.java:109) [:]
    at org.springframework.security.web.access.intercept. FilterSecurityInterceptor.doFilter(FilterSecurityI nterceptor.java:83) [:]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 355) [:]
    at org.springframework.security.web.access.ExceptionT ranslationFilter.doFilter(ExceptionTranslationFilt er.java:97) [:]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 355) [:]
    at org.springframework.security.web.servletapi.Securi tyContextHolderAwareRequestFilter.doFilter(Securit yContextHolderAwareRequestFilter.java:54) [:]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 355) [:]
    at org.springframework.security.web.authentication.An onymousAuthenticationFilter.doFilter(AnonymousAuth enticationFilter.java:78) [:]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 355) [:]
    at org.springframework.security.web.authentication.Ab stractAuthenticationProcessingFilter.doFilter(Abst ractAuthenticationProcessingFilter.java:187) [:]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 355) [:]
    at org.springframework.security.web.authentication.http://www.BasicAuthenticationFilter...lter.java:177) [:]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 355) [:]
    at org.springframework.security.web.authentication.Ab stractAuthenticationProcessingFilter.doFilter(Abst ractAuthenticationProcessingFilter.java:187) [:]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 355) [:]
    at org.springframework.security.web.authentication.Ab stractAuthenticationProcessingFilter.doFilter(Abst ractAuthenticationProcessingFilter.java:187) [:]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 355) [:]
    at org.springframework.security.web.authentication.lo gout.LogoutFilter.doFilter(LogoutFilter.java:105) [:]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 355) [:]
    at org.springframework.security.web.context.SecurityC ontextPersistenceFilter.doFilter(SecurityContextPe rsistenceFilter.java:57) [:]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 355) [:]
    at org.springframework.security.web.context.SecurityC ontextPersistenceFilter.doFilter(SecurityContextPe rsistenceFilter.java:79) [:]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 355) [:]
    at org.springframework.security.web.FilterChainProxy. doFilter(FilterChainProxy.java:149) [:]
    at org.springframework.web.filter.DelegatingFilterPro xy.invokeDelegate(DelegatingFilterProxy.java:237) [:3.0.5.RELEASE]
    at org.springframework.web.filter.DelegatingFilterPro xy.doFilter(DelegatingFilterProxy.java:167) [:3.0.5.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:274) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:242) [:6.1.0.Final]
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:275) [:6.1.0.Final]
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:161) [:6.1.0.Final]
    at org.jboss.web.tomcat.security.SecurityAssociationV alve.invoke(SecurityAssociationValve.java:181) [:6.1.0.Final]
    at org.jboss.modcluster.catalina.CatalinaContext$Requ estListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
    at org.jboss.modcluster.catalina.CatalinaContext$Requ estListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
    at org.jboss.web.tomcat.security.JaccContextValve.inv oke(JaccContextValve.java:88) [:6.1.0.Final]
    at org.jboss.web.tomcat.security.SecurityContextEstab lishmentValve.invoke(SecurityContextEstablishmentV alve.java:100) [:6.1.0.Final]
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:159) [:6.1.0.Final]
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102) [:6.1.0.Final]
    at org.jboss.web.tomcat.service.jca.CachedConnectionV alve.invoke(CachedConnectionValve.java:158) [:6.1.0.Final]
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109) [:6.1.0.Final]
    at org.jboss.web.tomcat.service.request.ActiveRequest ResponseCacheValve.invoke(ActiveRequestResponseCac heValve.java:53) [:6.1.0.Final]
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:362) [:6.1.0.Final]
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:877) [:6.1.0.Final]
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:654) [:6.1.0.Final]
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:951) [:6.1.0.Final]
    at java.lang.Thread.run(Unknown Source) [:1.6.0_22]

    15:10:27,763 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/nsc].[mpower]] Servlet.service() for servlet mpower threw exception: javax.persistence.PersistenceException: Invalid persistence.xml.
    Error parsing XML (line-1 : column -1): cvc-complex-type.3.2.2: Attribute 'xsi:schemalocation' is not allowed to appear in element 'persistence'.
    Error parsing XML (line-1 : column -1): cvc-complex-type.2.4.a: Invalid content was found starting with element 'provider'. One of '{"http://java.sun.com/xml/ns/persistence":non-jta-data-source, "http://java.sun.com/xml/ns/persistence":mapping-file, "http://java.sun.com/xml/ns/persistence":jar-file, "http://java.sun.com/xml/ns/persistence":class, "http://java.sun.com/xml/ns/persistence":exclude-unlisted-classes, "http://java.sun.com/xml/ns/persistence":shared-cache-mode, "http://java.sun.com/xml/ns/persistence":validation-mode, "http://java.sun.com/xml/ns/persistence":properties}' is expected.

    at org.hibernate.ejb.packaging.PersistenceXmlLoader.l oadURL(PersistenceXmlLoader.java:145) [:3.6.4.Final]
    at org.hibernate.ejb.packaging.PersistenceXmlLoader.d eploy(PersistenceXmlLoader.java:169) [:3.6.4.Final]
    at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3 Configuration.java:317) [:3.6.4.Final]
    at org.hibernate.ejb.HibernatePersistence.createEntit yManagerFactory(HibernatePersistence.java:56) [:3.6.4.Final]
    at javax.persistence.Persistence.createEntityManagerF actory(Persistence.java:48) [:1.0.0.Final]
    at javax.persistence.Persistence.createEntityManagerF actory(Persistence.java:32) [:1.0.0.Final]
    at org.apache.jsp.WEB_002dINF.jsp.ShowSignature_jsp._ jspService(ShowSignature_jsp.java:75)
    at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70) [:6.1.0.Final]
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:847) [:1.0.0.Final]
    at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:369) [:6.1.0.Final]
    at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:326) [:6.1.0.Final]
    at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:253) [:6.1.0.Final]
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:847) [:1.0.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:324) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:242) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationDispatcher.inv oke(ApplicationDispatcher.java:734) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationDispatcher.pro cessRequest(ApplicationDispatcher.java:541) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationDispatcher.doF orward(ApplicationDispatcher.java:479) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationDispatcher.for ward(ApplicationDispatcher.java:407) [:6.1.0.Final]
    at org.springframework.web.servlet.view.InternalResou rceView.renderMergedOutputModel(InternalResourceVi ew.java:238) [:3.0.5.RELEASE]
    at org.springframework.web.servlet.view.AbstractView. render(AbstractView.java:250) [:3.0.5.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet. render(DispatcherServlet.java:1047) [:3.0.5.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:817) [:3.0.5.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:719) [:3.0.5.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:644) [:3.0.5.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:549) [:3.0.5.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:734) [:1.0.0.Final]
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:847) [:1.0.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:324) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:242) [:6.1.0.Final]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 343) [:]
    at org.springframework.security.web.access.intercept. FilterSecurityInterceptor.invoke(FilterSecurityInt erceptor.java:109) [:]
    at org.springframework.security.web.access.intercept. FilterSecurityInterceptor.doFilter(FilterSecurityI nterceptor.java:83) [:]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 355) [:]
    at org.springframework.security.web.access.ExceptionT ranslationFilter.doFilter(ExceptionTranslationFilt er.java:97) [:]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 355) [:]
    at org.springframework.security.web.servletapi.Securi tyContextHolderAwareRequestFilter.doFilter(Securit yContextHolderAwareRequestFilter.java:54) [:]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 355) [:]
    at org.springframework.security.web.authentication.An onymousAuthenticationFilter.doFilter(AnonymousAuth enticationFilter.java:78) [:]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 355) [:]
    at org.springframework.security.web.authentication.Ab stractAuthenticationProcessingFilter.doFilter(Abst ractAuthenticationProcessingFilter.java:187) [:]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 355) [:]
    at org.springframework.security.web.authentication.http://www.BasicAuthenticationFilter...lter.java:177) [:]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 355) [:]
    at org.springframework.security.web.authentication.Ab stractAuthenticationProcessingFilter.doFilter(Abst ractAuthenticationProcessingFilter.java:187) [:]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 355) [:]
    at org.springframework.security.web.authentication.Ab stractAuthenticationProcessingFilter.doFilter(Abst ractAuthenticationProcessingFilter.java:187) [:]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 355) [:]
    at org.springframework.security.web.authentication.lo gout.LogoutFilter.doFilter(LogoutFilter.java:105) [:]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 355) [:]
    at org.springframework.security.web.context.SecurityC ontextPersistenceFilter.doFilter(SecurityContextPe rsistenceFilter.java:57) [:]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 355) [:]
    at org.springframework.security.web.context.SecurityC ontextPersistenceFilter.doFilter(SecurityContextPe rsistenceFilter.java:79) [:]
    at org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 355) [:]
    at org.springframework.security.web.FilterChainProxy. doFilter(FilterChainProxy.java:149) [:]
    at org.springframework.web.filter.DelegatingFilterPro xy.invokeDelegate(DelegatingFilterProxy.java:237) [:3.0.5.RELEASE]
    at org.springframework.web.filter.DelegatingFilterPro xy.doFilter(DelegatingFilterProxy.java:167) [:3.0.5.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:274) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:242) [:6.1.0.Final]
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:275) [:6.1.0.Final]
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:161) [:6.1.0.Final]
    at org.jboss.web.tomcat.security.SecurityAssociationV alve.invoke(SecurityAssociationValve.java:181) [:6.1.0.Final]
    at org.jboss.modcluster.catalina.CatalinaContext$Requ estListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
    at org.jboss.modcluster.catalina.CatalinaContext$Requ estListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
    at org.jboss.web.tomcat.security.JaccContextValve.inv oke(JaccContextValve.java:88) [:6.1.0.Final]
    at org.jboss.web.tomcat.security.SecurityContextEstab lishmentValve.invoke(SecurityContextEstablishmentV alve.java:100) [:6.1.0.Final]
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:159) [:6.1.0.Final]
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102) [:6.1.0.Final]
    at org.jboss.web.tomcat.service.jca.CachedConnectionV alve.invoke(CachedConnectionValve.java:158) [:6.1.0.Final]
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109) [:6.1.0.Final]
    at org.jboss.web.tomcat.service.request.ActiveRequest ResponseCacheValve.invoke(ActiveRequestResponseCac heValve.java:53) [:6.1.0.Final]
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:362) [:6.1.0.Final]
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:877) [:6.1.0.Final]
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:654) [:6.1.0.Final]
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:951) [:6.1.0.Final]
    at java.lang.Thread.run(Unknown Source) [:1.6.0_22]

    15:10:27,763 INFO [STDOUT] ::::::::::::::::::: UN CAUGHT PAGE ERROR :::::::::::::::::::::::::::::::

    15:10:27,763 WARN [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]] Exception Processing ErrorPage[exceptionType=java.lang.Exception, location=/WEB-INF/jsp/Error.jsp]: ClientAbortException: java.net.SocketException: Connection reset by peer: socket write error
    at org.apache.catalina.connector.OutputBuffer.realWri teBytes(OutputBuffer.java:402) [:6.1.0.Final]
    at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(B yteChunk.java:449) [:6.1.0.Final]
    at org.apache.catalina.connector.OutputBuffer.realWri teChars(OutputBuffer.java:468) [:6.1.0.Final]
    at org.apache.tomcat.util.buf.CharChunk.flushBuffer(C harChunk.java:469) [:6.1.0.Final]
    at org.apache.catalina.connector.OutputBuffer.doFlush (OutputBuffer.java:338) [:6.1.0.Final]
    at org.apache.catalina.connector.OutputBuffer.flush(O utputBuffer.java:315) [:6.1.0.Final]
    at org.apache.catalina.connector.Response.flushBuffer (Response.java:536) [:6.1.0.Final]
    at org.apache.catalina.core.StandardHostValve.throwab le(StandardHostValve.java:385) [:6.1.0.Final]
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:194) [:6.1.0.Final]
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102) [:6.1.0.Final]
    at org.jboss.web.tomcat.service.jca.CachedConnectionV alve.invoke(CachedConnectionValve.java:158) [:6.1.0.Final]
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109) [:6.1.0.Final]
    at org.jboss.web.tomcat.service.request.ActiveRequest ResponseCacheValve.invoke(ActiveRequestResponseCac heValve.java:53) [:6.1.0.Final]
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:362) [:6.1.0.Final]
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:877) [:6.1.0.Final]
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:654) [:6.1.0.Final]
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:951) [:6.1.0.Final]
    at java.lang.Thread.run(Unknown Source) [:1.6.0_22]
    Caused by: java.net.SocketException: Connection reset by peer: socket write error
    at java.net.SocketOutputStream.socketWrite0(Native Method) [:1.6.0_22]
    at java.net.SocketOutputStream.socketWrite(Unknown Source) [:1.6.0_22]
    at java.net.SocketOutputStream.write(Unknown Source) [:1.6.0_22]
    at org.apache.coyote.http11.InternalOutputBuffer.real WriteBytes(InternalOutputBuffer.java:726) [:6.1.0.Final]
    at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(B yteChunk.java:449) [:6.1.0.Final]
    at org.apache.tomcat.util.buf.ByteChunk.append(ByteCh unk.java:349) [:6.1.0.Final]
    at org.apache.coyote.http11.InternalOutputBuffer$Outp utStreamOutputBuffer.doWrite(InternalOutputBuffer. java:750) [:6.1.0.Final]
    at org.apache.coyote.http11.filters.ChunkedOutputFilt er.doWrite(ChunkedOutputFilter.java:124) [:6.1.0.Final]
    at org.apache.coyote.http11.InternalOutputBuffer.doWr ite(InternalOutputBuffer.java:559) [:6.1.0.Final]
    at org.apache.coyote.Response.doWrite(Response.java:5 67) [:6.1.0.Final]
    at org.apache.catalina.connector.OutputBuffer.realWri teBytes(OutputBuffer.java:397) [:6.1.0.Final]
    ... 17 more

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,817
    Rep Power
    19

    Default Re: While writing image to outputstream exception raises

    That's several different exceptions there.
    The first one (the invalid persistence.xml) is thrown from a JSP page of yours:
    at org.apache.jsp.WEB_002dINF.jsp.ShowSignature_jsp._ jspService(ShowSignature_jsp.java:75)

    The next one is the same problem.

    The last one is an attempt to go to the Error.jsp, except since the above exceptions were thrown from a JSP that is not actually possible...hence the socket closed.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    Join Date
    Feb 2009
    Posts
    28
    Rep Power
    0

    Default Re: While writing image to outputstream exception raises

    persistence.xml is working fine.But I can't understand why it is showing...How to resolve this issue

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,817
    Rep Power
    19

    Default Re: While writing image to outputstream exception raises

    Something in that JSP involves creating a persistent entity.
    That's probably not the sort of thing you should be doing in a JSP in the first place.

    That aside, I cannot see your xml, I cannot see the JSP that this is being thrown from.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    Join Date
    Feb 2009
    Posts
    28
    Rep Power
    0

    Default Re: While writing image to outputstream exception raises

    Java Code:
    JSP:
    <%
    showImage(request,response);
    %>
    
    <%!
    public void showImage(HttpServletRequest request,HttpServletResponse response){
    try{
    
    OutputStream outStream = response.getOutputStream();
    String PERSISTENCE_UNIT_NAME = "mpower1";
    response.setHeader("Cache-Control", "no-cache");
    response.setHeader("pragma","no-cache");
    EntityManagerFactory entityManagerFactory= Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);
    EntityManager entityManager = entityManagerFactory.createEntityManager();
    //System.out.println("The value of entityManager:::"+entityManager);
    String regId = request.getParameter("id");
    String consId = request.getParameter("consid");
    System.out.println("RegId " + regId + " ConsID " + consId);
    Query query = null;
    
    if(regId!=null && regId.length()>0) 
       query = entityManager.createQuery("FROM ImageRegTVO where registrationId='"+regId+"'");
    else
       query = entityManager.createQuery("FROM ImageRegTVO where consumerId='"+consId+"' order by createDate desc");
    
    System.out.println(":::: Query :::" + query);
    
    if(query.getResultList().size()>0)
    {
    ImageRegTVO imageRegTVO =(ImageRegTVO)query.getResultList().get(0);
    System.out.println("imageRegTVO.get(0)==="+imageRegTVO.getId());
    
    	byte[] bytearray = imageRegTVO.getApplicantImg();
    	System.out.println("Size >0 ");
    	response.setContentLength(bytearray.length);	
    	outStream.write(bytearray, 0, bytearray.length);	
    }
    
    outStream.flush();
    outStream.close();
    
    return;
    }catch(IOException e){e.printStackTrace();
    
    }
    }
    %>
    persistence.xml
    Java Code:
    <persistence-unit name="mpower1"   transaction-type="JTA">
    		 <jta-data-source>java:/NscDB</jta-data-source>
    			<provider>org.hibernate.ejb.HibernatePersistence</provider>
    			<jar-file>/WEB-INF/lib/basefrmwrk_1_5.jar</jar-file>
    			<!-- 	<jar-file>/WEB-INF/lib/rbac.jar</jar-file>  -->
    			<jar-file>/WEB-INF/lib/rbac-1.2.0.jar</jar-file>
                <class>com.phoenix.rbac.vo.RbacObjectMVO</class>
                <class>com.phoenix.rbac.vo.RbacObjectTypeMVO</class>
                <class>com.phoenix.rbac.vo.RbacResourceMVO</class>
                <class>com.phoenix.rbac.vo.RbacResourcePermissionVO</class>
                <class>com.phoenix.rbac.vo.RbacResourceRoleTVO</class>
                <class>com.phoenix.rbac.vo.RbacRoleMVO</class>
                <class>com.phoenix.rbac.vo.RbacUserRoleVO</class>
    			
    			<properties>
    			<!--<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>-->
    			 <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
    			<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
    			<!--  <property name="hibernate.hbm2ddl.auto" value="create"/>   -->
    			<property name="jboss.entity.manager.factory.jndi.name" value="java:/mpower2"/>
    			 <property name="jboss.entity.manager.jndi.name" value="java:/NscDB"/>  
    			<property name="hibernate.show_sql" value="false"/>
    			<property name="hibernate.database" value="ORACLE"/>
    			<property name="hibernate.format_sql" value="false"/> 
    			<property name="hibernate.validator.apply_to_ddl" value="false" />
    			<property name="hibernate.validator.autoregister_listeners" value="false"/>
    			<property name="hibernate.validator.apply_to_ddl" value="false" />
    			<!-- <property name="hibernate.validator.autoregister_listeners" value="false"/> -->
    			<property name="hibernate.archive.autodetection" value="class"/> 
    		</properties>
       </persistence-unit>

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,817
    Rep Power
    19

    Default Re: While writing image to outputstream exception raises

    That really should not be in a JSP page.
    That's a servlet thing.

    As for the xml, where is the <persistence> tag?
    That's the one it's complaining about.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  9. #9
    Join Date
    Feb 2009
    Posts
    28
    Rep Power
    0

    Default Re: While writing image to outputstream exception raises

    my persistence.xml is like this.I didn't copy fully previously..It is working fine.
    Java Code:
    <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
                 
      <persistence-unit name="mpower1"   transaction-type="JTA">
    		 <jta-data-source>java:/NscDB</jta-data-source>
    			<provider>org.hibernate.ejb.HibernatePersistence</provider>
    			<jar-file>/WEB-INF/lib/basefrmwrk_1_5.jar</jar-file>
    			<!-- 	<jar-file>/WEB-INF/lib/rbac.jar</jar-file>  -->
    			<jar-file>/WEB-INF/lib/rbac-1.2.0.jar</jar-file>
                <class>com.phoenix.rbac.vo.RbacObjectMVO</class>
                <class>com.phoenix.rbac.vo.RbacObjectTypeMVO</class>
                <class>com.phoenix.rbac.vo.RbacResourceMVO</class>
                <class>com.phoenix.rbac.vo.RbacResourcePermissionVO</class>
                <class>com.phoenix.rbac.vo.RbacResourceRoleTVO</class>
                <class>com.phoenix.rbac.vo.RbacRoleMVO</class>
                <class>com.phoenix.rbac.vo.RbacUserRoleVO</class>
    			
    			<properties>
    			<!--<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>-->
    			 <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
    			<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
    			<!--  <property name="hibernate.hbm2ddl.auto" value="create"/>   -->
    			<property name="jboss.entity.manager.factory.jndi.name" value="java:/mpower2"/>
    			 <property name="jboss.entity.manager.jndi.name" value="java:/NscDB"/>  
    			<property name="hibernate.show_sql" value="false"/>
    			<property name="hibernate.database" value="ORACLE"/>
    			<property name="hibernate.format_sql" value="false"/> 
    			<property name="hibernate.validator.apply_to_ddl" value="false" />
    			<property name="hibernate.validator.autoregister_listeners" value="false"/>
    			<property name="hibernate.validator.apply_to_ddl" value="false" />
    			<!-- <property name="hibernate.validator.autoregister_listeners" value="false"/> -->
    			<property name="hibernate.archive.autodetection" value="class"/> 
    		</properties>
       </persistence-unit>
       
    </persistence>

  10. #10
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,817
    Rep Power
    19

    Default Re: While writing image to outputstream exception raises

    Quote Originally Posted by srinivasmallabathula View Post
    my persistence.xml is like this.I didn't copy fully previously..It is working fine.
    Java Code:
    <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemalocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
    ...
    </persistence>
    Well, not according to the exception:
    Attribute 'xsi:schemalocation' is not allowed to appear in element 'persistence'.
    That should be an uppercase 'L' on location.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  11. #11
    Join Date
    Feb 2009
    Posts
    28
    Rep Power
    0

    Default Re: While writing image to outputstream exception raises

    I replaced with
    xsi:schemaLocation(uppercase L). But now deployment is failed due to following exception.
    Java Code:
    18:13:25,241 ERROR [AbstractKernelController] Error installing to Parse: name=vfs:///E:/jboss-6.1.0.Final/server/default/deploy/tangedco.ear state=PreParse mode=Manual requiredState=Parse: org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfs:///E:/jboss-6.1.0.Final/server/default/deploy/tangedco.ear/nsc.war/
    	at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49) [:2.2.2.GA]
    	at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:383) [:2.2.2.GA]
    	at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:343) [:2.2.2.GA]
    	at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:315) [:2.2.2.GA]
    	at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.deploy(AbstractParsingDeployerWithOutput.java:255) [:2.2.2.GA]
    	at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.2.GA]
    	at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) [:2.2.2.GA]
    	at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) [:2.2.2.GA]
    	at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1603) [:2.2.2.GA]
    	at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) [:2.2.2.GA]
    	at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.SP2]
    	at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.SP2]
    	at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.SP2]
    	at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.SP2]
    	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.SP2]
    	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.SP2]
    	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.SP2]
    	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.SP2]
    	at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.2.GA]
    	at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.2.GA]
    	at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.2.GA]
    	at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.1.0.Final]
    	at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) [:0.2.2]
    	at org.jboss.profileservice.dependency.ProfileDeployAction.deploy(ProfileDeployAction.java:151) [:0.2.2]
    	at org.jboss.profileservice.dependency.ProfileDeployAction.installActionInternal(ProfileDeployAction.java:94) [:0.2.2]
    	at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.SP2]
    	at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.SP2]
    	at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.SP2]
    	at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.SP2]
    	at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.SP2]
    	at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.SP2]
    	at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.SP2]
    	at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.SP2]
    	at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.SP2]
    	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.SP2]
    	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.SP2]
    	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.SP2]
    	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.SP2]
    	at org.jboss.profileservice.dependency.ProfileActivationWrapper$BasicProfileActivation.start(ProfileActivationWrapper.java:190) [:0.2.2]
    	at org.jboss.profileservice.dependency.ProfileActivationWrapper.start(ProfileActivationWrapper.java:87) [:0.2.2]
    	at org.jboss.profileservice.dependency.ProfileActivationService.activateProfile(ProfileActivationService.java:215) [:0.2.2]
    	at org.jboss.profileservice.dependency.ProfileActivationService.activate(ProfileActivationService.java:159) [:0.2.2]
    	at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.activate(AbstractProfileServiceBootstrap.java:112) [:0.2.2]
    	at org.jboss.profileservice.resolver.BasicResolverFactory$ProfileResolverFacade.deploy(BasicResolverFactory.java:87) [:0.2.2]
    	at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.start(AbstractProfileServiceBootstrap.java:91) [:0.2.2]
    	at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:132) [:6.1.0.Final]
    	at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.1.0.Final]
    	at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6]
    	at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6]
    	at java.lang.Thread.run(Unknown Source) [:1.6.0_22]
    Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: vfs:///E:/jboss-6.1.0.Final/server/default/deploy/tangedco.ear/nsc.war/WEB-INF/classes/META-INF/persistence.xml@5,14
    	at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:224) [jbossxb.jar:2.0.3.GA]
    	at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:178) [jbossxb.jar:2.0.3.GA]
    	at org.jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:257) [jbossxb.jar:2.0.3.GA]
    	at org.jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:231) [jbossxb.jar:2.0.3.GA]
    	at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:137) [:2.2.2.GA]
    	at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:121) [:2.2.2.GA]
    	at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parseAndInit(AbstractVFSParsingDeployer.java:352) [:2.2.2.GA]
    	at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse(AbstractVFSParsingDeployer.java:317) [:2.2.2.GA]
    	at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:376) [:2.2.2.GA]
    	... 48 more
    Caused by: org.xml.sax.SAXException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'provider'. One of '{"http://java.sun.com/xml/ns/persistence":non-jta-data-source, "http://java.sun.com/xml/ns/persistence":mapping-file, "http://java.sun.com/xml/ns/persistence":jar-file, "http://java.sun.com/xml/ns/persistence":class, "http://java.sun.com/xml/ns/persistence":exclude-unlisted-classes, "http://java.sun.com/xml/ns/persistence":shared-cache-mode, "http://java.sun.com/xml/ns/persistence":validation-mode, "http://java.sun.com/xml/ns/persistence":properties}' is expected. @ vfs:///E:/jboss-6.1.0.Final/server/default/deploy/tangedco.ear/nsc.war/WEB-INF/classes/META-INF/persistence.xml[5,14]
    	at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.error(SaxJBossXBParser.java:416) [jbossxb.jar:2.0.3.GA]
    	at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) [xercesImpl.jar:6.1.0.Final]
    	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) [xercesImpl.jar:6.1.0.Final]
    	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) [xercesImpl.jar:6.1.0.Final]
    	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) [xercesImpl.jar:6.1.0.Final]
    	at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source) [xercesImpl.jar:6.1.0.Final]
    	at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source) [xercesImpl.jar:6.1.0.Final]
    	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source) [xercesImpl.jar:6.1.0.Final]
    	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source) [xercesImpl.jar:6.1.0.Final]
    	at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source) [xercesImpl.jar:6.1.0.Final]
    	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) [xercesImpl.jar:6.1.0.Final]
    	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) [xercesImpl.jar:6.1.0.Final]
    	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) [xercesImpl.jar:6.1.0.Final]
    	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) [xercesImpl.jar:6.1.0.Final]
    	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) [xercesImpl.jar:6.1.0.Final]
    	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) [xercesImpl.jar:6.1.0.Final]
    	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) [xercesImpl.jar:6.1.0.Final]
    	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) [xercesImpl.jar:6.1.0.Final]
    	at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:209) [jbossxb.jar:2.0.3.GA]
    	... 56 more

  12. #12
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,817
    Rep Power
    19

    Default Re: While writing image to outputstream exception raises

    Look at the xsd.
    <persistence-unit> contains a sequence of elements.
    A sequence is ordered.
    Yours are not in the correct order.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 0
    Last Post: 06-10-2011, 07:48 PM
  2. Writing to Socket outputStream w/o closing it
    By eyal in forum Networking
    Replies: 6
    Last Post: 05-17-2010, 04:26 PM
  3. Problems writing to an outputstream
    By higashij in forum Java Servlet
    Replies: 1
    Last Post: 09-12-2009, 07:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •