users@jax-ws.java.net

Problem with wsgen and ejb3 entidy.

From: Fernando Parisotto <fernando.parisotto_at_gmail.com>
Date: Sat, 9 Sep 2006 10:25:15 -0300

Hi everybody,
I have a problem when i try to generate wsdl with wsgen tool, i using a ant
task to do that.
I try to transfer my entitys beans with my web services methods, then i have
this exception:

    [wsgen] [WebServiceReferenceCollector - method: deleteCategoria(
net.uniplac.tcc.segurancaws.model.Categoria)]
    [wsgen] [ProcessedMethods Class: java.lang.Object]
    [wsgen] error: java.lang.IllegalArgumentException: interface
javax.persistence.Id is not visible from class loader
    [wsgen] java.lang.IllegalArgumentException: interface
javax.persistence.Id is not visible from class loader

The method deleteCategoria is expose in my web service, and the class
Categoria (Category) is my entidy.
I already try to remove this method, but i have the same problem with other
methods.

this is my method:

    @WebMethod(operationName="excluir-categoria")
    public Categoria deleteCategoria(@WebParam(name="categoria") Categoria
categoria) throws Exception {
        return factory.createCategoriaDAO().delete(categoria);
    }

this is my build.xml:

<?xml version="1.0" encoding="UTF-8"?>

<project name="SegurancaWS" default="all" basedir=".">

    <property environment="env" />
    <property name="src" value="${basedir}/src" />
    <property name="lib" value="${basedir}/lib" />
    <property name="conf" value="${basedir}/conf" />
    <property name="classes" value="${basedir}/classes" />
    <property name="war.file" value="${basedir}/seguranca-ws.war" />
    <property name="deploy.dir"
value="${env.AS_HOME}/domains/domain1/autodeploy"
/>

    <path id="app.classpath">
        <pathelement path="${src}" />
        <pathelement path="${classes}" />
        <fileset dir="${lib}" includes="*.jar" />
    </path>

    <target name="all" depends="clean, init, compile, generate-ws, dist"/>

    <target name="clean">
        <delete dir="${classes}" />
        <delete file="${war.file}" />
        <delete dir="${conf}/wsdl" />
    </target>

    <target name="init">
        <mkdir dir="${classes}" />
        <mkdir dir="${conf}/wsdl" />
    </target>

    <target name="compile" depends="init">
        <javac srcdir="${src}" destdir="${classes}" classpathref="
app.classpath" source="1.5" />
    </target>

    <target name="generate-ws" depends="init, compile">
        <taskdef name="wsgen" classname="com.sun.tools.ws.ant.WsGen"
classpathref="app.classpath" />
        <wsgen destdir="${classes}" sei="
net.uniplac.tcc.segurancaws.services.AdministradorImpl" verbose="true"
genwsdl="true" resourcedestdir="${conf}/wsdl" classpathref="app.classpath"
/>
        <wsgen destdir="${classes}" sei="
net.uniplac.tcc.segurancaws.services.ClienteImpl" verbose="true"
genwsdl="true" resourcedestdir="${conf}/wsdl" classpathref="app.classpath"
/>
    </target>

    <target name="dist" depends="init, compile, generate-ws">
        <war destfile="${war.file}" webxml="${conf}/web.xml">
            <webinf dir="${conf}" />
            <lib dir="${lib}" />
            <classes dir="${classes}">
                <exclude name="**/*.java" />
            </classes>
        </war>
    </target>

    <target name="deploy" depends="dist">
        <copy file="${war.file}" todir="${deploy.dir}" />
    </target>

</project>

When i remove the genwsdl in the wsgen taks everything goes fine, but i have
the same problem in the server when his try to generate the wsdl file.
I am using the eclipse 3.2 and the last jar to a jaxb and jaxws, and i using
the toplink to ejb3
This is a problem with jaxb? How can i fixed?
Thanks for all help =)