> ..........
> public void ejecuta(String[] ops) {
>      java.lang.Runtime r = java.lang.Runtime.getRuntime();
>      try {
>         java.lang.Process p = r.exec(ops);
>      } catch (IOException x) {}
>   }
>
> The problem is r.exec is throwing NoClassDefFoundError. If I comment the
> line which creates the process it works fine.
> Could it be a memory problem in server? (I think if server is not
> capable of creating a new process, it should throw IOException, not
> NoClassDefFoundError). If I put Class.forName("java.lang.Process") at
> the end of servlet code, it doesn't throw ClassNotFoundException, so
> it's not a JVM configuration problem.
> Any idea? Is there a more ellegant way of making the same thing,
> whithout system calling?
>
> Sorry if this is a little bit off-topic.
> Thaks.
>
Hi,

try
import java.lang.Process;
import java.lang.Runtime;

in the import section of the servlet file. This should ensure that both
classes are unmasked for you.
You can then remove the java.lang. references. If this does not compile then
there is a class name clash somewhere
that could be causing your problems.

I tried compiling your code as is (with a harness to make it compile +
dummy cmds) and it compiled and worked.

Andy Bailey

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to