ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: a question about pass parameter to java
Date Fri, 06 Dec 2002 08:27:25 GMT
java -Djava.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
-Djava.naming.provider.url=t3://localhost:7001 examples.HelloClient

==>

<java classname="examples.HelloClient">
    <jvmarg
value="-Djava.naming.factory.initial=weblogic.jndi.WLInitialContextFactory"
/>
    <jvmarg value="-Djava.naming.provider.url=t3://localhost:7001" />
</java>


For more information see the manual. (CoreTask | java)


Jan Matèrne


> -----Urspr√ľngliche Nachricht-----
> Von: ZHOU,SHENG (HP-China,ex2) [mailto:zhou.sheng@hp.com]
> Gesendet am: Freitag, 6. Dezember 2002 09:23
> An: Ant Users List
> Betreff: a question about pass parameter to java
> 
>  Hi, guys ! I am a newbie for ant .
> 
> I meet a problem when I use ant ,pls help me !
> If I input command to run java class(which is HelloClient , a 
> very simple
> program)
>  
> java -Djava.naming.factory.initial=weblogic.jndi.WLInitialContextF
> actory -Djava.naming.provider.url=t3://localhost:7001 
> examples.HelloClient
> The output is OK as followed: Hello, World!
>  But When I use build.xml the related part is as followed: 
> <target name="run">
>    <java classname="examples.HelloClient" fork="yes" 
> failonerror="true">
>        <arg value="t3://localhost:7001"/>
>        <classpath>
>           <pathelement path="${classpath};${deploy}/MyHello.jar"/>
>        </classpath>            
>    </java>
> </target>
> 
> When I input : ant run 
> 
> the output is as followed: 
> 
> Buildfile: build.xml
> 
> run:
>      [java] javax.naming.CommunicationException: Can't find
> SerialContextProvider
>      [java]     at
> com.sun.enterprise.naming.SerialContext.getProvider(SerialCont
> ext.java:66)
>      [java]     at
> com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:154)
>      [java]     at
> javax.naming.InitialContext.lookup(InitialContext.java:347)
>      [java]     at examples.HelloClient.main(Unknown Source)
>      [java] Exception in thread "main"
> 
> BUILD FAILED
> file:C:/Temp/Hello/build.xml:49: Java returned: 1
> 
> Total time: 8 seconds
> 
> It look like the parameter is incorrectly pass to shell not java.exe .
> 
>  
> 
>  
> 
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message