[groovy-user] GroovyWS and javac

瀏覽次數:18 次
跳到第一則未讀訊息

Schwame

未讀,
2008年3月27日 上午11:11:502008/3/27
收件者:Groovy Users
I wrote a web service client using GroovyWS on my linux box.
Everything works great. However, when I deploy the groovy script
to a windows xp box, i get the following error:

[ERROR] IOException during exec() of compiler "javac". Check your
path environment variable.

The odd thing is that javac is in my path, and both JAVA_HOME and
GROOVY_HOME are set correctly. I've also tried with both JDK1.5
and JDK1.6, but get the same error. Below is a transcript of my
windows console.

Any help would be greatly appreciated.

Thanks in advance.

Sincerely,
Jeff Schwartz

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\>cd monitoring\test-web-service

C:\monitoring\test-web-service>javac -version
javac 1.5.0_15
javac: no source files
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are u
sed
-classpath <path> Specify where to find user class files
-cp <path> Specify where to find user class files
-sourcepath <path> Specify where to find input source files
-bootclasspath <path> Override location of bootstrap class files
-extdirs <dirs> Override location of installed extensions
-endorseddirs <dirs> Override location of endorsed standards path
-d <directory> Specify where to place generated class files
-encoding <encoding> Specify character encoding used by source files
-source <release> Provide source compatibility with specified release

-target <release> Generate class files for specific VM version
-version Version information
-help Print a synopsis of standard options
-X Print a synopsis of nonstandard options
-J<flag> Pass <flag> directly to the runtime system


C:\monitoring\test-web-service>groovy --version
Groovy Version: 1.5.4 JVM: 1.5.0_15-b04

C:\monitoring\test-web-service>groovy TestWebServiceCall.groovy
[ERROR] IOException during exec() of compiler "javac". Check your path environme
nt variable.
Mar 27, 2008 8:50:21 AM org.apache.cxf.endpoint.dynamic.DynamicClientFactory cre
ateClient
SEVERE: Could not compile java files for http://webapps/cityemail?wsdl.
java.lang.IllegalStateException: Unable to create JAXBContext for generated pack
ages: "org.openuri" doesnt contain ObjectFactory.class or jaxb.index
at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(Dyn
amicClientFactory.java:246)
at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(Dyn
amicClientFactory.java:143)
at groovyx.net.ws.WSClient.<init>(WSClient.java:126)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at org.codehaus.groovy.runtime.MetaClassHelper.doConstructorInvoke(MetaC
lassHelper.java:528)
at groovy.lang.MetaClassImpl.doConstructorInvoke(MetaClassImpl.java:2347
)
at groovy.lang.MetaClassImpl.invokeConstructor(MetaClassImpl.java:1244)
at groovy.lang.MetaClassImpl.invokeConstructor(MetaClassImpl.java:1174)
at org.codehaus.groovy.runtime.InvokerHelper.invokeConstructorOf(Invoker
Helper.java:805)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeNewN(ScriptBy
tecodeAdapter.java:227)
at TestWebServiceCall.run(TestWebServiceCall.groovy:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:
86)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHel
per.java:777)
at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.
java:757)
at org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper.jav
a:402)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:
86)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1094)

at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.
java:748)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(Scrip
tBytecodeAdapter.java:167)
at TestWebServiceCall.main(TestWebServiceCall.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:
86)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1094)

at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.
java:748)
at groovy.lang.GroovyShell.runMainOrTestOrRunnable(GroovyShell.java:244)

at groovy.lang.GroovyShell.run(GroovyShell.java:218)
at groovy.lang.GroovyShell.run(GroovyShell.java:147)
at groovy.ui.GroovyMain.processOnce(GroovyMain.java:493)
at groovy.ui.GroovyMain.run(GroovyMain.java:308)
at groovy.ui.GroovyMain.process(GroovyMain.java:294)
at groovy.ui.GroovyMain.processArgs(GroovyMain.java:111)
at groovy.ui.GroovyMain.main(GroovyMain.java:92)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java
:101)
at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130)
Caused by: javax.xml.bind.JAXBException: "org.openuri" doesnt contain ObjectFact
ory.class or jaxb.index
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:
127)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:132)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:285)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)
at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(Dyn
amicClientFactory.java:243)
... 56 more

C:\monitoring\test-web-service>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Jochen Theodorou

未讀,
2008年3月27日 中午12:39:462008/3/27
收件者:us...@groovy.codehaus.org
Schwame schrieb:

