Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Ejbs do not compile  RSS feed

 
Shashi Bhushan N
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Here are the errors i am encountering, i don't find any fault in the paths but still the ejb's do not compile where else can be the mistake?
JDK_HOME=F:\jdk1.3.1_02
J2EE_HOME=F:\j2sdkee1.3.1
classpath = .;F:\jdk1.3.1_02\bin;F:\jdk1.3.1_02\lib;F:\j2sdkee1.3.1\bin;F:\j2sdkee1.3.1\lib;F:\j2sdkee1.3.1\lib\j2ee.jar;g:\Blazix\Blazix.jar
path = .;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;F:\MSSQL7\BINN;F:\jdk1.3.1_02\bin;F:\j2sdkee1.3.1\bin;F:\j2sdkee1.3.1\lib;F:\j2sdkee1.3.1\lib\j2ee.jar;F:\MicoCorba\mico\win32-bin;g:\Blazix
***************The error is********************************************
G:\Downloads\EJBTutorial>javac -classpath c:\Stocks\StockQuotesEjb.jar SessionCl
ientSample.java
SessionClientSample.java:8: package javax.ejb does not exist
import javax.ejb.*;
^
SessionClientSample.java:34: cannot access javax.ejb.EJBHome
file javax\ejb\EJBHome.class not found
StockQuotes bean = home.create( stock );
^
SessionClientSample.java:36: cannot access javax.ejb.EJBObject
file javax\ejb\EJBObject.class not found
System.out.println( "Price = " + bean.getPrice());
^
3 errors
G:\Downloads\EJBTutorial>

Thank you and regards.
 
Amit KumarS
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi shashi..
i think u shud be putting

instead of j2ee.jar
Tell me if it works..
Thanks
Amit
 
Shashi Bhushan N
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi amit,
Its not possible since there is no file called "ejb.jar" in the particular directory. f:\j2sdkee1.3.1\lib.
regards.
 
Craig Jackson
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think your problem is that you are confusing the compiler, well not confusing the compiler, but i.e. You already have the classpath environment variable pointing to the j2ee.jar file, so all you have to do know is include any custom class files or archive files in order for SessionClientSample.java to compile and I assuming that is what StockQoutesEjb.jar is for, So I would try

Because when you do this . You are redefining the classpath environment variable at the command line.
Also one more thing, I don't think you need the references to the
\bin
directories in your classpath definition, because the only files that are in there are executables *.BAT files. These are for the %PATH% environment variable.
Try it.
Craig.
 
Shashi Bhushan N
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Craig,
If i am right the problem does not lie with c:\Stocks\StockQuotesEjb.jar
but rather it is with j2ee.jar, since the particular classes of javax.ejb.*; ie EJBHome, EJBObject etc .
are not being imported.
Because it is the same problem I encounter when I try to compile other EJBs.
Here I have used the Blazix server methods where the Blizzard does the work for me by creating the build.cmd file for compilation.And the above jar file is generated.
But when i create the Bean,remote and home methods myself and try to compile i get the import javax.ejb.*; not found error.
Including the /bin in the classpath was only out of frustration.
regards.
 
Shashi Bhushan N
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
things are going fine.
thank you.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!