Hi,
We are rewriting the core of our generic web based ws client (I spoke about it here some
days ago) using a more standard and mantainable core based on JAX-WS and in particular on
WSContractConsumer runtime API.
We already done the most important steps of the job and all our test cases works
perfectly.
Now we are experincing problems when we deploy our apps (a seam ear) on jboss 4.0.5 with,
of course, jbossws from the svn trunk.
The problem is that WSContractConsumer doesn't generate .class file (but .java is
generated correctly) when used inside the jboss container. The same class used out of
container by our junit test case works perfectly.
Here is the init method of our class:
| public void init(String wsdlURL) {
| try {
| WSContractConsumer wsImporter = WSContractConsumer.newInstance();
| wsImporter.setGenerateSource(true);
| File outputDir = new File("/home/oracle/testImp/tmp/");
| wsImporter.setOutputDirectory(outputDir);
| wsImporter.setSourceDirectory(outputDir);
| String tagetPkg = "it.javalinux.ws";// + (new Random()).nextInt();
| wsImporter.setTargetPackage(tagetPkg);
| wsImporter.consume(wsdlURL);
|
|
| FilenameFilter filter = new FilenameFilter() {
| public boolean accept(File dir, String name) {
| return name.endsWith("Service.class");
| }
| };
| File scanDir = new File("/home/oracle/testImp/tmp/it/javalinux/ws/");
| System.out.println(scanDir);
| String[] a = scanDir.list();
| for (int i = 0; i < a.length; i++) {
| System.out.println(a);
|
| }
|
| String[] children = scanDir.list(filter);
| String className =null;
| if (children != null) {
| className = children[0].substring(0, children[0].length() - 6);
|
| }
|
| classLoader = new URLClassLoader(new URL[]{outputDir.toURL()},
Thread.currentThread().getContextClassLoader());
| //URLClassLoader classLoader = new URLClassLoader(new URL[]{outputDir.toURL()},
Thread.currentThread().getContextClassLoader());
| Thread.currentThread().setContextClassLoader(classLoader);
|
| serviceClass = JavaUtils.loadJavaType("it.javalinux.ws." + className ,
classLoader);
| service = serviceClass.newInstance();
| } catch (Exception e) {
| e.printStackTrace();
| }
| }
|
What's happen is, as already said, that we find only .java file in this directory and
not .class file. We don't get any exception from WSContractConsumer.
Any ideas?
Thanks in advance.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018523#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...