> I wrote a web service client using GroovyWS on my linux box.
> Everything works great. However, when I deploy the groovy script
> to a windows xp box, i get the following error:
>
> [ERROR] IOException during exec() of compiler "javac". Check your
> path environment variable.
>
> The odd thing is that javac is in my path, and both JAVA_HOME and
> GROOVY_HOME are set correctly. I've also tried with both JDK1.5
> and JDK1.6, but get the same error. Below is a transcript of my
> windows console.
[...]

> C:\monitoring\test-web-service>groovy --version
> Groovy Version: 1.5.4 JVM: 1.5.0_15-b04
>
> C:\monitoring\test-web-service>groovy TestWebServiceCall.groovy
> [ERROR] IOException during exec() of compiler "javac". Check your path environme
> nt variable.
> Mar 27, 2008 8:50:21 AM org.apache.cxf.endpoint.dynamic.DynamicClientFactory cre
> ateClient
> SEVERE: Could not compile java files for http://webapps/cityemail?wsdl.
> java.lang.IllegalStateException: Unable to create JAXBContext for generated pack
> ages: "org.openuri" doesnt contain ObjectFactory.class or jaxb.index

I think it is not so much an issue of not finding javac, but an error
javac produces when being run.

This looks very much like
http://java.sun.com/javase/6/docs/api/javax/xml/bind/JAXBContext.html#newInstance(java.lang.String)

this lets me believe that no schema or a wrong schema is used, also the
package should not have been org.openuri, but
org.openuri.webapps.citymail. I am not expert on these things, so I
can't tell for sure

bye blackdrag

--
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/
http://www.g2one.com/

Schwame

未讀,
2008年3月27日 下午2:17:432008/3/27
收件者:us...@groovy.codehaus.org
Thanks for the information. My groovy script works "as is" when I'm
calling it from linux. For grins I tried the currency rate calculator
from the GroovyWS webpage (http://groovy.codehaus.org/GroovyWS)

Again, from linux it works perfectly. I get the same error in windows.
The windows console is below.

javac is in the path, JAVA_HOME and GROOVY_HOME are both set. I
think that something else in groovy is not setup, but I'm not
sure where to look. The groovy-ws jar file is in the .groovy/lib
directory.

Any thoughts?

C:\monitoring\test-web-service>groovy GroovyWSExample.groovy
Mar 27, 2008 1:12:46 PM org.apache.cxf.endpoint.dynamic.DynamicClientFactory add
Schemas
INFO: Loading the JAXB 2.1 simple binding for client.
Mar 27, 2008 1:12:48 PM org.apache.cxf.endpoint.dynamic.DynamicClientFactory out
putDebug
INFO: Created classes: net.webservicex.ConversionRate, net.webservicex.Conversio
nRateResponse, net.webservicex.Currency, net.webservicex.ObjectFactory


[ERROR] IOException during exec() of compiler "javac". Check your path environme
nt variable.

Mar 27, 2008 1:12:48 PM org.apache.cxf.endpoint.dynamic.DynamicClientFactory cre
ateClient
SEVERE: Could not compile java files for http://www.webservicex.net/CurrencyConv
ertor.asmx?WSDL.


java.lang.IllegalStateException: Unable to create JAXBContext for generated pack

ages: "net.webservicex" doesnt contain ObjectFactory.class or jaxb.index


at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(Dyn
amicClientFactory.java:246)
at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(Dyn
amicClientFactory.java:143)
at groovyx.net.ws.WSClient.<init>(WSClient.java:126)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at org.codehaus.groovy.runtime.MetaClassHelper.doConstructorInvoke(MetaC
lassHelper.java:528)
at groovy.lang.MetaClassImpl.doConstructorInvoke(MetaClassImpl.java:2347
)
at groovy.lang.MetaClassImpl.invokeConstructor(MetaClassImpl.java:1244)
at groovy.lang.MetaClassImpl.invokeConstructor(MetaClassImpl.java:1174)
at org.codehaus.groovy.runtime.InvokerHelper.invokeConstructorOf(Invoker
Helper.java:805)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeNewN(ScriptBy
tecodeAdapter.java:227)

at GroovyWSExample.run(GroovyWSExample.groovy:4)

at GroovyWSExample.main(GroovyWSExample.groovy)

Caused by: javax.xml.bind.JAXBException: "net.webservicex" doesnt contain Object


Factory.class or jaxb.index
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:
127)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:132)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:285)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)
at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(Dyn
amicClientFactory.java:243)
... 56 more

C:\monitoring\test-web-service>

---------------------------------------------------------------------

回覆所有人
回覆作者
轉寄
0 則新訊息