Problem with JAXB
I am trying to run a simple test program to unmarshall and XML doc and am getting the following error:
[erdos OpenOfficeDev]$ ./java_jaxb.sh unmarshall sampleDoc.xml
JAXBLIB /opt/tomcat50-jwsdp/jaxb/lib
CLASSPATH /opt/tomcat50-jwsdp/jaxb/lib/jaxb-api.jar:/opt/tomcat50-jwsdp/jaxb/lib/jaxb-impl.jar:/opt/tomcat50-jwsdp/jaxb/lib/jaxb-libs.jar:/opt/tomcat50-jwsdp/jaxb/lib/jaxb-xjc.jar:/usr/java/j2sdk1.4.2_08/jre/lib/ext/xml-apis.jar:.:/opt/tomcat50-jwsdp/jwsdp-shared/lib/jax-qname.jar:/opt/tomcat50-jwsdp/jwsdp-shared/lib/namespace.jar:/opt/tomcat50-jwsdp/jwsdp-shared/lib/relaxngDatatype.jar:/opt/tomcat50-jwsdp/jaxp/lib/endorsed/dom.jar:/opt/tomcat50-jwsdp/jaxp/lib/endorsed/sax.jar:/opt/tomcat50-jwsdp/jaxp/lib/endorsed/xalan.jar:/opt/tomcat50-jwsdp/jaxp/lib/endorsed/xercesImpl.jar:/home/nscharfe/netbeans-4.1/ide5/modules/autoload/ext/xerces-2.6.2.jar:/home/nscharfe/resolver.jar:/home/nscharfe/xercesImpl.jar:/home/nscharfe/xercesSamples.jar:/home/nscharfe/xml-apis.jar:/opt/tomcat50-jwsdp/jaxp//jaxp-api.jar
args.length =1
unmarshall.Main file=sampleDoc.xml
JAXBContext
jc ood_jaxb.impl.runtime.DefaultJAXBContextImpl@d2906a
u ood_jaxb.impl.runtime.UnmarshallerImpl@1434234
Exception in thread "main" java.lang.NoSuchMethodError: javax.xml.parsers.SAXParserFactory.getSchema()Ljavax/xml/validation/Schema;
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.<init>(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.getXMLReader(AbstractUnmarshallerImpl.java:80)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:131)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:178)
at unmarshall.main(unmarshall.java:56)
Any ideas what the problem is? Do I need to include anything else in my classpath?
I am running redhat linux.
Any help is GREATLY appreciated
Since I am running java 1.5.x, it seems like the only solution that the above thread suggests is to add rt.jar to my classpath. I did that and it did not help so my path is now;
CLASSPATH /opt/tomcat50-jwsdp/jaxb/lib/jaxb-api.jar:/opt/tomcat50-jwsdp/jaxb/lib/jaxb-impl.jar:
/opt/tomcat50-jwsdp/jaxb/lib/jaxb-libs.jar:/opt/tomcat50-jwsdp/jaxb/lib/jaxb-xjc.jar:
/usr/java/j2sdk1.4.2_08/jre/lib/ext/xml-apis.jar:.:/opt/tomcat50-jwsdp/jwsdp-shared/lib/jax-qname.jar:
opt/tomcat50-jwsdp/jwsdp-shared/lib/namespace.jar:/opt/tomcat50-jwsdp/jwsdp-shared/lib/relaxngDatatype.jar:
/home/nscharfe/jdk1.5.0_04/jre/lib/rt.jar:/home/nscharfe/jdk1.5.0_04/jre/lib/javaws.jar:/home/nscharfe/jdk1.5.0_04/jre/lib/jce.jar:
/home/nscharfe/jdk1.5.0_04/jre/lib/jsse.jar:/home/nscharfe/jdk1.5.0_04/jre/lib/plugin.jar:
/home/nscharfe/jdk1.5.0_04/jre/lib/deploy.jar:/home/nscharfe/jdk1.5.0_04/jre/lib/charsets.jar:
/opt/tomcat50-jwsdp/jaxp/lib/endorsed/dom.jar:/opt/tomcat50-jwsdp/jaxp/lib/endorsed/sax.jar:
/opt/tomcat50-jwsdp/jaxp/lib/endorsed/xalan.jar:/opt/tomcat50-jwsdp/jaxp/lib/endorsed/xercesImpl.jar:
/home/nscharfe/netbeans-4.1/ide5/modules/autoload/ext/xerces-2.6.2.jar:/home/nscharfe/resolver.jar:
/home/nscharfe/xercesImpl.jar:/home/nscharfe/xercesSamples.jar:/home/nscharfe/xml-apis.jar:
/opt/tomcat50-jwsdp/jaxp//jaxp-api.jar
Did I miss any important info on the above thread? Any other suggestions?
thanks so much for the help.
Similar Messages
-
Problem with JAXB Unmarshaller
This exception ocurred in production environment. Notice that always it happens in SAXUnmarshallerHandlerImpl.getCurrentHandler method but not always in the same package and sometimes it occurs and sometimes doesn�t. In test environment it never happens. Could it be a memory problem? I write some examples:
java.lang.ArrayIndexOutOfBoundsException: -1
at es.indra.bizlogic.jaxb.air.output.impl.runtime.SAXUnmarshallerHandlerImpl.getCurrentHandler(Unknown Source)
at es.indra.bizlogic.jaxb.air.output.impl.runtime.SAXUnmarshallerHandlerImpl.endElement(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
java.lang.ArrayIndexOutOfBoundsException: -1
at es.indra.bizlogic.jaxb.fare.output.impl.runtime.SAXUnmarshallerHandlerImpl.getCurrentHandler(Unknown Source)
at es.indra.bizlogic.jaxb.fare.output.impl.runtime.SAXUnmarshallerHandlerImpl.popContentHandler(Unknown Source)
at es.indra.bizlogic.jaxb.fare.output.impl.runtime.AbstractUnmarshallingEventHandlerImpl.revertToParentFromEnterElement(Unknown Source)
at es.indra.bizlogic.jaxb.fare.output.impl.EDATEImpl$Unmarshaller.enterElement(Unknown Source)
at es.indra.bizlogic.jaxb.fare.output.impl.runtime.SAXUnmarshallerHandlerImpl.startElement(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
java.lang.ArrayIndexOutOfBoundsException: -1
at es.indra.bizlogic.jaxb.fare.output.impl.runtime.SAXUnmarshallerHandlerImpl.getCurrentHandler(Unknown Source)
at es.indra.bizlogic.jaxb.fare.output.impl.runtime.SAXUnmarshallerHandlerImpl.endElement(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
java.lang.ArrayIndexOutOfBoundsException: -1
at es.indra.bizlogic.jaxb.fare.output.impl.runtime.SAXUnmarshallerHandlerImpl.getCurrentHandler(Unknown Source)
at es.indra.bizlogic.jaxb.fare.output.impl.runtime.SAXUnmarshallerHandlerImpl.popContentHandler(Unknown Source)
at es.indra.bizlogic.jaxb.fare.output.impl.runtime.AbstractUnmarshallingEventHandlerImpl.revertToParentFromEnterElement(Unknown Source)
at es.indra.bizlogic.jaxb.fare.output.impl.CODEImpl$Unmarshaller.enterElement(Unknown Source)
at es.indra.bizlogic.jaxb.fare.output.impl.runtime.SAXUnmarshallerHandlerImpl.startElement(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
Message was edited by:
Ana_Indra_MadridI had the same problem! The answer is to include '.' in your CLASSPATH. A dot like this means the current directory. The compiler won't find all the package files in the current directory unless its path is explicitly set in CLASSPATH. Seems strange as you might expect a compiler at least to try looking for files wherever you currently are, but it's not the case. So, my CLASSPATH declaration is as follows, starting with '.;' and then continuing with all the required jar files:
.;c:\jwsdp-1.3\jaxb\lib\jaxb-api.jar;c:\jwsdp-1.3\jaxb\lib\jaxb-xjc.jar;c:\jwsdp-1.3\jaxb\lib\jaxb-impl.jar;c:\jwsdp-1.3\jaxb\lib\jaxb-libs.jar;c:\jwsdp-1.3\jaxp\lib\jaxp-api.jar;c:\jwsdp-1.3\jaxp\lib\endorsed\sax.jar;c:\jwsdp-1.3\jaxp\lib\endorsed\dom.jar;c:\jwsdp-1.3\jaxp\lib\endorsed\xercesImpl.jar;c:\jwsdp-1.3\jaxp\lib\endorsed\xalan.jar;c:\jwsdp-1.3\jwsdp-shared\lib\jax-qname.jar;c:\jwsdp-1.3\jwsdp-shared\lib\namespace.jar;c:\jwsdp-1.3\jwsdp-shared\lib\xsdlib.jar;c:\jwsdp-1.3\jwsdp-shared\lib\relaxngDatatype.jar -
Problem with JAXB context.createUnmarshaller();
hi,
I'm running into problems when trying to use JAXB context.createUnmarshaller();
so far I have:
1. extracted an xsd from my XML
2. Added the following 4 jars to my project: jaxb-api,jaxb-xjc,jaxb-impl,jaxb1-impl
3. used xjc and successfully generate the source for my custom classes
4. compiled my custom classes and added them to my project's build path.
I have the following code:
//this line works and I can see the context being generated with my custom classes
JAXBContext context = JAXBContext.newInstance("path.to.my.jaxb.bo's");
//the following line returns an error
Unmarshaller unmarshaller = context.createUnmarshaller();
the error I get is:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.createUnmarshaller(JAXBContextImpl.java:604)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.createUnmarshaller(JAXBContextImpl.java:107)
at com.cyclicom.sem.ApiDao.SEMApiReader.readApi(SEMApiReader.java:46)
at com.cyclicom.sem.SEMDataWriter.init(SEMDataWriter.java:26)
at com.cyclicom.sem.SEMDataWriter.main(SEMDataWriter.java:19)ok, I just found the problem myself seems like a bunch of jars were missing, if your reading this and ran into the same problem make sure you have the following libs in your build path, on top of JAXB lib:
sjsxp
jwsdp-shared
both are a part of the jwsdp -
Problem with JAXB Unmarshall - javax.xml.bind.UnmarshalException
Hi,
I'm getting an expection while unmarshalling using JAXB. The error is as follows :
DefaultValidationEventHandler: [ERROR]: unexpected element (uri:"http://www.etrade.com/ee/systemdomainao/search", local:"Context_Id"). Expected elements are <{}contextId>,<{}predicateInterceptor>,<{}isDefaultsearch>,<{}implicitContextSQL>,<{}contextName>,<{}searchId>,<{}implicitContextText>
I've generated JAXB classes using xjc command from my schema. The root element is Search object which has a List of Searchcontext and Columlist object. When I'm trying to unmarshall the XML, I'm getting the above exception. What is baffling, if I comment out the <tns:SearchContext> entry from the XML, unmarshall doesn't throw any exception and populates the columnlist properly. Columnlist and Searchcontext have little difference except that columnlist contains more elements.
Here'e the unmarshall code,
URL metadataURL = this.getClass().getClassLoader().getResource("metadata/search/PARTICIPANT.xml");
JAXBContext jc = JAXBContext.newInstance("com.etrade.ee.systemdomainao.search.domain");
Unmarshaller unmarshaller = jc.createUnmarshaller();
unmarshaller.setEventHandler(new javax.xml.bind.helpers.DefaultValidationEventHandler());
Search search = (Search)unmarshaller.unmarshal(metadataURL);
Any pointers will be highly appreciated.
ThanksXSD :
XSD :
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.etrade.com/ee/systemdomainao/search" targetNamespace="http://www.etrade.com/ee/systemdomainao/search" elementFormDefault="qualified" attributeFormDefault="unqualified">
<!-- Searchcontext type definition -->
<xs:complexType name="Searchcontext">
<xs:sequence>
<xs:element name="Context_Id" type="xs:int"/>
<xs:element name="Search_Id" type="xs:string"/>
<xs:element name="Context_Name" type="xs:string"/>
<xs:element name="Implicit_Context_SQL" nillable="true">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="500"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Implicit_Context_Text" nillable="true">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="500"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Is_Defaultsearch" type="xs:boolean" nillable="true"/>
<xs:element name="Predicate_Interceptor" type="xs:string" nillable="true"/>
</xs:sequence>
</xs:complexType>
<!-- Searchlist type definition -->
<xs:complexType name="Columnlist">
<xs:sequence>
<xs:element name="Columnlist_Id" type="xs:int"/>
<xs:element name="Search_Id" type="xs:string"/>
<xs:element name="Is_Quicksearchable" type="xs:boolean" nillable="true"/>
<xs:element name="Is_Advancesearchable" type="xs:boolean" nillable="true"/>
<xs:element name="Is_Quicksearchview" type="xs:boolean" nillable="true"/>
<xs:element name="Is_Fullview" type="xs:boolean" nillable="true"/>
<xs:element name="Is_Sortable" type="xs:boolean" nillable="true"/>
<xs:element name="Is_Defaultsort" type="xs:boolean" nillable="true"/>
<xs:element name="Default_SortOrder" type="xs:string" nillable="true" minOccurs="0"/>
<xs:element name="Display_Order" type="xs:int" nillable="true"/>
<xs:element name="Default_Value" type="xs:string" nillable="true" maxOccurs="6"/>
<xs:element name="Default_Operator" type="xs:string" nillable="true"/>
<xs:element name="Is_Closedset" type="xs:boolean"/>
<xs:element name="Closedset_List_Name" type="xs:string" nillable="true"/>
<xs:element name="Is_RelatedMenu" type="xs:boolean" minOccurs="0"/>
<xs:element name="Column_Name" type="xs:string"/>
<xs:element name="Display_Name" type="xs:string"/>
<xs:element name="Is_UDF" type="xs:boolean" nillable="true"/>
<xs:element name="Table_Name" type="xs:string"/>
<xs:element name="Data_Type" type="xs:string"/>
<xs:element name="Column_Size" type="xs:int"/>
</xs:sequence>
</xs:complexType>
<!-- Search declaration -->
<xs:element name="Search">
<!--<choice>
<xs:interface name="java.io.Serializable" />
</choice>-->
<xs:complexType>
<xs:sequence>
<xs:element name="Search_Id" type="xs:string"/>
<xs:element name="Schema_Set">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="20"/>
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="SearchContext" type="tns:Searchcontext" maxOccurs="unbounded"/>
<xs:element name="ColumnList" type="tns:Columnlist" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:key name="Search_PrimaryKey_1">
<xs:selector xpath="."/>
<xs:field xpath="tns:Search_Id"/>
</xs:key>
<xs:keyref name="Searchcontext_ForeignKey_1" refer="tns:Search_PrimaryKey_1">
<xs:selector xpath=".//tns:SearchContext"/>
<xs:field xpath="tns:Search_Id"/>
</xs:keyref>
<xs:keyref name="Columnlist_ForeignKey_2" refer="tns:Search_PrimaryKey_1">
<xs:selector xpath=".//tns:ColumnList"/>
<xs:field xpath="tns:Search_Id"/>
</xs:keyref>
<xs:key name="Searchcontext_PrimaryKey_1">
<xs:selector xpath=".//tns:SearchContext"/>
<xs:field xpath="tns:Context_Id"/>
</xs:key>
<xs:key name="Columnlist_PrimaryKey_1">
<xs:selector xpath=".//tns:ColumnList"/>
<xs:field xpath="tns:Columnlist_Id"/>
</xs:key>
</xs:element>
</xs:schema> -
Help: problems with JAXB unmarshalling
Hi all,
I've got a DOM Document object, which I wish to unmarshall. It all works great, but I wish to do some better validation handling, and this is where I see something weird: whenever a ValidationEvent comes into my custom ValidationEventHandler, it practically contains no info on the location of the event. This is the typical content of event.getLocator():
columnNumber = -1
lineNumber = -1
node = null
object = null
offset = -1
url = null
This is the code:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
InputStream is = new FileInputStream("d:/temp/file1.xml");
Document doc = builder.parse(is);
is.close();
JAXBContext jaxbContext = JAXBContext
.newInstance("com.company.xml");
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
unmarshaller.setEventHandler(new MyValidator(unmarshaller
.getEventHandler()));
Object result = unmarshaller.unmarshal(doc.getDocumentElement());thanksFound a solution. I added:
unmarshaller.setValidating(true);
I also had to make sure that the xml file did not contain schema info (i.e. shcemaLocation, etc), otherwise, I get a NullPointerException - I don't yet know why, but it's good enough for me at the moment :-)
Now, the ValidationEventLocator contains a ref to the Node in my DOM. -
Problems generating classes with JAXB
Does anyone know where there might be a list of known problems with generating classes from an xsd with JAXB? I have a very deep and pretty complicated xsd, and it seems some elements get generated correctly and some don't. It's very hard to find any pattern of why. Is there a limit to the number of levels deep it will go?
Try here as well
https://jaxb.dev.java.net/ -
Hi All,
I just started to learn JAXB and I come to a point in which I need to run xjc on a dtd file and jxs file. The problem is that is gives me an ERROR :
"parsing a schema...
[ERROR] The markup in the document preceding the root element must be well-forme
d.
line 1 of checkbook.dtd
This is my dtd file:
<!ELEMENT checkbook ( transactions, balance ) >
<!ELEMENT transactions ( deposit | check | withdrawal )* >
<!ELEMENT deposit ( date, name, amount )>
<!ATTLIST deposit category ( salary | interest-income | other ) #IMPLIED >
<!ELEMENT check ( date, name, amount, ( pending | void | cleared ), memo? )>
<!ATTLIST check number CDATA #REQUIRED category ( rent | groceries | other ) #IMPLIED >
<!ELEMENT withdrawal ( date, amount ) >
<!ELEMENT balance (#PCDATA) >
<!ELEMENT date (#PCDATA ) >
<!ELEMENT name (#PCDATA) >
<!ELEMENT amount (#PCDATA) >
<!ELEMENT memo (#PCDATA) >
<!ELEMENT pending EMPTY >
<!ELEMENT void EMPTY >
<!ELEMENT cleared EMPTY >
What is the problem with it?
Need your help and THANKS in advance
A.BTry adding dom4j.jar (http://www.dom4j.org/) to your classpath and compiling with the -dtd switch. E.g.:
xjc -dtd foo.dtd
-- Ed -
Hello,
I am having a strange problem with Tomcat and axis. I have a webservice that uses axis2 for wsdl2java class generation. When I compile my project in maven a Test is performed. During the test a glassfish server is established and the project is deployed -everything work great with the expected results. However when I try to deploy the webservice on tomcat it has some problems.
At first I tried to call axis code in a POST method that takes a MultiPart message. The code is as below:
*@Path("identifyWavestream")*
*@POST*
*@Consumes(MediaType.MULTIPART_FORM_DATA)*
*@Produces(MediaType.APPLICATION_XML)*
*public String multipartTest(com.sun.jersey.multipart.MultiPart multiPart) throws Exception {*
*// get first body part (index 0)*
*//tomcat shows that the first error is here (line 122 is the nest one with bodypart)*
BodyPart bp = multiPart.getBodyParts().get(0);
BodyPartEntity bodyPartEntity = (BodyPartEntity) bp.getEntity();
InputStream stream = bodyPartEntity.getInputStream();
*//the rest of the code either saves the incoming file or implements the wsdl2java axis interface - neither works.*
And the tomcat error is:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
java.util.ArrayList.RangeCheck(Unknown Source)
java.util.ArrayList.get(Unknown Source)
com.webserv.rest.resources.SearchResource.test.multipartTest(SearchResource.java:122)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.sun.jersey.server.impl.model.method.dispatch.EntityParamDispatchProvider$TypeOutInvoker._dispatch(EntityParamDispatchProvider.java:138)
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:67)
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:124)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:71)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:63)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:555)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:514)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:505)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:359)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
It was strange to me since this simple approach of handling a Multipart method worked for me earlier. Then I decided skip the handling of multipart method and just call the axis code. But the results also caused an error. I then tried to call the axis code in a simple @GET method (to cross out any issues regarding the multipart) and the result where the same. Again everything works on the maven- glassfish test. In this case the tomcat error is the following:
javax.servlet.ServletException: java.lang.NoSuchMethodError: org.apache.commons.httpclient.HttpConnectionManager.getParams()Lorg/apache/commons/httpclient/params/HttpConnectionManagerParams;
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:361)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
root cause
com.sun.jersey.api.container.MappableContainerException: java.lang.NoSuchMethodError: org.apache.commons.httpclient.HttpConnectionManager.getParams()Lorg/apache/commons/httpclient/params/HttpConnectionManagerParams;
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:74)
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:124)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:71)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:63)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:555)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:514)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:505)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:359)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
root cause
java.lang.NoSuchMethodError: org.apache.commons.httpclient.HttpConnectionManager.getParams()Lorg/apache/commons/httpclient/params/HttpConnectionManagerParams;
org.apache.axis2.transport.http.AbstractHTTPSender.initializeTimeouts(AbstractHTTPSender.java:454)
org.apache.axis2.transport.http.AbstractHTTPSender.getHttpClient(AbstractHTTPSender.java:514)
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:156)
org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:371)
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:209)
org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
com.webserv.rest.webapp.IntSoapServiceStub.getServerData(IntSoapServiceStub.java:2447)
com.webserv..rest.resources.AIntSoapImpl.getServerData(AIntSoapImpl.java:112)
com.webserv..rest.resources.SearchResource.test.pingTest(SearchResource.java:167)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.sun.jersey.server.impl.model.method.dispatch.EntityParamDispatchProvider$TypeOutInvoker._dispatch(EntityParamDispatchProvider.java:138)
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:67)
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:124)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:71)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:63)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:555)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:514)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:505)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:359)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
I think it is also a good ide to post the pom.xml file :
Edited by: 803864 on 2010-10-21 00:30I think it is also a good ide to post the pom.xml file:
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<modelVersion>4.0.0</modelVersion>+
+<groupId>com.myProjects</groupId>+
+<artifactId>audioid-rest-interface</artifactId>+
+<packaging>war</packaging>+
+<name>AudioID Rest Interface</name>+
+<version>0.1</version>+
+<dependencies>+
+<!--+
+<dependency>+
+<groupId>com.sun.tools.xjc.maven2</groupId>+
+<artifactId>maven-jaxb-plugin</artifactId>+
+<version>1.1</version>+
+<scope>test</scope>+
+</dependency>+
+<dependency>+
+<groupId>com.sun.jersey</groupId>+
+<artifactId>jersey-client</artifactId>+
+<version>1.0.1</version>+
+</dependency>+
+<dependency>+
+<groupId>com.sun.jersey.contribs</groupId>+
+<artifactId>jersey-multipart</artifactId>+
+<version>1.0.1</version>+
+</dependency>+
+<dependency>+
+<groupId>com.sun.grizzly</groupId>+
+<artifactId>grizzly-servlet-webserver</artifactId>+
+<version>1.9.0</version>+
+<scope>test</scope>+
+</dependency>-->+
+<dependency>+
+<groupId>com.sun.jersey.contribs</groupId>+
+<artifactId>jersey-multipart</artifactId>+
+<version>1.0.1</version>+
+</dependency>+
+<dependency>+
+<groupId>com.sun.jersey</groupId>+
+<artifactId>jersey-client</artifactId>+
+<version>1.0.1</version>+
+</dependency>+
+<dependency>+
+<groupId>com.sun.jersey</groupId>+
+<artifactId>jersey-bundle</artifactId>+
+<version>1.0.1</version>+
+</dependency>+
+<dependency>+
+<groupId>commons-logging</groupId>+
+<artifactId>commons-logging</artifactId>+
+<version>1.0.4</version>+
+</dependency>+
+<dependency>+
+<groupId>commons-collections</groupId>+
+<artifactId>commons-collections</artifactId>+
+<version>3.1</version>+
+</dependency>+
+<dependency>+
+<groupId>org.slf4j</groupId>+
+<artifactId>slf4j-log4j12</artifactId>+
+<version>1.5.6</version>+
+</dependency>+
+<dependency>+
+<groupId>junit</groupId>+
+<artifactId>junit</artifactId>+
+<version>3.8.2</version>+
+<scope>test</scope>+
+</dependency>+
+<dependency>+
+<groupId>org.glassfish.distributions</groupId>+
+<artifactId>web-all</artifactId>+
+<version>10.0-build-20080430</version>+
+<scope>test</scope>+
+</dependency>+
+<dependency>+
+<groupId>org.glassfish.embedded</groupId>+
+<artifactId>gf-embedded-api</artifactId>+
+<version>1.0-alpha-4</version>+
+<scope>test</scope>+
+</dependency>+
+<dependency>+
+<groupId>com.sun.jersey</groupId>+
+<artifactId>jersey-server</artifactId>+
+<version>1.0.3.1</version>+
+<scope>test</scope>+
+</dependency>+
+<dependency>+
+<groupId>com.sun.jersey.contribs</groupId>+
+<artifactId>maven-wadl-plugin</artifactId>+
+<version>1.0.3.1</version>+
+</dependency>+
+<dependency>+
+<groupId>org.hibernate</groupId>+
+<artifactId>hibernate</artifactId>+
+<version>3.2.5.ga</version>+
+<exclusions>+
+<exclusion>+
+<groupId>javax.transaction</groupId>+
+<artifactId>jta</artifactId>+
+</exclusion>+
+<exclusion>+
+<groupId>cglib</groupId>+
+<artifactId>cglib</artifactId>+
+</exclusion>+
+</exclusions>+
+</dependency>+
+<dependency>+
+<groupId>org.apache.axis2</groupId>+
+<artifactId>axis2</artifactId>+
+<version>1.4.1</version>+
+</dependency>+
+<!-- <dependency> -->+
+<dependency>+
+<groupId>org.apache.axis2</groupId>+
+<artifactId>axis2-aar-maven-plugin</artifactId>+
+<version>1.4.1</version>+
+<scope>test</scope>+
+</dependency>+
+<dependency>+
+<groupId>org.apache.axis2</groupId>+
+<artifactId>axis2-java2wsdl</artifactId>+
+<version>1.4.1</version>+
+<scope>test</scope>+
+</dependency>+
+<dependency>+
+<groupId>org.apache.axis2</groupId>+
+<artifactId>axis2-xmlbeans</artifactId>+
+<version>1.4.1</version>+
+</dependency>+
+<!-- <dependency> -->+
+<dependency>+
+<groupId>com.sun.xml.bind</groupId>+
+<artifactId>jaxb-impl</artifactId>+
+<version>2.1.12</version>+
+</dependency>+
+<dependency>+
+<groupId>cglib</groupId>+
+<artifactId>cglib-nodep</artifactId>+
+<version>2.1_3</version>+
+</dependency>+
+</dependencies>+
+<build>+
+<finalName>audioid-rest-interface</finalName>+
+<plugins>+
+<plugin>+
+<!-- This class is just generated for wadl support!!! -->+
+<!-- Take care that folder ../music-dna-core is existing -->+
+<groupId>com.sun.tools.xjc.maven2</groupId>+
+<artifactId>maven-jaxb-plugin</artifactId>+
+<version>1.1</version>+
+<executions>+
+<execution>+
+<phase>generate-sources</phase>+
+<goals>+
+<goal>generate</goal>+
+</goals>+
+</execution>+
+</executions>+
+<configuration>+
+<generatePackage> com.webserv.wsparameters</generatePackage>+
+<schemaDirectory>../audioid-rest-interface/src/main/resources+
+</schemaDirectory>+
+<includeSchemas>+
+<includeSchema>**/*.xsd</includeSchema>+
+</includeSchemas>+
+<extension>true</extension>+
+<strict>false</strict>+
+<verbose>false</verbose>+
+</configuration>+
+</plugin>+
+<plugin>+
+<groupId>org.apache.maven.plugins</groupId>+
+<artifactId>maven-javadoc-plugin</artifactId>+
+<!-- <version>2.6</version> -->+
+<executions>+
+<execution>+
+<goals>+
+<goal>javadoc</goal>+
+</goals>+
+<phase>compile</phase>+
+</execution>+
+</executions>+
+<configuration>+
+<encoding>UTF-8</encoding>+
+<verbose>false</verbose>+
+<show>public</show>+
+<subpackages> com.webserv.rest.rest.resources: com.webserv.rest.rest.commons: com.webserv.wsparameters+
+</subpackages>+
+<doclet>com.sun.jersey.wadl.resourcedoc.ResourceDoclet</doclet>+
+<docletPath>${path.separator}${project.build.outputDirectory}+
+</docletPath>+
+<docletArtifacts>+
+<docletArtifact>+
+<groupId>com.sun.jersey.contribs</groupId>+
+<artifactId>wadl-resourcedoc-doclet</artifactId>+
+<version>1.0.3.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>com.sun.jersey</groupId>+
+<artifactId>jersey-server</artifactId>+
+<version>1.0.3.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>xerces</groupId>+
+<artifactId>xercesImpl</artifactId>+
+<version>2.6.1</version>+
+</docletArtifact>+
+</docletArtifacts>+
+<additionalparam>-output+
+${project.build.outputDirectory}/resourcedoc.xml</additionalparam>+
+<useStandardDocletOptions>false</useStandardDocletOptions>+
+</configuration>+
+</plugin>+
+<plugin>+
+<groupId>com.sun.jersey.contribs</groupId>+
+<artifactId>maven-wadl-plugin</artifactId>+
+<version>1.0.3.1</version>+
+<executions>+
+<execution>+
+<id>generate</id>+
+<goals>+
+<goal>generate</goal>+
+</goals>+
+<phase>compile</phase>+
+</execution>+
+</executions>+
+<configuration>+
+<wadlFile>${project.build.outputDirectory}/application.wadl+
+</wadlFile>+
+<formatWadlFile>true</formatWadlFile>+
+<baseUri>http://192.168.2.149:8080/${project.build.finalName}+
+</baseUri>+
+<packagesResourceConfig>+
+<param> com.webserv.rest.resources</param>+
+</packagesResourceConfig>+
+<wadlGenerators>+
+<wadlGeneratorDescription>+
+<className>com.sun.jersey.server.wadl.generators.WadlGeneratorApplicationDoc+
+</className>+
+<properties>+
+<property>+
+<name>applicationDocsFile</name>+
+<value>${basedir}/src/main/doc/application-doc.xml</value>+
+</property>+
+</properties>+
+</wadlGeneratorDescription>+
+<wadlGeneratorDescription>+
+<className>com.sun.jersey.server.wadl.generators.WadlGeneratorGrammarsSupport+
+</className>+
+<properties>+
+<property>+
+<name>grammarsFile</name>+
+<value>${basedir}/src/main/doc/application-grammars.xml</value>+
+</property>+
+</properties>+
+</wadlGeneratorDescription>+
+<wadlGeneratorDescription>+
+<className>com.sun.jersey.server.wadl.generators.resourcedoc.WadlGeneratorResourceDocSupport+
+</className>+
+<properties>+
+<property>+
+<name>resourceDocFile</name>+
+<value>${project.build.outputDirectory}/resourcedoc.xml</value>+
+</property>+
+</properties>+
+</wadlGeneratorDescription>+
+</wadlGenerators>+
+</configuration>+
+</plugin>+
+<plugin>+
+<groupId>org.codehaus.mojo</groupId>+
+<artifactId>exec-maven-plugin</artifactId>+
+<version>1.1</version>+
+<executions>+
+<execution>+
+<goals>+
+<goal>java</goal>+
+</goals>+
+</execution>+
+</executions>+
+<configuration>+
+<mainClass>com.sun.jersey.samples.generatewadl.Main</mainClass>+
+</configuration>+
+</plugin>+
+<plugin>+
+<groupId>org.apache.maven.plugins</groupId>+
+<artifactId>maven-compiler-plugin</artifactId>+
+<inherited>true</inherited>+
+<configuration>+
+<source>1.5</source>+
+<target>1.5</target>+
+<!--+
exclude temporary types that are only needed for wadl and doc
generation
-->
+<!--+
+<excludes> <exclude>com/webserv/types/temporary/**</exclude>+
+<exclude>com/webserv/rest/commons/Examples.java</exclude>+
+</excludes>+
-->
+</configuration>+
+</plugin>+
+<plugin>+
+<groupId>org.jvnet.jaxb2.maven2</groupId>+
+<artifactId>maven-jaxb2-plugin</artifactId>+
+<executions>+
+<execution>+
+<goals>+
+<goal>generate</goal>+
+</goals>+
+</execution>+
+</executions>+
+</plugin>+
+<plugin>+
+<groupId>org.apache.axis2</groupId>+
+<artifactId>axis2-wsdl2code-maven-plugin</artifactId>+
+<version>1.4.1</version>+
+<executions>+
+<execution>+
+<id>generate reco core</id>+
+<goals>+
+<goal>wsdl2code</goal>+
+</goals>+
+<configuration>+
+<packageName>com.webserv.rest.webapp</packageName>+
+<wsdlFile>src/main/java/com/webserv/wsdl/web.wsdl</wsdlFile>+
+<databindingName>adb</databindingName>+
+</configuration>+
+</execution>+
+</executions>+
+</plugin>+
+<plugin>+
+<groupId>com.sun.tools.xjc.maven2</groupId>+
+<artifactId>maven-jaxb-plugin</artifactId>+
+<version>1.1</version>+
+<executions>+
+<execution>+
+<goals>+
+<goal>generate</goal>+
+</goals>+
+</execution>+
+</executions>+
+<configuration>+
+<generatePackage>com.webserv.wsparameters</generatePackage>+
+<schemaDirectory>src/main/xsd</schemaDirectory> <includeSchemas>+
+<includeSchema>**/*.xsd</includeSchema> </includeSchemas>+
+<extension>true</extension>+
+<strict>false</strict>+
+<verbose>true</verbose>+
+</configuration>+
+</plugin>+
+</plugins>+
+</build>+
+<profiles>+
+<profile>+
+<id>jdk-1.5</id>+
+<activation>+
+<jdk>1.5</jdk>+
+</activation>+
+<dependencies>+
+<dependency>+
+<groupId>com.sun.xml.bind</groupId>+
+<artifactId>jaxb-impl</artifactId>+
+<version>2.1.10</version>+
+</dependency>+
+</dependencies>+
+<build>+
+<plugins>+
+<plugin>+
+<groupId>org.apache.maven.plugins</groupId>+
+<artifactId>maven-javadoc-plugin</artifactId>+
+<configuration>+
+<docletArtifacts>+
+<docletArtifact>+
+<groupId>com.sun.jersey.contribs</groupId>+
+<artifactId>maven-wadl-plugin</artifactId>+
+<version>1.0.3.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>com.sun.jersey.contribs</groupId>+
+<artifactId>wadl-resourcedoc-doclet</artifactId>+
+<version>1.0.3.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>com.sun.jersey</groupId>+
+<artifactId>jersey-server</artifactId>+
+<version>1.0.3.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>xerces</groupId>+
+<artifactId>xercesImpl</artifactId>+
+<version>2.6.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>javax.xml.bind</groupId>+
+<artifactId>jaxb-api</artifactId>+
+<version>2.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>javax.xml</groupId>+
+<artifactId>jaxb-impl</artifactId>+
+<version>2.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>javax.activation</groupId>+
+<artifactId>activation</artifactId>+
+<version>1.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>javax.xml.stream</groupId>+
+<artifactId>stax-api</artifactId>+
+<version>1.0</version>+
+</docletArtifact>+
+</docletArtifacts>+
+</configuration>+
+</plugin>+
+</plugins>+
+</build>+
+</profile>+
+<profile>+
+<id>xsltproc</id>+
+<activation>+
+<file>+
+<exists>../xsltproc_win32/xsltproc.exe</exists>+
+</file>+
+</activation>+
+<build>+
+<plugins>+
+<!-- Create/generate the application.html using xsltproc -->+
+<!-- Create/generate the application.html using xsltproc -->+
+<plugin>+
+<groupId>org.codehaus.mojo</groupId>+
+<artifactId>exec-maven-plugin</artifactId>+
+<version>1.1</version>+
+<executions>+
+<execution>+
+<id>copy-docs-to-builddir</id>+
+<goals>+
+<goal>exec</goal>+
+</goals>+
+<phase>compile</phase>+
+<configuration>+
+<executable>copy</executable>+
+<commandlineArgs>src\\main\\doc\\*.* target\\classes+
+</commandlineArgs>+
+</configuration>+
+</execution>+
+<execution>+
+<id>prepare-xsltproc</id>+
+<goals>+
+<goal>exec</goal>+
+</goals>+
+<phase>package</phase>+
+<configuration>+
+<executable>copy</executable>+
+<commandlineArgs>..\\audioid-rest-interface\\src\\main\\resources\\*.xsd+
target\\classes</commandlineArgs>
+</configuration>+
+</execution>+
+<execution>+
+<id>exec-xsltproc: target/application.html</id>+
+<goals>+
+<goal>exec</goal>+
+</goals>+
+<phase>package</phase>+
+<configuration>+
+<!--<executable>xsltproc</executable>-->+
+<executable>../xsltproc_win32/xsltproc.exe</executable>+
+<commandlineArgs>-o target/application.html+
src/main/doc/wadl_documentation.xsl
target/classes/application.wadl</commandlineArgs>
+</configuration>+
+</execution>+
+</executions>+
+</plugin>+
+</plugins>+
+</build>+
+</profile>+
+</profiles>+
+<pluginRepositories>+
+<pluginRepository>+
+<id>maven2-repository.dev.java.net</id>+
+<name>Java.net Repository for Maven</name>+
+<url>http://download.java.net/maven/2/</url>+
+<layout>default</layout>+
+</pluginRepository>+
+<pluginRepository>+
+<id>maven-repository.dev.java.net</id>+
+<name>Java.net Maven 1 Repository (legacy)</name>+
+<url>http://download.java.net/maven/1</url>+
+<layout>legacy</layout>+
+</pluginRepository>+
+</pluginRepositories>+
+<repositories>+
+<repository>+
+<id>maven2-repository.dev.java.net</id>+
+<name>Java.net Repository for Maven</name>+
+<url>http://download.java.net/maven/2/</url>+
+<layout>default</layout>+
+</repository>+
+<repository>+
+<id>maven-repository.dev.java.net</id>+
+<name>Java.net Maven 1 Repository (legacy)</name>+
+<url>http://download.java.net/maven/1</url>+
+<layout>legacy</layout>+
+</repository>+
+<repository>+
+<id>glassfish-repository</id>+
+<name>Java.net Repository for Glassfish</name>+
+<url>http://download.java.net/maven/glassfish</url>+
+</repository>+
+</repositories>+
+</project>+
Can anyonr contribute? -
I have a project that runs great on oc4j 10.0.3.4 under jdk 1.6. (everything worked great)
I recently tried to run it under jdk 1.5 and i've run into a little problem with the shared-lib's:
The classloader's debug file reports the following: (i have translated some of it)
Class error: oracle.classloader.util.AnnotatedNoClassDefFoundError:
Missing class: javax.xml.bind.JAXBContext
Dependant class: nl.comp.util.XmlUtil
Classloader: comp:0.1
Code-source: /C:/programs/oc4j/j2ee/home/shared-lib/comp/0.1/comp.jar
Configuration: <code-source> in /c:/programs/oc4j/j2ee/home/config/server.xml
The missing class is available from the following location:
1. Code-source: /C:/programs/oc4j/lib/xml.jar (from <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\programs\oc4j\j2ee\home\oc4j.jar)
This code-source is available from classloader oracle.xml:10.1.0_2
2. Code-source: /C:/programs/oc4j/j2ee/home/shared-lib/jaxb/2.1.6/jaxb-api.jar (from <code-source> in /c:/programs/oc4j/j2ee/home/config/server.xml)
This code-source is available from classloader jaxb:2.1.6.
So the classloader knows where to find the necessary lib, but it isn't loading it? If i run the exact same code (with same descriptors and everything) under jdk 1.6, it works, under 1.5 i get the above error.
What is different on the class loader level between the two jdk versions that might affect the program in such a way?
Need i update a descriptor or do something else?Jack,
Not a definitive answer for you (sorry), just a few suggestions (that I assume you are unaware of).
1. Try unsetting your "ClassPath" variable. Open a "command" window and type the following:
set ClassPath=2. Launch OC4J from the directory where the "oc4j.jar" file is located, for example:
D:
cd oc4j\j2ee\home
java -jar oc4j.jar3. I'm just guessing, but if your drive "D:" is a mapped, network drive, this may be causing the problem. Perhaps try installing OC4J on a local drive?
Hope this helps.
Good Luck,
Avi. -
BUG: OJC produce internal error with JAXB 2.0 src
Hello,
the OJC of JDev 10.1.3.0.4.36.99(Service Update 1) has problems with the src of the RI of JAXB 2.0.
The JAXB 2.0 uses generics, polymorhy and a lot of annotations.
To test my problem take the src from:
https://jaxb.dev.java.net/jaxb20-ea3/JAXB2_src_20051223.jar
or take the new nightly build src from:
https://jaxb.dev.java.net/servlets/ProjectDocumentList?expandFolder=460&folderID=3074
Than change the ant build.xml to use the OJC or make a project in JDeveloper.
After you had started the build, you will find a lot of interesting messages.
Retry the build in JDev and some messages will change.
Regards.Thanks for reporting this. We've logged a bug to track the issue: 5018566
-- Brian -
Any element with JAXB are always empty
Hi guys!
I'm trying to use the any element to specify some content for my web service. My XML schema contains this:
<complexType name="casObject">
<sequence>
<element name="type" type="string"/>
<element name="key" type="long" nillable="true" />
<any namespace="##targetNamespace" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
</sequence>
</complexType>I'm using jaxb 1.6 and it provides a method to get my any elements. In my example: List fieldList = casObject.getAny();
The schema validation doesn't complain, the logging interceptor shows that the additional elements (from any element) are transfered, but the list is always empty. Any idea why this list is always empty?
I've also have a question to the xsi:type element and jaxb in the web service forum called "missing xsi:type", maybe it it fits better in this forum. Please take a look.
http://forum.java.sun.com/thread.jspa?threadID=743719&tstart=0
Cheers,
IngoHi Achim,
According to my knowledge, there are no known problems with a "required Extended Protection" / "Always On" / "Livelink Server" combination.
Extended Protection helps to prevent an authentication relay attack by using service binding and channel binding. We need to note that when Extended Protection is set to
Required, only connections from protected applications on protected operating systems are accepted. This setting is the most secure but connections from operating systems or applications that do not support Extended Protection will not be able
to connect to SQL Server. For more details, please review the following article.
Connect to the Database Engine Using Extended Protection
https://msdn.microsoft.com/en-us/library/ff487261(v=sql.110).aspx
Thanks,
Lydia Zhang
If you have any feedback on our support, please click
here.
Lydia Zhang
TechNet Community Support -
Problems with Web services client
Hi all,
I'm trying to build a Web Service Client with netbeans 6.5. I add the Web Service Refefrences by clicking right on my project/new/Web Service Client and giving it the url of the wsdl or the wsdl file itself. All work well, I use the web service without problems but then, after several successful try I don't know why, I get this kind of exception:
Exception in thread "main" javax.xml.ws.WebServiceException: class net.stuff.webservice.webservices.Upload do not have a property of the name {www.stuff.net/WebService/WebServices}uploadReq
I precise I don't modify the code that call the web service.
To make it work again, I have to Clean & Build several time the project and/or Refresh tjh WebClient Reference, gain, without modifying the code.
The Web Service producer runs on .net and doesn't seems to "move".
Have you ever see this issue?
Maybe this could help: I'm using JDK 5 with JAXB-WB
ThanksHello Eric:
I have the same problem... but he Clean & Build thing didn't work :(...
To make it work I call the Web Service from a java application and include the java application's jar in the libraries of the java web application. -
Parsing (skipping) unknown tags with JAXB...
Does anybody know how can I skip unrecognised tags, during unmarshalling an XML document with JAXB?
For example : the schema-compliant document is :
<document>
<Version>3.20</Version>
<Account>Account</Account>
<Password>Password</Password>
</document>
and a possible modification would be :
<document>
<Version>3.21</Version>
<unknowntag>aaaabbbb</unknowntag>
<Account>Account</Account>
<Password>Password</Password>
</document>
(a new unknown tag was introduced).
so : the document is well-formed anyway (not strictly valid), but the second time a new unknown tag was introduced. I couldn't map it to a Java object (of course, because my data model could not foresee it), but I would like JAXB to skip it and have the program flow behaving exactly as the first case... ignoring this new unknown tag.
Thanks for any answer anybody could ever give me...
Emilio.Finally I found a workaround to this problem :
I used an XSL transformation from the incoming document into itself, according to the pattern matching provided by an xsl stylesheet, before giving it to JAXB. Definitely an XSL specular preprocessor (wow! sound cool!).
That is :
having an incoming XML document, I write an XSL stylesheet that transforms the original XML document into another XML having the same tags (that is... itself).
In this way, I can then give to JAXB a resulting XML document that contains ONLY those tags that I was expecting it to elaborate, since all the others (the unknown ones) were discarded by the xsl preprocessor.
And... that's it.
In this way I finally wrote an application able to skip unrecognized tags and elaborating by JAXB only the know ones. And that's what I was looking for :-)
Hope it could help you.
Bye,
emils. -
Strange problem with Istant DB
Hello,
i have a strange problem with idb and classloader... if i try to connect to my db using a servlet, i get a ClassNotFoundException, but if i try to connect to it normally, it's all ok...
C:\jwsdp\webapps\ROOT\prova\DB>java DataBase
Enhydra InstantDB - Version 3.26
The Initial Developer of the Original Code is Lutris Technologies Inc.
Portions created by Lutris are Copyright (C) 1997-2001 Lutris Technologies, Inc.
All Rights Reserved.
Database movies is shutting down...
Database movies shutdown complete.
What's the problem??? why
Class.forName("org.enhydra.instantdb.jdbc.idbDriver");
in a servlet application catch a ClassNotFoundException???
this is my classpath:
%JAXP_HOME%\lib\jaxp-api.jar;
%JAXB_LIBS%\jaxb-api.jar;
%JAXB_LIBS%\jaxb-ri.jar;
%JAXB_LIBS%\jaxb-xjc.jar;
%JAXB_LIBS%\jaxb-libs.jar;
%JWSDP_HOME%\common\lib\catalina-ant.jar;
%JWSDP_HOME\common\lib\servlet.jar;
C:\idb\Classes;
C:\idb\Classes\idb.jar;
C:\idb\Classes\idbexmpl.jar;
C:\idb\Classes\jta-spec1_0_1.jar;
C:\j2sdk\lib;
C:\jwsdp\jaxb-1.0\lib;
C:\jwsdp\jaxb-1.0;
C:\jwsdp\jaxb-1.0\lib\jaxb-api.jar;
C:\jwsdp\jaxb-1.0\lib\jaxb-libs.jar;
C:\jwsdp\jaxb-1.0\lib\jaxb-ri.jar;
C:\jwsdp\jaxb-1.0\lib\jaxb-xjc.jar;
Thanks, MarcoThere should be a xml configuration file for tomcat, and it should be possible to state additional classpaths there. But I'd suggest to use the pre-configured classpaths. In which directory does your servlet class reside, or where is your document root for the web application of this servlet?
Regards -
Validating datatypes with JAXB while unmarshalling
Hi,
is there in JAXB any method to check correct datatypes while JAXB unmarshalling
For example, I tried to unmarshall an xml file to objects and in on element of this XML file there was the data "AAAA"
<testElement>AAAA</testElement>
in the XSD Shema this element was declared as type Integer.
After unmarshalling the xml doc I've got an Object with an Attribut testElement which has the value "0" ... so can I test
type while unmarshalling an throw an exception?
Thanks a lot for your help!
with best regards
Rene
Forget it ... problem almost solved ...
Edited by: Gambler79 on Mar 10, 2008 2:48 PMI'm having what I think is a related problem to what's mentioned in this thread. Has anyone successfully used targetNamespace with JAXB? Below is the sample schema and xml I'm trying to unmarshal via JAXB version 1.02. Any help would be greatly appreciated.
This is the schema:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://foo.com/repository/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://foo.com/repository/"
elementFormDefault="unqualified"
attributeFormDefault="unqualified">
<xsd:element name="purchaseOrder" type="PurchaseOrderType"/>
<xsd:complexType name="PurchaseOrderType">
<xsd:sequence>
<xsd:element name="poText" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
====================================
This is the XML:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<purchaseOrder xmlns="http://foo.com/repository/">
<poText>foo</poText>
</purchaseOrder>
====================================
After calling unmarshal (with appropriate namespace), I get:
DefaultValidationEventHandler: [ERROR]: Unexpected element {http://foo.com/repository/}:poText
Location: line 3 of file:/C:/project/dev/prototype/repository/example/query.xml
javax.xml.bind.UnmarshalException: Unexpected element {http://foo.com/repository/}:poText
Can someone please let me know what I'm doing wrong here?
Thanks.
--S.
Maybe you are looking for
-
URGENT HELP Burning DVD from Final Cut Pro
I have a video due to buyers bye wednesday. If anyone knows how to take the movie I made and burn it to a DVD, please let me know as soon as you can. It wont let me export it to iDVD and when I try to "print to video" my camcorder only picks up the s
-
Help required in writing an sql to fetch the the difference of the data.
Hi Gurus, Could some one help me in writing an sql to pull data the difference between two same structured tables from two different database and to store that data in an temperory table. many many thanks in advance
-
Tracks being played are automatically being added to library!!!
Is there any way to stop a track being played from being added to the library?
-
Can I get total number of page in 'After Report' Trigger?
Currently, I use the format trigger of a field in Margin. In the trigger, I use srw.get_page_num(page_num) to get the current page number and call a package procedure to update a record. For example, if the report has 10 pages, it will update 10 time
-
Can't Make or Receive Calls on my Phone
Recently my curve 8520 has been throwing an exception which has disabled my SIM card call functions. I tried everything i know but yet couldn't solve it. Its very bad that when people call my line, it rings but the phone will not even ring or display