Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 42388 invoked from network); 13 Jan 2010 12:36:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Jan 2010 12:36:07 -0000 Received: (qmail 66532 invoked by uid 500); 13 Jan 2010 12:36:04 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 66451 invoked by uid 500); 13 Jan 2010 12:36:04 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 66441 invoked by uid 99); 13 Jan 2010 12:36:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jan 2010 12:36:04 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of andreas.veithen@gmail.com designates 209.85.220.215 as permitted sender) Received: from [209.85.220.215] (HELO mail-fx0-f215.google.com) (209.85.220.215) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jan 2010 12:35:57 +0000 Received: by fxm7 with SMTP id 7so1912977fxm.8 for ; Wed, 13 Jan 2010 04:35:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=uPyjBSnrGzTAeM9HdyDH4+LOGBMM2lWES1fBGnD7+Tk=; b=SLK6AbezK2akln5538fHAFFHdmCPz4ROV+NG2Ix/JUgo7U9Mk3VxtikFsfU9xG5QWF wtObvWz5+AoBn+8LLJuEVdsnQJXukCLCwKwsP0MaSGd88INy6NOQ49kx/AhcSzlDIMUB Z+kf3H2P6DNMi4Y2Vu9pLYnV5jUTrYvTkvuA0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=usYPZ8+Xla3Y7pvFcpJncYYPX5ZHdRAJ7/QPpwDVXSWEbXlh15I7FsxpvYRrML+IuT 3LPVYURzOXb73PtRz/J0hyeQ9wHH9JW8GcjXNhu3RNDT1RxyMj3+2xaYAALKoY/5HiKh jD2uAbaprmda0zI+XSCGtk0/nDDWKakR8MPJ0= MIME-Version: 1.0 Received: by 10.239.130.200 with SMTP id 8mr2108hbk.120.1263386136113; Wed, 13 Jan 2010 04:35:36 -0800 (PST) In-Reply-To: <5907C2A0ADF95448919493B9EA95D691015A8FCB@mobiexc.mobixell.com> References: <5907C2A0ADF95448919493B9EA95D691015A8FCB@mobiexc.mobixell.com> From: Andreas Veithen Date: Wed, 13 Jan 2010 13:35:16 +0100 Message-ID: Subject: Re: JAXB (2.1) and AXIS2 (1.5.1) To: axis-user@ws.apache.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable This probably means that JAXB is trying to look up ObjectFactory and jaxb.index from the wrong class loader. This may happen if the JAXB JARs are loaded by the application class loader, while the generated code is loaded from the service class loader. One solution would be to use the variant of the JAXBContext.newInstance method that takes a class loader as parameter. Andreas On Wed, Jan 13, 2010 at 13:28, Oded Onn wrote: > Hi, > > > > I am deploying a WS under tomcat 5.5 and Java JDK is 1.5.0_08. I use some > external jars that include code which was generated with JAXB 2.1 (using = Ant > XJC Task). The code is built from the xml schema without any error using = the > same JAXB libs as used in Axis2: > > jaxb-xjc-2.1.7.jar > > activation-1.1.jar > > jaxb-api-2.1.jar > > jaxb-impl-2.1.7.jar > > jsr173_api.jar > > > > When calls (client requests) to the server are made, the code try to get = a > marshaller for a class that is derived from the schema > > > > myMarshaller =3D > JAXBContext.newInstance(fromShema.class.getPackage().getName()).createMar= shaller(); > > > > Upon creation of the JAXBContext, the server throws the exception: > > > > java.lang.ExceptionInInitializerError > > . . . > > Caused by: java.lang.IllegalStateException: javax.xml.bind.JAXBException: > "com.mobixell.mwc.acquisitionconfiguration.schema" doesnt contain > ObjectFactory.class or jaxb.index > > . . . > > Caused by: javax.xml.bind.JAXBException: > "com.mobixell.mwc.acquisitionconfiguration.schema" doesnt contain > ObjectFactory.class or jaxb.index > > =A0=A0=A0=A0=A0=A0=A0 at > com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:183) > > =A0=A0=A0=A0=A0=A0=A0 at sun.reflect.NativeMethodAccessorImpl.invoke0(Nat= ive Method) > > =A0=A0=A0=A0=A0=A0=A0 at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java= :39) > > =A0=A0=A0=A0=A0=A0=A0 at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI= mpl.java:25) > > =A0=A0=A0=A0=A0=A0=A0 at java.lang.reflect.Method.invoke(Method.java:585) > > =A0=A0=A0=A0=A0=A0=A0 at javax.xml.bind.ContextFinder.newInstance(Context= Finder.java:133) > > =A0=A0=A0=A0=A0=A0=A0 at javax.xml.bind.ContextFinder.find(ContextFinder.= java:286) > > =A0=A0=A0=A0=A0=A0=A0 at javax.xml.bind.JAXBContext.newInstance(JAXBConte= xt.java:372) > > =A0=A0=A0=A0=A0=A0=A0 at javax.xml.bind.JAXBContext.newInstance(JAXBConte= xt.java:337) > > =A0=A0=A0=A0=A0=A0=A0 at javax.xml.bind.JAXBContext.newInstance(JAXBConte= xt.java:244) > > =A0=A0=A0=A0=A0=A0=A0 at > com.mobixell.mwc.psm.AcquisitionDatabase.(AcquisitionDatabase.java:= 69) > > =A0=A0=A0=A0=A0=A0=A0 ... 14 more > > > > Originally, the auto-generated jars were not created with the jaxb.index > file. I understand that it is not a must to have a jaxb.index if you have= an > ObjectFactory class. However, I tried adding the appropriate jaxb.index > files anyway, and it still doesn=92t work. > > > > Any ideas why Axis2 has problems with the JAXB generated classes? I am > really lost on that one and would appreciate any help. > > > > > > Thanks! > > Oded > >