Netbeans 6.5 RC Can’t load 6.1 Project

October 23, 2008

Normally I write posts to solve problems. Sadly today I’m writing a post out of desperation. I am currently reviewing the RC of Netbeans 6.5, it has some great features *BUT* we have our main huge project we are working on right now that we can’t work with in it.

It’s an enterprise application with Jasper Reports and Java Server Faces, however. We cannot load any JSF pages they don’t appear for editing, just the java code, we occasionally get an “Illegal State Exception”.

I read somewhere that the problem is to do with Jasper Reports, but even not loading the plugins we cannot load the JSF pages from the project in 6.5.

UPDATE
It is the jasper reports plugin Ireport causing the problem. Unfortunately you can’t just uninstall the plugin it seems to actually “stuff up” (technical term) NB completely.

Problems with Webservices in Netbeans and how to solve them

October 1, 2008

Ok, rather than give a tutorial on web services – because there are some around, I thought I would solve one of the mysterious problems that can occur when you are creating these services.

Netbeans is AMAZING at creating web services, the tools are incredibly rich.

But this error dogged me. I had one or two web services that worked and others that didn’t. To set up my service I had set up some inner classes

public static class dtaData {
private String Name;
private String date;
private String sid;
}

then created a web services that returned a LIST of those objects:-

    @WebMethod(operationName = "Data")
    public List Data() {
        List result=new ArrayList();
       for (int i=0;i<20;++i) {
        dtaData DataObject=new dtaData ();
       DataObject.sid=""+i;
       result.add(Result);
     }

        
        return result;
    }
  

And it falls over with this error when you test the webserver. HOWEVER The problem is caused because there is no web service DIRECTLY returning the dtaData class. The solution is to create a web service that returns null but has dtaData as the returning Object.

e.g.

    @WebMethod(operationName = "testData")
    public dtaData testData() {
           return null;

    }
   

These errors are given when the problem occurs:-

On the glassfish server

Caused by: javax.xml.ws.WebServiceException: javax.xml.bind.MarshalException
 - with linked exception:
[javax.xml.bind.JAXBException: class PHJ.Agenda$ICDB_Agenda_data nor any of its super class is known to this context.]
        at com.sun.xml.ws.message.jaxb.JAXBMessage.writePayloadTo(JAXBMessage.java:322)
        at com.sun.xml.ws.message.AbstractMessageImpl.writeTo(AbstractMessageImpl.java:142)
        at com.sun.xml.ws.encoding.StreamSOAPCodec.encode(StreamSOAPCodec.java:108)
        at com.sun.xml.ws.encoding.SOAPBindingCodec.encode(SOAPBindingCodec.java:258)
        at com.sun.xml.ws.transport.http.HttpAdapter.encodePacket(HttpAdapter.java:320)
        at com.sun.xml.ws.transport.http.HttpAdapter.access$100(HttpAdapter.java:93)
        at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:454)

On the web service test return:


Exceptions details : java.lang.reflect.InvocationTargetException


javax.servlet.ServletException: java.lang.reflect.InvocationTargetException at com.sun.enterprise.webservice.monitoring.WebServiceTesterServlet.doPost(WebServiceTesterServlet.java:345) at com.sun.enterprise.webservice.monitoring.WebServiceTesterServlet.invoke(WebServiceTesterServlet.java:121) at com.sun.enterprise.webservice.JAXWSServlet.doPost(JAXWSServlet.java:165) at javax.servlet.http.HttpServlet.service(HttpServlet.java:738) at javax.servlet.http.HttpServlet.service(HttpServlet.java:831) at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317) at org.apache.catalina.core.Ap