Search Results

Search found 252 results on 11 pages for 'jaxb'.

Page 8/11 | < Previous Page | 4 5 6 7 8 9 10 11  | Next Page >

  • What are the differences between mapping,binding and parsing?

    - by sfrj
    I am starting to learn web-services in java EE6. I did web development before, but never nothing related to web services. All is new to me and the books and the tutorials i find in the web are to technical. I started learning about .xsd schemas and also .xml. In that topic i feel confident, i understand what are the schemas used for and what validation means. Now my next step is learning about JAX-B(Java Api for XML Binding). I rode some about it and i did also some practice in my IDE. But i have lots of basic doubts, that make me stuck and cannot feel confident to continue to the next topic. Ill appreciate a lot if someone could explain me well my doubts: What does it mean mapping and what is a mapping tool? What does it mean binding and what is a binding tool? What does it mean parsing and what is a parsing tool? How is JAX-B related to mapping,binding and parsing? I am seeking for a good answer built by you, not just a copy paste from google(Ive already been online a few hours and only got confused).

    Read the article

  • XMLAdapter for HashMap

    - by denniss
    I want to convert a list of items inside of my payaload and convert them into a hashmap. Basically, what I have is an Item xml representation which have a list of ItemID. Each ItemID has an idType in it. However, inside my Item class, i want these ItemIDs to be represented as a Map. HashMap<ItemIDType, ItemID> The incoming payload will represent this as a list <Item>... <ItemIDs> <ItemID type="external" id="XYZ"/> <ItemID type="internal" id="20011"/> </ItemIDs> </Item> but I want an adapter that will convert this into a HashMap "external" => "xyz" "internal" => "20011" I am right now using a LinkedList public class MapHashMapListAdapter extends XmlAdapter<LinkedList<ItemID>, Map<ItemIDType, ItemID>> { public LinkedList<ItemID> marshal(final Map<ItemIDType, ItemID> v) throws Exception { ... } public Map<ItemIDType, ItemID> unmarshal(final LinkedList<ItemID> v) throws Exception { ... } } but for some reason when my payload gets converted, it fails to convert the list into a hashmap. The incoming LinkedList of the method unmarshal is an empty list. Do you guys have any idea what I am doing wrong here? Do I need to create my own data type here to handle the LinkedList?

    Read the article

  • Long To XMLGregorianCalendar and back to Long

    - by JD.
    I am trying to convert from millisecond time stamp to XMLGregorianCalendar and back, but I seem to be getting wrong results. Am I doing something wrong? It seems I am gaining days. // Time stamp 01-Jan-0001 00:00:00.000 Long ts = -62135740800000L; System.out.println(ts); System.out.println(new Date(ts)); // Sat Jan 01 00:00:00 PST 1 .. Cool! // to Gregorian Calendar GregorianCalendar gc = new GregorianCalendar(); gc.setTimeInMillis(ts); // to XML Gregorian Calendar XMLGregorianCalendar xc = DatatypeFactory.newInstance().newXMLGregorianCalendar(gc); // back to GC GregorianCalendar gc2 = xc.toGregorianCalendar(); // to Timestamp Long newTs = gc2.getTimeInMillis(); System.out.println(newTs); // -62135568000000 .. uh? System.out.println(new Date(newTs)); // Mon Jan 03 00:00:00 PST 1 .. where did the extra days come from?

    Read the article

  • Question on XJB

    - by Hima
    I have two tables -- INSTALL_BUILD_RESULTS and BUILD_RESULTS. IBR has a primary key called Install_Build_Id and BR has a primary key called Build_Id. Both are numbers A third table, LINK_BUILD_TO_INSTALL_BUILD is a table simply consisting of the two columns mentioned above, used together as a composite key. How can I write an xjb for these 3 tables.

    Read the article

  • JAX-B annotations for elements that inherit from a parent

    - by AlexM
    When adding JAX-B Java annotations for Java classes - if I have a parent Class Entry, with two children, Book and JournalArticle, Would I add these annotations for all three classes: @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement ie: @XmlSeeAlso({au.com.library.Book.class, au.com.library.JournalArticle.class}) @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement public abstract class Entry implements Serializable{ private static final long serialVersionUID = -1895155325179947581L; @XmlElement(name="title") protected String title; @XmlElement(name="author") protected String author; @XmlElement(name="year") protected int year; and @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement public class Book extends Entry { @XmlElement(name="edition") private String edition; @XmlElement(name="publisher") private String publisher; @XmlElement(name="placeOfPublication") private String placeOfPub; and @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement public class JournalArticle extends Entry { @XmlElement(name="journalTitle") private String journalTitle; @XmlElement(name="volume") private String volume; @XmlElement(name="issue") private String issue; @XmlElement(name="pageNumbers") private String pgNumbers;

    Read the article

  • Custom Response + HTTP status?

    - by Cristian Boariu
    Hi, I have a rest interface for my project. For one class i have a POST method where you can post an xml and i RETURN a custom response like: <userInvitation>Invalid email</userInvitation> if the email from the xml which was posted, was incorrect + other custom messages i have defined for different situations. For all of these the HTTP STATUS is automatically put on 200 (OK). Is there any way to change it? Ps: I know that i can throw a web application like : throw new WebApplicationException(Response.Status.BAD_REQUEST); but in this case my custom response is no more included. So i just want to return my custom error + 400 as http response. Thanks in advance.

    Read the article

  • Java xml binding with wrong xmlns attribute name

    - by Tom Brito
    When I use the annotation: @XmlRootElement(name="RootElement", namespace="namespace") class RootElement { to create xml file from java, it creates the root element as: <ns2:RootElement xmlns:ns2="namespace"> but I wanted to create without the "ns2", like: <RootElement xmlns="namespace"> Any idea how to fix it? Reletad link (example I used to create the xml): http://www.java2s.com/Code/JavaAPI/javax.xml.bind.annotation/XmlRootElementname.htm

    Read the article

  • EclipseLink Moxy Provider for JAX-RS and JAX-WS

    - by arungupta
    EclipseLink MOXy is a JAXB provider bundled in GlassFish 3.1.2. In addition to JAXB RI, it provides XPath Based Mapping, better support for JPA entities, native JSON binding and many other features. Learn more about MOXy and JAXB examples on their wiki. Blaise blogged about how MOXy can be leveraged to create a JAX-WS service.You just need to provide data-binding attribute in sun-jaxws.xml and then all the XPath-based mapping can be specified on JAXB beans. MOXy can also be used as JAX-RS JSON provider on server-side and client-side. How are you using MOXy in your applications ?

    Read the article

  • Best Practices Generating WebService Proxies for Oracle Sales Cloud (Fusion CRM)

    - by asantaga
    I've recently been building a REST Service wrapper for Oracle Sales Cloud and initially all was going well, however as soon as I added all of my Web Service proxies I started to get weird errors..  My project structure looks like this What I found out was if I only had the InteractionsService & OpportunityService WebService Proxies then all worked ok, but as soon as I added the LocationsService Proxy, I would start to see strange JAXB errors. Example of the error message Exception in thread "main" javax.xml.ws.WebServiceException: Unable to create JAXBContextat 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:281)at com.sun.xml.ws.client.WSServiceDelegate.buildRuntimeModel(WSServiceDelegate.java:762)at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.buildRuntimeModel(WLSProvider.java:982)at com.sun.xml.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:746)at com.sun.xml.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:737)at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:361)at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.internalGetPort(WLSProvider.java:934)at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate$PortClientInstanceFactory.createClientInstance(WLSProvider.java:1039)...... Looking further down I see the error message is related to JAXB not being able to find an objectFactory for one of its types Caused by: java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 6 counts of IllegalAnnotationExceptionsThere's no ObjectFactory with an @XmlElementDecl for the element {http://xmlns.oracle.com/apps/crmCommon/activities/activitiesService/}AssigneeRsrcOrgIdthis problem is related to the following location:at protected javax.xml.bind.JAXBElement com.oracle.xmlns.apps.crmcommon.activities.activitiesservice.ActivityAssignee.assigneeRsrcOrgId at com.oracle.xmlns.apps.crmcommon.activities.activitiesservice.ActivityAssignee This is very strange... My first thoughts are that when I generated the WebService Proxy I entered the package name as "oracle.demo.pts.fusionproxy.servicename" and left the generated types as blank. This way all the generated types get put into the same package hierarchy and when deployed they get merged... Sounds resaonable and appears to work but not in this case..  To resolve this I regenerate the proxy but this time setting : Package name : To the name of my package eg. oracle.demo.pts.fusionproxy.interactionsRoot Package for Generated Types :  Package where the types will be generated to, e.g. oracle.demo.pts.fusionproxy.SalesParty.types When I ran the application now, it all works , awesome eh???? Alas no, there is a serious side effect. The problem now is that to help coding I've created a collection of helper classes , these helper classes take parameters which use some of the "generic" datatypes, like FindCriteria. e.g. This wont work any more public static FindCriteria createCustomFindCriteria(FindCriteria pFc,String pAttributes) Here lies a gremlin of a problem.. I cant use this method anymore, this is because the FindCriteria datatype is now being defined two, or more times, in the generated code for my project. If you leave the Root Package for types blank it will get generated to com.oracle.xmlns, and if you populate it then it gets generated to your custom package.. The two datatypes look the same, sound the same (and if this were a duck would sound the same), but THEY ARE NOT THE SAME... Speaking to development, they recommend you should not be entering anything in the Root Packages section, so the mystery thickens why does it work.. Well after spending sometime with some colleagues of mine in development we've identified the issue.. Alas different parts of Oracle Fusion Development have multiple schemas with the same namespace, when the WebService generator generates its classes its not seeing the other schemas properly and not generating the Object Factories correctly...  Thankfully I've found a workaround Solution Overview When generating the proxies leave the Root Package for Generated Types BLANK When you have finished generating your proxies, use the JAXB tool XJC and generate Java classes for all datatypes  Create a project within your JDeveloper11g workspace and import the java classes into this project Final bit.. within the project dependencies ensure that the JAXB/XJC generated classes are "FIRST" in the classpath Solution Details Generate the WebServices SOAP proxies When generating the proxies your generation dialog should look like this Ensure the "unwrap" parameters is selected, if it isn't then that's ok, it simply means when issuing a "get" you need to extract out the Element Generate the JAXB Classes using XJC XJC provides a command line switch called -wsdl, this (although is experimental/beta) , accepts a HTTP WSDL and will generate the relevant classes. You can put these into a single batch/shell script xjc -wsdl https://fusionservername:443/appCmmnCompInteractions/InteractionService?wsdlxjc -wsdl https://fusionservername443/opptyMgmtOpportunities/OpportunityService?wsdl Create Project in JDeveloper to store the XJC "generated" JAXB classes Within the project folder create a filesystem folder called "src" and copy the generated files into this folder. JDeveloper11g should then see the classes and display them, if it doesnt try clicking the "refresh" button In your main project ensure that the JDeveloper XJC project is selected as a dependancy and IMPORTANT make sure it is at the top of the list. This ensures that the classes are at the front of the classpath And voilà.. Hopefully you wont see any JAXB generation errors and you can use common datatypes interchangeably in your project, (e.g. FindCriteria etc)

    Read the article

  • how can i overriding the inbound message validation with cxf?

    - by user1648330
    when i input a non-numeric content to a Integer types of field, i have got a fault mesasge 'Not a number: 0.012A'. How to do ability to in prior to the Unmarshal for schema validation and output custom error messages? I used cxf 2.6.1 and also configuration with <entry key="schema-validation-enabled" value="true" ></entry> in cxf-spring.xml. java.lang.RuntimeException: Not a number: 0.012A at com.jiemai.jmservice.handlers.ValidationEventHandler.handleEvent(ValidationEventHandler.java:19) at org.apache.cxf.jaxb.io.DataReaderImpl$WSUIDValidationHandler.handleEvent(DataReaderImpl.java:78) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:655) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleError(UnmarshallingContext.java:691) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleError(UnmarshallingContext.java:687) at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.handleParseConversionException(Loader.java:271) at com.sun.xml.bind.v2.runtime.unmarshaller.LeafPropertyLoader.text(LeafPropertyLoader.java:69) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.text(UnmarshallingContext.java:514) at com.sun.xml.bind.v2.runtime.unmarshaller.InterningXmlVisitor.text(InterningXmlVisitor.java:93) at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.processText(StAXStreamConnector.java:338) at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleEndElement(StAXStreamConnector.java:216) at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:185) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:370) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:349) at org.apache.cxf.jaxb.JAXBEncoderDecoder.doUnmarshal(JAXBEncoderDecoder.java:784) at org.apache.cxf.jaxb.JAXBEncoderDecoder.access$100(JAXBEncoderDecoder.java:97) at org.apache.cxf.jaxb.JAXBEncoderDecoder$1.run(JAXBEncoderDecoder.java:812) at java.security.AccessController.doPrivileged(Native Method) at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:810) at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:644) at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:157) at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:108) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122) at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:211) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:193) at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:187) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:110) at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:166) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Unknown Source)

    Read the article

  • When the request xml with extra elements, return Unmarshalling Error in CXF 2.2.7

    - by yunchat
    The wsdl as following: <xs:complexType name="GetCompositionDto" <xs:complexContent <xs:extension base="tns:baseDto" <xs:sequence <xs:element minOccurs="0" name="itemCode" type="xs:string"/ <xs:element minOccurs="0" name="compositionVersion" type="xs:string"/ </xs:sequence </xs:extension </xs:complexContent </xs:complexType After I updated the CXF the jars. from cxf-2.1.4, jaxb-Impl-2.1.9, jaxb-xjc-2.1.9 To cxf-2.2.7, jaxb-Impl-2.1.12, jaxb-xjc-2.1.12. When I request the XML with following: <itemCodeaa</itemCode <compositionVersionbb</compositionVersion <h22</h --- extra element Displays Errors: Unmarshalling Error: unexpected element (uri:"", local:"h"). Expected elements are <{}itemCode,<{}compositionVersion I know the 'h' doesn't map the element in WSDL. But It's OK in the cxf-2.1.4 version. How can i solve this problem? thanks.

    Read the article

  • Write an xml file from the specified node?

    - by Googler
    Hi all, This is my xml file Input: <world> <patent> <xml>a</xml> <java>333</java> <jaxb>111</jaxb> </patent> </world> I need the read the above xml file and reproduce the following the output Output: <patent> <xml>a</xml> <java>333</java> <jaxb>111</jaxb> </patent> I dont need the world element. How to achieve this using Xpath. Can anyone help me on this?

    Read the article

  • What is the opposite of JAXB? i.e. generating XML FROM classes?

    - by 8EM
    I am currently designing a solution to a problem I have. I need to dynamically generate an XML file on the fly using Java objects, in the same way JAXB generates Java classes from XML files, however the opposite direction. Is there something out there already like this? Alternatively, a way in which one could 'save' a state of java classes. The goal I am working towards is a dynamically changing GUI, where a user can redesign their GUI in the same way you can with iGoogle.

    Read the article

  • Parsing a .NET DataSet returned from a .NET Web Service in Java

    - by Chris Dail
    I have to consume a .NET hosted web service from a Java application. Interoperability between the two is usually very good. The problem I'm running into is that the .NET application developer chose to expose data using the .NET DataSet object. There are lots of articles written as to why you should not do this and how it makes interoperability difficult: http://www.hanselman.com/blog/ReturningDataSetsFromWebServicesIsTheSpawnOfSatanAndRepresentsAllThatIsTrulyEvilInTheWorld.aspx http://www.lhotka.net/weblog/ThoughtsOnPassingDataSetObjectsViaWebServices.aspx http://aspnet.4guysfromrolla.com/articles/051805-1.aspx http://www.theserverside.net/tt/articles/showarticle.tss?id=Top5WSMistakes My problem is that despite this not being recommended practice, I am stuck with having to consume a web service returning a DataSet with Java. When you generate a proxy for something like this with anything other than .NET you basically end up with an object that looks like this: @XmlElement(namespace = "http://www.w3.org/2001/XMLSchema", required = true) protected Schema schema; @XmlAnyElement(lax = true) protected Object any; This first field is the actual schema that should describe the DataSet. When I process this using JAX-WS and JAXB in Java, it bring all of XS-Schema in as Java objects to be represented here. Walking the object tree of JAXB is possible but not pretty. The any field represents the raw XML for the DataSet that is in the schema specified by the schema. The structure of the dataset is pretty consistent but the data types do change. I need access to the type information and the schema does vary from call to call. I've though of a few options but none seem like 'good' options. Trying to generate Java objects from the schema using JAXB at runtime seems to be a bad idea. This would be way too slow since it would need to happen everytime. Brute force walk the schema tree using the JAXB objects that JAX-WS brought in. Maybe instead of using JAXB to parse the schema it would be easier to deal with it as XML and use XPath to try and find the type information I need. Are there other options I have not considered? Is there a Java library to parse DataSet objects easily? What have other people done who may have similar situations?

    Read the article

  • How can I marshal JSON to/from a POJO for BlackBerry Java?

    - by sowbug
    I'm writing a RIM BlackBerry client app. BlackBerry uses a simplified version of Java (no generics, no annotations, limited collections support, etc.; roughly a Java 1.3 dialect). My client will be speaking JSON to a server. We have a bunch of JAXB-generated POJOs, but they're heavily annotated, and they use various classes that aren't available on this platform (ArrayList, BigDecimal, XMLGregorianCalendar). We also have the XSD used by the JAXB-XJC compiler to generate those source files. Being the lazy programmer that I am, I'd really rather not manually translate the existing source files to Java 1.3-compatible JSON-marshalling classes. I already tried JAXB 1.0.6 xjc. Unfortunately, it doesn't understand the XSD file well enough to emit proper classes. Do you know of a tool that will take JAXB 2.0 XSD files and emit Java 1.3 classes? And do you know of a JSON marshalling library that works with old Java? I think I am doomed because JSON arrived around 2006, and Java 5 was released in late 2004, meaning that people probably wouldn't be writing JSON-parsing code for old versions of Java. However, it seems that there must be good JSON libraries for J2ME, which is why I'm holding out hope.

    Read the article

  • How to use EMF to read XML file?

    - by zengr
    I have to use EMF in one of my class projects. I am trying to understand how to use EMF to do the following: Read XML, Get the values into objects. Use ORM to persist the values in objects to database. - Done Get data from database using ORM and generate XML. I need to do all of that using: EMF (no idea what so ever) and JPA (DONE). I have used JAXB and I know, this can be done using JAXB, but how is (EMF == JAXB)?! I have created many java classes using EMF, but there are so many of them! Where do I implement the read/write methods and how do I run the EMF project? Thanks

    Read the article

  • Java Application for handling records(CRUD)

    - by LivingThing
    I am new to JavaEE and am faced with a tight situation here. I have to develop a Java application for (CRUD) handling records and saving and loading an XML concerning that record. Obviously, I won't be asking you to do this for me. What I would be asking you is to give me some hints/pointer. Initially I thought JAXB would be enough for this but after putting a lot of time learning it and implementing the program I realized that it just can create the XML and read it but for update, delete I would have to do something else. Even if it wasn't for update and delete features requirement for my project I would still think that by just using JAXB is not a good implementation. I was wondering if "REST with Java (JAX-RS) using Jersey" should do the trick for me. ?

    Read the article

  • Python XML + Java XML interoperability.

    - by erb
    Hello. I need a recommendation for a pythonic library that can marshall python objects to XML(let it be a file). I need to be able read that XML later on with Java (JAXB) and unmarshall it. I know JAXB has some issues that makes it not play nice with .NET XML libraries so a recommendation on something that actually works would be great.

    Read the article

  • Easy XML Serializer for Java

    - by sdoca
    I'm looking for a way to serialize Java objects into XML for use by a RESTful web service. I don't have an XSD. I have looked at the following: JAXB - fairly heavy weight with annotations required on classes and also an ObjectFactory class and/or a jaxb.index file Simple - requires annotations but no other config classes/files. Unfortunately it can't serialize Sets. XStream - no annotations etc. required, but doesn't support generics Does anyone else have any suggestions?

    Read the article

  • org.apache.cxf.interceptor.Fault: Unmarshalling Error: Duplicate default namespace declaration.

    - by JohnC
    Not sure why I am receiving this after the webservice ran and I am trying to return back to my client side bean. The webservice works perfectly outside of my webserver in SoapUI. org.apache.cxf.interceptor.Fault: Unmarshalling Error: Duplicate default namespace declaration. at [row,col {unknown-source}]: [1,321] at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:764) at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:623) at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:128) at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:101) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236) at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:671) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2177) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2057) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1982) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:637) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:483) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:309) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:261) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)

    Read the article

  • Convenience of mySQL over xml

    - by Bonechilla
    Currently I use XML to store specific information to correctly load a few things such as a list of specfied characters, scenes and music, Once more I use JAXB in combination with standard compression/decompression(ZIP) functionality to store a list of extrenous data. This data is called to add functionality to the character, somewhat like Skills in an RPG. Each skill is seperated into its own XML file with a grandlist which contains the names of each file with their extensions omitted and zipped in folder that gets encrypted. At first using xml was working fine however as the skill list grow i worry about its stability. I was wondering if I should begin storing the data in mySQL. Originally I planned to simply convert everything to JSON over xml but i think possibly mySQL would be a better move. Can anyone inform me of the key difference and pros and cons of each I guess i'm looking for the best way to store the data more conviently and would be easier to operate on. The data is mostly primatives and strings and the only arraylist of values i have i can just concat into a single field and parse later Edit: If I am going in the right direction with XML would it make sense to convert it to JSON and use maybe Kyro or EclipseLink JAXB (MOXy)

    Read the article

  • Today's Links (6/24/2011)

    - by Bob Rhubart
    Fusion Applications - How we look at the near future | Domien Bolmers Bolmers recaps a Logica pow-wow around Fusion Applications. Who invented e-mail? | Nicholas Carr IT apparently does matter to Nicholas Carr as he shares links to Errol Morris's 5-part NYT series about the origins of email. David Sprott's Blog: Service Oriented Cloud (SOC) "Whilst all the really good Cloud environments are Service Oriented," says Sprott, "it’s very much the minority of consumer SaaS that is today." Fast, Faster, JRockit | René van Wijk Oracle ACE René van Wijk tells you "everything you ever wanted to know about the JRockit JVM, well quite a lot anyway." Creating an XML document based on my POJO domain model – how will JAXB help me? | Lucas Jellema "I thought that adding a few JAXB annotations to my existing POJO model would do the trick," says Jellema, "but no such luck." Announcing Oracle Environmental Accounting and Reporting | Theresa Hickman Oracle Environmental Accounting and Reporting is designed to help companies track and report greenhouse emissions. Yoga framework for REST-like partial resource access | William Vambenepe Vambenepe says: "A tweet by Stefan Tilkov brought Yoga to my attention, 'a framework for supporting REST-like URI requests with field selectors.'" InfoQ: Pragmatic Software Architecture and the Role of the Architect "Joe Wirtley introduces software architecture and the role of the architect in software development along with techniques, tips and resources to help one get started thinking as an architect."

    Read the article

  • Webservice returns java.lang.reflect.InvocationTargetException

    - by Damian
    Hi, I am receiving the above message when making a request to a java webservice. We originally created a Java Console application and manually submitted an xml file. When running this as a Java Application the response is successfully created and displayed by using System.out.println. We are creating the web service by selecting the java file that contains the methods and choosing "create webservice" specifying the dynamic project that the webservice is to be created in and the methods to be exposed. What the application is doing is taking an xml file and unmarshalling this to an object using: public static Object unmarshalToObject(Class classToBeBound, String xmlRequest) { Object obj = new Object(); try { JAXBContext jc = JAXBContext.newInstance(classToBeBound); Unmarshaller um = jc.createUnmarshaller(); obj = um.unmarshal(new StringReader(xmlRequest)); } catch (Exception e) { e.printStackTrace() } return obj; } Some processing is carried out on the file and then an object is marshalled to xml as follows: public static String marshalToXML(Object data) { StringWriter sw = new StringWriter(); try { logger.info("Create new Marshall"); JAXBContext jc = JAXBContext.newInstance("ContextPathName"); logger.info("Marshalled to xmlObjects"); Marshaller marshaller = jc.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true); marshaller.marshal(data, sw); } catch (Exception e) { logException(logger, e); } return sw.toString(); } The following is the line of code that seems to be causing an issue as the logger displays the message prior to this: JAXBContext jc = JAXBContext.newInstance("ContextPathName"); The webservice never gets to the next line - the following is the body of the SOAP message: <soapenv:Fault> <faultcode>soapenv:Server.userException</faultcode> <faultstring>java.lang.reflect.InvocationTargetException</faultstring> <detail> <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">servername</ns1:hostname> </detail> </soapenv:Fault> I have added Try/Catch around this section of code even as far as looking for JAXBExceptions but this does not seem to catch anything - nor does the general exception. This issue does not occur when running the console application. The build path for this includes the following contents of sun\jwsdp-2.0\jaxb\lib: jaxb-api.jar jsr173_1.0_api.jar jaxb-impl.jar I have added these to the lib folder in the WEB-INF file of the dynamic project. I am running the webservice in JBuilder 2008 R2 and using SOAPUI to submit the request - this points to the wsdl generated when creating the webservice. If anyone has any help or ideas on how to solve this could they please reply - thanks for taking the time to read this post!

    Read the article

  • Using Glassfish libraries in proprietary software

    - by Lóránt Pintér
    I would like to use some parts of Glassfish in a proprietary software that are under a CDDL + GPLv2 license. Am I allowed to do that? I haven't modified anything in the code of these libraries, so is this OK, or my software, because it uses these libraries, is still considered derivative work, and thus a big no-no? I mean, according to https://jaxb.dev.java.net/, JAXB is also under CDDL + GPLv2, but I know I can freely use that in proprietary software. Is this because CDDL + GPLv2 actually allows that, or is it distributed under a different license when bundled with the JRE?

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11  | Next Page >