3 Replies Latest reply on Nov 30, 2011 12:04 PM by 774423

    EE5 web-app classloading

    774423
      Hi Guys,

      I'm facing a strange problem, I've an EAR which is EE5 standard. In this ear I've a WAR file that is giving me some trouble. I just want to know what is the difference in classloading if web.xml has following web-app element declaration:

      <web-app xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
      version="2.5">

      If I have above in my web.xml, then application does not deploy giving some problem with classloading. However, if I have following declaration,

      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
      <web-app>

      Then application deploys happily.. no problem at all... So I'm sure that it has something to do with the classloading is for processing web-app_2_5.xsd & web-app_2_3.dtd. Can anyone please guess anything? I'm using weblogic 10.3.3.

      Thank you,
      Prasad
        • 1. Re: EE5 web-app classloading
          Steve Button-Oracle
          Can you post more about the problems you are seeing?

          Perhaps there is another problem at the core?

          -steve-
          • 2. Re: EE5 web-app classloading
            774423
            Thanks Steve for reply, sorry I was busy with few other things so couldn't concentrate on this one..

            The problem that I'm facing is, I have my ear in which I've added a WAR which uses spring deployment of webservices by Apache CXF. In that WAR if my web.xml has web-app element defined as
            +<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">+

            then weblogic fails to deploy my ear giving following error,

            +30-Nov-2011 11:06:07 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass+
            +INFO: Creating Service {http://wsapi.api.client.caseware.banctec.com/}WSAPIService from class com.banctec.caseware.client.api.wsapi.WSAPIService+
            +30-Nov-2011 11:06:09 org.apache.cxf.endpoint.ServerImpl initDestination+
            INFO: Setting the server's publish address to be /WSAPI
            +30-Nov-2011 11:06:09 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass+
            +INFO: Creating Service {http://wsapi.api.client.caseware.banctec.com/}WSListAPIService from class com.banctec.caseware.client.api.wsapi.WSListAPIService+
            +30-Nov-2011 11:06:09 org.apache.cxf.endpoint.ServerImpl initDestination+
            INFO: Setting the server's publish address to be /WSListAPI
            +30-Nov-2011 11:06:09 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass+
            +INFO: Creating Service {http://wsapi.api.client.caseware.banctec.com/}WSFreeTextListAPIService from class com.banctec.caseware.client.api.wsapi.WSFreeTextListAPIService+
            +30-Nov-2011 11:06:10 org.apache.cxf.endpoint.ServerImpl initDestination+
            INFO: Setting the server's publish address to be /WSFreeTextListAPI
            +<30-Nov-2011 11:06:10 o'clock GMT> <Error> <HTTP> <BEA-101216> <Servlet: "com.banctec.caseware.client.api.wsapi.WSAPIServiceImpl" failed to preload on startup in Web application: "webservice".+
            javax.xml.ws.WebServiceException: Unable to create JAXBContext
            +     at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:164)+
            +     at com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:94)+
            +     at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:265)+
            +     at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:363)+
            +     at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:202)+
            +     Truncated. see log file for complete stacktrace+

            Caused By: java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
            java.lang.StackTraceElement does not have a no-arg default constructor.
            +     this problem is related to the following location:+
            +          at java.lang.StackTraceElement+
            +          at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace()+
            +          at java.lang.Throwable+
            +          at public java.lang.Throwable com.banctec.caseware.client.api.wsapi.jaxws.CaseWareExceptionBean.nestedException+
            +          at com.banctec.caseware.client.api.wsapi.jaxws.CaseWareExceptionBean+
            java.util.Locale does not have a no-arg default constructor.
            +     this problem is related to the following location:+
            +          at java.util.Locale+
            +          at public java.util.Locale com.banctec.caseware.client.api.wsapi.jaxws.Translate.arg1+
            +          at com.banctec.caseware.client.api.wsapi.jaxws.Translate+

            +     at java.security.AccessController.doPrivileged(Native Method)+
            +     at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:151)+
            +     at com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:94)+
            +     at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:265)+
            +     at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:363)+
            +     Truncated. see log file for complete stacktrace+

            Caused By: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
            java.lang.StackTraceElement does not have a no-arg default constructor.
            +     this problem is related to the following location:+
            +          at java.lang.StackTraceElement+
            +          at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace()+
            +          at java.lang.Throwable+
            +          at public java.lang.Throwable com.banctec.caseware.client.api.wsapi.jaxws.CaseWareExceptionBean.nestedException+
            +          at com.banctec.caseware.client.api.wsapi.jaxws.CaseWareExceptionBean+
            java.util.Locale does not have a no-arg default constructor.
            +     this problem is related to the following location:+
            +          at java.util.Locale+
            +          at public java.util.Locale com.banctec.caseware.client.api.wsapi.jaxws.Translate.arg1+
            +          at com.banctec.caseware.client.api.wsapi.jaxws.Translate+

            +     at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102)+
            +     at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:448)+
            +     at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:297)+
            +     at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)+
            +     at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:105)+
            +     Truncated. see log file for complete stacktrace+


            However, if I use
            +<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">+
            +<web-app>+

            then ear deploys fine... so, my first guess is about the way weblogic handles classloading of web-app's for 2.3 & 2.5 standards is different. I have no idea where to start debugging from. But this is sure that if I set web-app element to the 2.3 standard, then it works.

            Hope, if you could help little more.

            Thanks in advance,
            Prasad
            • 3. Re: EE5 web-app classloading
              774423
              Just to let you guys know, I had to add "javax.jws_2.0.jar" to library directory of my ear & had to add javax.jws.* to prefer-application-packages element of weblogic-application.xml to solve the issue, but my question still remains.. what is the difference between 2.3 & 2.5 web-app classloading. Why it works with web-app 2.3 withouth adding above jar & entry in prefer-application-packages and not with 2.5?