aspose file tools*
The moose likes Web Services and the fly likes Expose EJB as webservice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Expose EJB as webservice" Watch "Expose EJB as webservice" New topic
Author

Expose EJB as webservice

Pam Theod
Greenhorn

Joined: Apr 19, 2006
Posts: 14
I am a newbie to webservice. I have an EJB and I want to expose that as wsdl. I have created an ant task build which uses servicegen. Some of the methods in my EJB returns hashtable, vector, user defined objects. When I run the build task I get this error.

Any help on this is greatly appreciated.

Here is my target in the build file


<target name="build">
<delete dir="${build}" />
<mkdir dir="${build}"/>
<copy todir="${build}" file="${ejbc_jar_file}"/>
<servicegen destEar="${build}/${ear_file}"
warName="${war_file}"
contextURI="webservice">
<service ejbJar="${build}/${ejbc_jar_file}"
targetNamespace="http://localhost:7012/combo/Combo"
serviceName="ComboService"
serviceURI="/ComboService"
generateTypes="True"
expandMethods="True"
style="document">
</service>
</servicegen>
</target>

<taskdef name="servicegen"
classname="weblogic.ant.taskdefs.webservices.servicegen.ServiceGenTask"
classpathref="classpath" />


this is the exception I get.

[servicegen] Could not process ejb-jar
[servicegen] at weblogic.ant.taskdefs.webservices.autotype.EJBAutoTyper.<init
>(EJBAutoTyper.java:73)
[servicegen] at weblogic.ant.taskdefs.webservices.servicegen.ServiceGenTask.r
unAutoTyper(ServiceGenTask.java:339)
[servicegen] at weblogic.ant.taskdefs.webservices.servicegen.ServiceGenTask.g
enerateService(ServiceGenTask.java:313)
[servicegen] at weblogic.ant.taskdefs.webservices.servicegen.ServiceGenTask.e
xecute(ServiceGenTask.java:181)
[servicegen] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
va:275)
[servicegen] at org.apache.tools.ant.Task.perform(Task.java:364)
[servicegen] at org.apache.tools.ant.Target.execute(Target.java:341)
[servicegen] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[servicegen] at org.apache.tools.ant.Project.executeSortedTargets(Project.jav
a:1216)
[servicegen] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)

[servicegen] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(De
faultExecutor.java:40)
[servicegen] at org.apache.tools.ant.Project.executeTargets(Project.java:1068
)
[servicegen] at org.apache.tools.ant.Main.runBuild(Main.java:668)
[servicegen] at org.apache.tools.ant.Main.startAnt(Main.java:187)
[servicegen] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
[servicegen] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
[servicegen] Caused by: java.util.zip.ZipException: The system cannot find the p
ath specified
[servicegen] at java.util.zip.ZipFile.open(Native Method)
[servicegen] at java.util.zip.ZipFile.<init>(ZipFile.java:111)
[servicegen] at java.util.jar.JarFile.<init>(JarFile.java:127)
[servicegen] at java.util.jar.JarFile.<init>(JarFile.java:92)
[servicegen] at weblogic.utils.jars.JarFileDelegate.<init>(JarFileDelegate.ja
va:35)
[servicegen] at weblogic.utils.jars.VirtualJarFactory.createVirtualJar(Virtua
lJarFactory.java:21)
[servicegen] at weblogic.application.ApplicationFileManager.getVirtualJarFile
(ApplicationFileManager.java:170)
[servicegen] at weblogic.ant.taskdefs.webservices.autotype.EJBAutoTyper.<init
>(EJBAutoTyper.java:68)
[servicegen] ... 15 more
[servicegen] --- Nested Exception ---
[servicegen] java.util.zip.ZipException: The system cannot find the path specifi
ed
[servicegen] at java.util.zip.ZipFile.open(Native Method)
[servicegen] at java.util.zip.ZipFile.<init>(ZipFile.java:111)
[servicegen] at java.util.jar.JarFile.<init>(JarFile.java:127)
[servicegen] at java.util.jar.JarFile.<init>(JarFile.java:92)
[servicegen] at weblogic.utils.jars.JarFileDelegate.<init>(JarFileDelegate.ja
va:35)
[servicegen] at weblogic.utils.jars.VirtualJarFactory.createVirtualJar(Virtua
lJarFactory.java:21)
[servicegen] at weblogic.application.ApplicationFileManager.getVirtualJarFile
(ApplicationFileManager.java:170)
[servicegen] at weblogic.ant.taskdefs.webservices.autotype.EJBAutoTyper.<init
>(EJBAutoTyper.java:68)
[servicegen] at weblogic.ant.taskdefs.webservices.servicegen.ServiceGenTask.r
unAutoTyper(ServiceGenTask.java:339)
[servicegen] at weblogic.ant.taskdefs.webservices.servicegen.ServiceGenTask.g
enerateService(ServiceGenTask.java:313)
[servicegen] at weblogic.ant.taskdefs.webservices.servicegen.ServiceGenTask.e
xecute(ServiceGenTask.java:181)
[servicegen] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
va:275)
[servicegen] at org.apache.tools.ant.Task.perform(Task.java:364)
[servicegen] at org.apache.tools.ant.Target.execute(Target.java:341)
[servicegen] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[servicegen] at org.apache.tools.ant.Project.executeSortedTargets(Project.jav
a:1216)
[servicegen] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)

[servicegen] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(De
faultExecutor.java:40)
[servicegen] at org.apache.tools.ant.Project.executeTargets(Project.java:1068
)
[servicegen] at org.apache.tools.ant.Main.runBuild(Main.java:668)
[servicegen] at org.apache.tools.ant.Main.startAnt(Main.java:187)
[servicegen] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
[servicegen] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)

BUILD FAILED
C:\eclipse\projects\web_services_new\build.xml:124: Could not process ejb-jar


Pam
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Expose EJB as webservice