Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: GroovyWS
-
Labels:None
-
Environment:Windows 2000 without JDK
-
Number of attachments :
Description
I try to integrate the Groovy WSClient into an application with and installed JRE.
Since the nature of this application it should be highly dynamic. So far everything is possible now thanks to groovy ![]()
The Problem is, that GroovyWS relies on JAXB and Apache CXF.
The Apache CXF depends on the JDK since it tries to compile the JAXB Java Files.
This Call is done true the org.apache.cxf.common.util.Compiler class.
Due the lack of the JDK on the machine I tried following.
1. Replace the org.apache.cxf.common.util.Compiler with a preloaded org.apache.cxf.common.util.Compiler.groovy
package org.apache.cxf.common.util;
import java.io.File;
<code>
public class Compiler
)/
public boolean internalCompile(String[] args, int sourceFileIndex) {
def jaxbIndexString =args[sourceFileIndex].replaceAll(/-src.*/,"-classes")File.separator"jaxb.index"
println jaxbIndexString
def jaxbIndex = new File(jaxbIndexString)
for (int i = sourceFileIndex;i<args.length;i++) {
jaxbIndex.withWriterAppend
def source = ""
new File(args[i]).eachLine
def replacedSource = source.replaceAll(regex)
{it.replaceAll(/\{/,'[').replaceAll(/\}/,']')} getClass().getClassLoader().parseClass(replacedSource)
}
false
}
}
</code>
(The Code is ugly and just a dirty hack
)
2. Convert the Bean Files for JAXB to Groovy conform Code. (This is the regex wich replaces the {} with [] in the annotations)
3. Additionally I tried to generate a jaxb.index file
4. Just parse these Files with the GroovyClassLoader (Same Loader that loads the cxf so the classes should be in the CLASSPATH)
The Problem is that I get everytime the java.lang.IllegalStateException: Unable to create JAXBContext for generated packages: "org.jbpm.api.task" doesnt contain ObjectFactory.class or jaxb.index Exception...
There should be a way to use GroovyWS without the javac...