This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes error while running Client in Eclipse helios Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "error while running Client in Eclipse helios" Watch "error while running Client in Eclipse helios" New topic
Author

error while running Client in Eclipse helios

shriram iyer
Ranch Hand

Joined: Dec 10, 2003
Posts: 43
Greetings,

i am trying to run a stateful session bean program.
after starting the jboss server from eclipse helios,when i try to run the Client.java,i am getting following error



Exception occurred executing command line.
Cannot run program "C:\Program Files\Java\jdk1.6.0_24\bin\javaw.exe" (in directory "H:\eclipse-jee-helios-SR1-win32\eclipse\storeprograms\Trialone"): CreateProcess error=87, The parameter is incorrect



i am using JRE 6,Jboss 6.

cheers
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

Have you set up run options for your client? If so, what are they? It appears that one of the options could be misspelled and thus the JVM does not recognize it.


JBoss In Action
shriram iyer
Ranch Hand

Joined: Dec 10, 2003
Posts: 43
following is my eclipse.ini



-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.2.R36x_v20101222
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m




cheers
shriram iyer
Ranch Hand

Joined: Dec 10, 2003
Posts: 43
i want to run below client program in eclipse helios
what is the procedure


import com.sess.*;
import java.util.*;
import javax.ejb.*;
import javax.naming.*;
import javax.rmi.*;
public class Client
{
public static void main(String ar[])
{
try
{
Properties p=new Properties();
p.put(InitialContext.PROVIDER_URL, "jnp://localhost:1099");
p.put(InitialContext.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
p.put(InitialContext.URL_PKG_PREFIXES,"org.jboss.namingrg.jnp.interfaces");
Context ctx = new InitialContext(p);
Object ref=ctx.lookup("SessBean/home");
SessBeanLocal h=(SessBeanLocal)PortableRemoteObject.narrow(ref,SessBeanLocal.class);
SessBeanRemote bean = h.create("hello");
System.out.println(bean.display());

}
catch(Exception e)
{
e.printStackTrace();
}
}
}


i am trying to run Ejb 2.1 stateful session bean

cheers
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

I asked about run options for your app, not for Eclipse.

The code you posted, is that in its own project? If so, right-click the source file and select Run As | Java Application.
shriram iyer
Ranch Hand

Joined: Dec 10, 2003
Posts: 43
The code i posted,is that in its own project

but when i run it is as a java application it shows following error



Exception occurred executing command line.
Cannot run program "C:\Program Files\Java\jdk1.6.0_24\bin\javaw.exe" (in directory "H:\eclipse-jee-helios-SR1-win32\eclipse\storeprograms\Trialone"): CreateProcess error=87, The parameter is incorrect



cheers
Sumit Bisht
Ranch Hand

Joined: Jul 02, 2008
Posts: 329

See http://eclipsecoding.wikidot.com/faq#launchError for details.
The max command prompt line length in windows xp is 8191 characters. You'll have to shorten your CLASSPATH variable, it seems.
shriram iyer
Ranch Hand

Joined: Dec 10, 2003
Posts: 43
Regarding


C:\Program Files\Java\jdk1.6.0_24\bin\javaw.exe" (in directory "H:\eclipse-jee-helios-SR1-win32\eclipse\storeprograms\Trialone"



jre classpath i have not changed and tried out.

i changed that H:\eclipse-jee-helios-SR1-win32\eclipse\storeprograms\Trialone to H:\eclipse\storeprograms\Trialone

still it is giving same error

if have to change jre classpath i have to ensure smooth working of all applications depending on jre.Are you advising me to change jre path?.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

Look in the Eclipse log to see if there is more information about this. The log is at workspace/.metadata/.log

How big is the classpath for this app? How many JARs are in it and how deeply are the JARs nested within the directory structure? Googling the error indicates that the command is too long to be issued and that usually means that the classpath is too long.
shriram iyer
Ranch Hand

Joined: Dec 10, 2003
Posts: 43
now i shortened the jdk classpath still i get following error



Exception occurred executing command line.
Cannot run program "D:\jdk\bin\javaw.exe" (in directory "H:\eclipse\s\T"): CreateProcess error=87, The parameter is incorrect


cheers
shriram iyer
Ranch Hand

Joined: Dec 10, 2003
Posts: 43
problem resolved

instead of including entire jboss library i included j2ee 1.4 libraries (jboss tools)

thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: error while running Client in Eclipse helios
 
Similar Threads
Error in program
deploy ejb in jboss
Injection of EJB in POJO class not working..
integrating struts and spring
Java Program on Amazon EC2