facebook

Unable to create JAXBContext

  1. MyEclipse Archived
  2.  > 
  3. Web Services
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #336107 Reply

    IgnatzMouse
    Member

    Folk’ses,

    I’m trying to create a web service and when I run the wizard to create the WSDLs from a Java class I get the following error and no WSDL etc:

    javax.xml.ws.WebServiceException: Unable to create JAXBContext
        at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:158)
        at com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:87)
        at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:262)
        at com.sun.tools.ws.wscompile.WsgenTool.buildModel(WsgenTool.java:225)
        at com.sun.tools.ws.wscompile.WsgenTool.run(WsgenTool.java:124)
        at com.genuitec.eclipse.ws.jaxws.JaxWSBUJob.wsGen(JaxWSBUJob.java:228)
        at com.genuitec.eclipse.ws.jaxws.JaxWSBUJob.run(JaxWSBUJob.java:124)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
    Caused by: java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
    java.sql.Timestamp does not have a no-arg default constructor.
        this problem is related to the following location:
            at java.sql.Timestamp
            at public java.sql.Timestamp de.haeger.counter.data.Counterevent.getTimestamp()
            at de.haeger.counter.data.Counterevent
            at private de.haeger.counter.data.Counterevent de.haeger.counter.webservice.jaxws.GetEventResponse._return
            at de.haeger.counter.webservice.jaxws.GetEventResponse
    
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:148)
        ... 7 more
    Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
    java.sql.Timestamp does not have a no-arg default constructor.
        this problem is related to the following location:
            at java.sql.Timestamp
            at public java.sql.Timestamp de.haeger.counter.data.Counterevent.getTimestamp()
            at de.haeger.counter.data.Counterevent
            at private de.haeger.counter.data.Counterevent de.haeger.counter.webservice.jaxws.GetEventResponse._return
            at de.haeger.counter.webservice.jaxws.GetEventResponse
    
        at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:438)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:286)
        at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
        at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:105)
        at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:153)
        at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:149)
        ... 9 more
    

    Any ideas welcome how to fix this….

    This happens with MyEclipse Blue Edition 10.6-Blue-201.20727 on Windows 7 x64

    #336113 Reply

    IgnatzMouse,

    We could not replicate the issue at our end.

    Can you please answer some queries to help us investigate further :
    1) Can you please create a new workspace and try replicating the issue ?
    2) If you are still seeing any issues, can you please mention exact steps in details to help us replicate the issue at our end ? Please mention what all options, java bean class etc you have selected in the web service wizard.

    #336128 Reply

    IgnatzMouse
    Member

    Pradeep,

    thanks for taking the time. I started all from scratch and still run into the same problem. Here is what I did:
    1. installed Bling 10.6 on Debian 2.6.35.5-amd64, running on VirtualBox
    2. Create new Web Service Project with JAX-WS JEE 5.0
    3. Create new Oracle thin DB connection to Oracle 11g Enterprise Edition 11.2.0.2.0
    4. Add JPA capabilities with Oracle connection, 3 tables with many-to-many and one-to-one relations
    5. Add new package
    6. Generate Entities&DAOs
    7. Implement controller class, see attachment
    8. New Web Service, JAX-WS, bottom-up with controller class, generate WSDL in project

    #336129 Reply

    IgnatzMouse
    Member

    can’t get the attachment to work, here is my controller class, which I use for WSDL creation:

    package de.haeger.counter.webservice.data;
    
    import java.util.List;
    
    
    public class CounterController {
        public boolean newCategory(Countercategory category) {
            // TODO: implement newCategory
            return false;
        }
        public boolean newCounter(Counter counter) {
            // TODO: implement newCounter
            return false;
        }
        public boolean newEvent(Counterevent event) {
            // TODO: implement newEvent
            return false;
        }
        public boolean deleteCategory(Countercategory category) {
            // TODO: implement deleteCategory
            return false;
        }
        public boolean deleteCounter(Counter counter) {
            // TODO: implement deleteCounter
            return false;
        }
        public boolean deleteEvent(Counterevent event) {
            // TODO: implement deleteEvent
            return false;
        }
        public boolean updateCategory(Countercategory category) {
            // TODO: implement updateCategory
            return false;
        }
        public boolean updateCounter(Counter counter) {
            // TODO: implement updateCounter
            return false;
        }
        public boolean updateEvent(Counterevent event) {
            // TODO: implement updateEvent
            return false;
        }
        public Countercategory getCategory(long id) {
            // TODO: implement getCategory
            return null;
        }
        public Counter getCounter(long id) {
            // TODO: implement getCounter
            return null;
        }
        public Counterevent getEvent(long id) {
            // TODO: implement getEvent
            return null;
        }
        public List<Countercategory> getCategories() {
            // TODO: implement getCategories
            return null;
        }
        public List<Counter> getCounters() {
            // TODO: implement getCounters
            return null;
        }
        public List<Counterevent> getEvents() {
            // TODO: implement getEvents
            return null;
        }
    }
    
    #336135 Reply

    IgnatzMouse
    Member

    ok, I found the problem:
    need to use the DAOs in my controller, then WSDL generation works

    #336179 Reply

    IgnatzMouse,

    Glad that your issue is resolved.
    Let us know if you see any issues.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Unable to create JAXBContext

You must be logged in to post in the forum log in