Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1524
  • Last Modified:

entity bean ...

Hi Experts,

    I created an entity bean from a MS Access database using Blazix12. I got three  java(tm) files and a script. However, I couldn't compile any of them. So .... why is that ? Am I supposed to compile a bean ? the following are the java files ....
please help ! Thanks !

meow.

----------------------------
// Props.java

package props;
// File generated by Desiderata Software's Blazix entity bean wizard
// Sun Sep 05 01:25:59 PDT 2004

// Remote interface for entity bean "Props"


import javax.ejb.*;
import java.rmi.*;

public interface Props extends javax.ejb.EJBObject {
      java.lang.String getKey() throws java.rmi.RemoteException;
      java.lang.String getValue() throws java.rmi.RemoteException;
      void setValue( java.lang.String value ) throws java.rmi.RemoteException;
      // TBD:  Add any additional remote method interfaces
      //

}
-------------------------
// PropsBean

package props;
// File generated by Desiderata Software's Blazix entity bean wizard
// Sun Sep 05 01:25:59 PDT 2004

// Bean class for entity bean "Props"


import javax.ejb.*;
import javax.naming.*;
import java.rmi.*;

public class PropsBean implements javax.ejb.EntityBean {

      //Instance member variables.
      //
      public java.lang.String key = null;
      public java.lang.String value = null;

      // Entity context, can be used to obtain handles etc
      //

      javax.ejb.EntityContext ejbEntityContext = null;

      //Getter/setter methods
      //

      public java.lang.String getKey() throws java.rmi.RemoteException
      {
            return key;
      }

      public java.lang.String getValue() throws java.rmi.RemoteException
      {
            return value;
      }

      public void setValue( java.lang.String value ) throws java.rmi.RemoteException
      {
            this.value = value;
      }

      // TBD:  Add implementations for any additional remote method interfaces
      //

      // The default ejbCreate method.
      //

      public java.lang.String ejbCreate(
                  java.lang.String key,
                  java.lang.String value
                  )
            throws javax.ejb.CreateException, java.rmi.RemoteException
      {
            this.key = key;
            this.value = value;
            return null;
      }

      // TBD:  If any other ejbCreate's are added manually to the home interface, define them.
      //

      // Other methods required in an entity bean
      //

      public void setEntityContext( javax.ejb.EntityContext ejbEntityContext )
            throws RemoteException
      {
            this.ejbEntityContext = ejbEntityContext;
      }

      public void unsetEntityContext()
            throws RemoteException
      {
            this.ejbEntityContext = null;
      }

      public void ejbPostCreate(

                  java.lang.String key,
                  java.lang.String value
                  )
      {
      // TBD:  Do any post-instance-creation processing here
      }

      public void ejbRemove()
            throws java.rmi.RemoteException, javax.ejb.RemoveException
      {
      // TBD:  Do any processing here when instance is being removed
      }

      public void ejbActivate()
            throws java.rmi.RemoteException
      {
      // TBD:  Do any processing here when instance is activated
      }

      public void ejbPassivate()
            throws java.rmi.RemoteException
      {
      // TBD:  Do any processing here when instance is being passivated
      }

      public void ejbLoad()
            throws java.rmi.RemoteException
      {
      // TBD:  Load any data needed by instance
      //       in addition to the container-managed data.
      }

      public void ejbStore()
            throws java.rmi.RemoteException
      {
      // TBD:  Store any data used by instance
      //       in addition to the container-managed data.
      }

}
-------------------------------
// PropsHome

package props;
// File generated by Desiderata Software's Blazix entity bean wizard
// Sun Sep 05 01:25:59 PDT 2004

// Home interface for entity bean "Props"


import javax.ejb.*;
import java.rmi.*;
import java.util.*;

public interface PropsHome extends javax.ejb.EJBHome {
      Props create(
                  java.lang.String key,
                  java.lang.String value
                  ) throws javax.ejb.CreateException, java.rmi.RemoteException;

      Props findByPrimaryKey( java.lang.String pkey ) throws javax.ejb.FinderException, java.rmi.RemoteException;


}
0
meow00
Asked:
meow00
  • 24
  • 14
  • 11
  • +2
2 Solutions
 
CEHJCommented:
What is the script btw?
0
 
objectsCommented:
Make sure you have a j2ee jar in your classpath, either from installing J2EE or from your container.
0
 
sompol_kiatkamolchaiCommented:
What is the error when compiling?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
meow00Author Commented:
Hi CEHJ,

    This is the script:

javac -d "C:\Documents and Settings\Meow\Ejbtut" "C:\Documents and Settings\Meow\Ejbtut\PropsHome.java" "C:\Documents and Settings\Meow\Ejbtut\Props.java" "C:\Documents and Settings\Meow\Ejbtut\PropsBean.java" jar -cvf Props.jar -C "C:\Documents and Settings\Meow\Ejbtut" META-INF/ejb-jar.xml  "props/PropsHome.class" "props/Props.class" "props/PropsBean.class"
blxejbc Props.jar PropsEjb.jar

------------------------------------------------------------------------
Hi object,

    Where to check the classpath ? I am not sure whether I have installed J2EE .. how do I check this ?

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

Hi sompol_kiatkamolchai,

Ejbtut/Props.java [8:1] package javax.ejb does not exist
import javax.ejb.*;
^
Ejbtut/Props.java [11:1] package javax.ejb does not exist
public interface Props extends javax.ejb.EJBObject {
                                        ^
2 errors
Errors compiling Props.
0
 
sompol_kiatkamolchaiCommented:
It'sure that you don't have library(j2ee.jar). I will find the link for you to download.
0
 
sompol_kiatkamolchaiCommented:
0
 
sompol_kiatkamolchaiCommented:
After installing, please find j2ee.jar and include to classpath.
0
 
meow00Author Commented:
Hi sompol_kiatkamolchai & experts,

    I have j2ee.jar at C:\j2sdkee1.3\lib
 It is version 1.3 rather than version 1.4. Can I use this one ? Thanks !
0
 
meow00Author Commented:
Hi Experts,

   I checked my computer, and I do have my setting as :
---------------------------------------------------------------------
path :
C:\j2sdkee1.3\bin; C:\jdk1.3.1\bin; C:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin;

&

CLASSPATH :
.;%J2EE_HOME%\lib\j2ee.jar;%J2EE_HOME%\lib\locale
--------------------------------------------------

 Did I make any mistake in the setting ? Thanks !
0
 
sompol_kiatkamolchaiCommented:
Your script may set a new classpath to CLASSPATH variable.
Try to modify script to

javac -classpath="c:\j2sdkee1.3\lib\j2ee.jar" -d "C:\Documents and Settings\Meow\Ejbtut" "C:\Documents and Settings\Meow\Ejbtut\PropsHome.java" "C:\Documents and Settings\Meow\Ejbtut\Props.java" "C:\Documents and Settings\Meow\Ejbtut\PropsBean.java" jar -cvf Props.jar -C "C:\Documents and Settings\Meow\Ejbtut" META-INF/ejb-jar.xml  "props/PropsHome.class" "props/Props.class" "props/PropsBean.class"
blxejbc Props.jar PropsEjb.jar

I add -classpath="c:\j2sdkee1.3\lib\j2ee.jar" to javac
0
 
meow00Author Commented:
err ..... I tried to change the script to the above one ... but I still get the same errors ......
..... what else should I check now ? please help !!!

 meow ....
0
 
Mayank SAssociate Director - Product EngineeringCommented:
>> CLASSPATH :
>> .;%J2EE_HOME%\lib\j2ee.jar;%J2EE_HOME%\lib\locale

And what is J2EE_HOME set to?
0
 
meow00Author Commented:
Hi,

   Here they are :

J2EE_HOME : C:\j2sdkee1.3
JAVA_HOME : C:\jdk1.3.1
0
 
sompol_kiatkamolchaiCommented:
Try to narrow down the problem. To make sure that the problem is not from script. Try to compile it manually file by file, and to make sure that it is not the problem from single space in path copy *.java to a new folder e.g. temp

-go to command prompt c:\temp
-c:\temp\>set classpath=%classpath%;c:\j2sdkee1.3\lib\j2ee.jar
-c:\temp\>javac Props.java

and see what is the output?

0
 
sompol_kiatkamolchaiCommented:
Yes. J2EE_HOME should set to c:\j2sdkee1.3. You head to the right way.
0
 
Mayank SAssociate Director - Product EngineeringCommented:
>> CLASSPATH
>> .;%J2EE_HOME%\lib\j2ee.jar;%J2EE_HOME%\lib\locale

Try making it:

%J2EE_HOME%\lib\j2ee.jar;%J2EE_HOME%\lib\locale;.
0
 
meow00Author Commented:
Hi sompol_kiatkamolchai & experts,

   It seems that the problem is in PropsHome.java ..... I compiled it manually, and the following is the output ....
So ... how do I fix this problem ??? Thanks a lot !
---------------------------------------------------------------------
C:\Documents and Settings\meow\temp>dir
 Volume in drive C has no label.
 Volume Serial Number is 0000-042C

 Directory of C:\Documents and Settings\meow\temp

2004/09/05  &#19979;&#21320; 09:24    <DIR>          .
2004/09/05  &#19979;&#21320; 09:24    <DIR>          ..
2004/09/05  &#19978;&#21320; 01:25               531 Props.java
2004/09/05  &#19978;&#21320; 01:25             2,552 PropsBean.java
2004/09/05  &#19978;&#21320; 01:25               542 PropsHome.java
               3 File(s)          3,625 bytes
               2 Dir(s)  16,670,085,120 bytes free

C:\Documents and Settings\meow\temp>set classpath=%classpath%;c:\j2sdkee1.3\lib\j2ee.jar
C:\Documents and Settings\meow\temp>javac Props.java
C:\Documents and Settings\meow\temp>dir
 Volume in drive C has no label.
 Volume Serial Number is 0000-042C

 Directory of C:\Documents and Settings\meow\temp

2004/09/05  &#19979;&#21320; 09:25    <DIR>          .
2004/09/05  &#19979;&#21320; 09:25    <DIR>          ..
2004/09/05  &#19979;&#21320; 09:25               299 Props.class
2004/09/05  &#19978;&#21320; 01:25               531 Props.java
2004/09/05  &#19978;&#21320; 01:25             2,552 PropsBean.java
2004/09/05  &#19978;&#21320; 01:25               542 PropsHome.java
               4 File(s)          3,924 bytes
               2 Dir(s)  16,670,081,024 bytes free

C:\Documents and Settings\meow\temp>javac PropsBean.java
C:\Documents and Settings\meow\temp>javac PropsHome.java
PropsHome.java:13: cannot resolve symbol
symbol  : class Props
location: interface props.PropsHome
        Props create(
        ^
PropsHome.java:18: cannot resolve symbol
symbol  : class Props
location: interface props.PropsHome
        Props findByPrimaryKey( java.lang.String pkey ) throws javax.ejb.FinderE
xception, java.rmi.RemoteException;
        ^
2 errors
0
 
sompol_kiatkamolchaiCommented:
Change
C:\Documents and Settings\meow\temp>set classpath=%classpath%;c:\j2sdkee1.3\lib\j2ee.jar
to
C:\Documents and Settings\meow\temp>set classpath=.;%classpath%;c:\j2sdkee1.3\lib\j2ee.jar

If there are still error, dump Props.java, I think there is error from package name.
0
 
meow00Author Commented:
Hi sompol_kiatkamolchai,

   there are still errors as follows ..... so ... is there still a way to fix it ? Thanks !


-------------------------------------------------------------------------
C:\Documents and Settings\meow\temp>set classpath=.;%classpath%;c:\j2sdkee1.3\lib\j2ee.jar
C:\Documents and Settings\meow\temp>javac PropsHome.java
PropsHome.java:13: cannot resolve symbol
symbol  : class Props
location: interface props.PropsHome
        Props create(
        ^
PropsHome.java:18: cannot resolve symbol
symbol  : class Props
location: interface props.PropsHome
        Props findByPrimaryKey( java.lang.String pkey ) throws javax.ejb.FinderE
xception, java.rmi.RemoteException;
        ^
2 errors
0
 
sompol_kiatkamolchaiCommented:
please dump Props.java and PropsHome.java, I think there are missing import statement or package name not defined in Props.java
0
 
sompol_kiatkamolchaiCommented:
There should be  
C:\Documents and Settings\meow\temp\props\Props.class

If not, I think there are no, or missing package name in Props.java

Open Props.java and see in the header there should be something like this

package props;
0
 
meow00Author Commented:
Thanks for the info ...

   so what does it mean by "dump Props.java and PropsHome.java" ? does it mean delete or something else ?

 also here is Props.java :
---------------------------------------------------------
package props;
// File generated by Desiderata Software's Blazix entity bean wizard
// Sun Sep 05 01:25:59 PDT 2004

// Remote interface for entity bean "Props"

import javax.ejb.*;
import java.rmi.*;

public interface Props extends javax.ejb.EJBObject {
      java.lang.String getKey() throws java.rmi.RemoteException;
      java.lang.String getValue() throws java.rmi.RemoteException;
      void setValue( java.lang.String value ) throws java.rmi.RemoteException;
      // TBD:  Add any additional remote method interfaces
      //

}
-------------------
 please help !!! Thanks !!!
0
 
sompol_kiatkamolchaiCommented:
dump mean paste or post to this question. :)

Your code looks fine. Could you please post all files? I think the answer almost come.
0
 
sompol_kiatkamolchaiCommented:
OK. I see you source in the question, I will try to compile too.
0
 
sompol_kiatkamolchaiCommented:
!! I can compile it.
0
 
objectsCommented:
> C:\Documents and Settings\meow\temp

your source code is in the wrong directory, as you are using the package props it needs to be a props directory.

Try renaming temp to props, so you code is then in:

C:\Documents and Settings\meow\props

and add C:\Documents and Settings\meow\ to your classpath
0
 
sompol_kiatkamolchaiCommented:
C:\Documents and Settings\sompol\temp>dir
 Volume in drive C has no label.
 Volume Serial Number is DCD9-B5B7

 Directory of C:\Documents and Settings\sompol\temp

09/06/2004  12:47 PM    <DIR>          .
09/06/2004  12:47 PM    <DIR>          ..
09/06/2004  12:42 PM               551 Props.java
09/06/2004  12:42 PM             2,996 PropsBean.java
09/06/2004  12:43 PM               586 PropsHome.java
               3 File(s)          4,133 bytes
               2 Dir(s)  23,759,470,592 bytes free

C:\Documents and Settings\sompol\temp>set classpath=.;C:\Sun\AppServer\lib\j2ee.
jar

C:\Documents and Settings\sompol\temp>javac *.java

C:\Documents and Settings\sompol\temp>dir
 Volume in drive C has no label.
 Volume Serial Number is DCD9-B5B7

 Directory of C:\Documents and Settings\sompol\temp

09/06/2004  12:47 PM    <DIR>          .
09/06/2004  12:47 PM    <DIR>          ..
09/06/2004  12:47 PM               299 Props.class
09/06/2004  12:42 PM               551 Props.java
09/06/2004  12:47 PM             1,470 PropsBean.class
09/06/2004  12:42 PM             2,996 PropsBean.java
09/06/2004  12:47 PM               393 PropsHome.class
09/06/2004  12:43 PM               586 PropsHome.java
               6 File(s)          6,295 bytes
               2 Dir(s)  23,759,466,496 bytes free

C:\Documents and Settings\sompol\temp>
0
 
sompol_kiatkamolchaiCommented:
type set classpath

c:\....>set classpath

and paste the output here. I think you may not include . to classpath
0
 
objectsCommented:
>  I think you may not include . to classpath

Not necessary if you include the location of the source tree as I specified above
0
 
meow00Author Commented:
Hi sompol_kiatkamolchai & experts,

 here it is :

C:\Documents and Settings\meow\temp>set classpath
CLASSPATH=.;C:\j2sdkee1.3\lib\j2ee.jar;C:\j2sdkee1.3\lib\locale

thanks.
0
 
meow00Author Commented:
okay .... it seems that :

If I compile the code seperately, it won't work ....
i.e.  javac  Props.java ; javac PropsBean.java; javac PropsHome.java

But if I do javac *.java .... it works !!! (anyone happen to know why ?)

thanks very much for all your helps !

Thanks a lot !
0
 
sompol_kiatkamolchaiCommented:
Did you get Props.class after compiling? Try and check it again.

C:\Documents and Settings\sompol\temp>del *.class

C:\Documents and Settings\sompol\temp>javac Props.java

C:\Documents and Settings\sompol\temp>dir
 Volume in drive C has no label.
 Volume Serial Number is DCD9-B5B7

 Directory of C:\Documents and Settings\sompol\temp

09/06/2004  01:46 PM    <DIR>          .
09/06/2004  01:46 PM    <DIR>          ..
09/06/2004  01:46 PM               299 Props.class  <-- Please check after compiling Props.java, it must have this file
09/06/2004  12:42 PM               551 Props.java
09/06/2004  12:42 PM             2,996 PropsBean.java
09/06/2004  12:43 PM               586 PropsHome.java
               4 File(s)          4,432 bytes
               2 Dir(s)  23,757,373,440 bytes free
0
 
Mayank SAssociate Director - Product EngineeringCommented:
As long as you're compiling in the correct order, I don't see an issue with it. Exactly which order did you compile them separately?
0
 
objectsCommented:
Have you changed the name of the directory your files are in as I mentioned above?

add then add C:\Documents and Settings\meow\ to your classpath

> If I compile the code seperately, it won't work ....

The above changes will fix that.
0
 
Mayank SAssociate Director - Product EngineeringCommented:
I think the Props.class will get created in a props folder.
0
 
sompol_kiatkamolchaiCommented:
By default, after compiling,java compiler will generate .class in that directory if we don't specify output dir.
And when we try to compile PropsHome.java it refers to Props.class that should be in sub folder props.
0
 
Mayank SAssociate Director - Product EngineeringCommented:
>> after compiling,java compiler will generate .class in that directory if we don't specify output dir

What I meant was that, since the package-name is props, it should be: root/props/Props.class
0
 
sompol_kiatkamolchaiCommented:
Try this

javac -d . Props.java
javac -d . PropsBean.java
javac -d . PropsHome.java

It will automatically create folder as package name specified.
0
 
sompol_kiatkamolchaiCommented:
Yes. We mention to the same thing but I don't copy from you. I posted it just after you 4 seconds.
0
 
Mayank SAssociate Director - Product EngineeringCommented:
>>  but I don't copy from you.

I know ;-)
0
 
objectsCommented:
> since the package-name is props, it should be: root/props/Props.class

Already mentioned that a couple of times earlier.

> javac -d . Props.java

-d option is unnecessary unless you want to put the classes in a seperate directory, which I don't think is the case here.
0
 
Mayank SAssociate Director - Product EngineeringCommented:
>> Already mentioned that a couple of times earlier.

I was answering to:

>> Please check after compiling Props.java, it must have this file

I meant that it should be in a props folder.
0
 
sompol_kiatkamolchaiCommented:
>javac -d . Props.java
It's just adhoc solution for this question because when I use
javac Props.java
it creates Props.class at the same directory Props.java
So If we don't specify, we would move it manually.
0
 
objectsCommented:
Heres some background for you:

http://mindprod.com/jgloss/classpath.html
0
 
objectsCommented:
> It's just adhoc solution for this question

Better to fix it properly :)
0
 
meow00Author Commented:
Hi sompol_kiatkamolchai & experts,

     I do have *.class for every *.java file if I do javac *.java. However, it does not work if I compile them one by one. Also, they just can't compile using .netbean.

Hi object,

    I did change temp to props and include the classpath. It works fine if I try to compile using javac  *.java, but it didn't work if I try to compile it one by one.... it refuses to work in the .netbean as well ...
0
 
objectsCommented:
> I did change temp to props and include the classpath

post the current directory structure and your classpath.
0
 
sompol_kiatkamolchaiCommented:
Do you try

javac -d . Props.java
javac -d . PropsBean.java
javac -d . PropsHome.java
0
 
meow00Author Commented:
Hi Experts,

   Here is the directories :
-------------------------------------------------------------
C:\Documents and Settings\meow\My Documents\Ejbtut>dir
 Volume in drive C has no label.
 Volume Serial Number is 0000-042C

 Directory of C:\Documents and Settings\meow\My Documents\Ejbtut

2004/09/06  &#19978;&#21320; 12:37    <DIR>          .
2004/09/06  &#19978;&#21320; 12:37    <DIR>          ..
2004/09/05  &#19978;&#21320; 06:02               340 .nbattrs
2004/09/05  &#19979;&#21320; 08:57               515 build.cmd
2004/09/05  &#19978;&#21320; 01:25    <DIR>          META-INF
2004/09/05  &#19979;&#21320; 06:32    <DIR>          props
2004/09/05  &#19979;&#21320; 06:32             2,350 Props.jar
2004/09/05  &#19978;&#21320; 01:25               531 Props.java
2004/09/05  &#19978;&#21320; 01:25             2,552 PropsBean.java
2004/09/05  &#19978;&#21320; 01:25               542 PropsHome.java
               6 File(s)          6,830 bytes
               4 Dir(s)  16,669,421,568 bytes free

C:\Documents and Settings\meow\My Documents\Ejbtut>cd props

C:\Documents and Settings\meow\My Documents\Ejbtut\props>dir
 Volume in drive C has no label.
 Volume Serial Number is 0000-042C

 Directory of C:\Documents and Settings\meow\My Documents\Ejbtut\props

2004/09/05  &#19979;&#21320; 06:32    <DIR>          .
2004/09/05  &#19979;&#21320; 06:32    <DIR>          ..
2004/09/05  &#19979;&#21320; 06:32               299 Props.class
2004/09/05  &#19979;&#21320; 06:32             1,474 PropsBean.class
2004/09/05  &#19979;&#21320; 06:32               393 PropsHome.class
               3 File(s)          2,166 bytes
               2 Dir(s)  16,669,421,568 bytes free

C:\Documents and Settings\meow\My Documents\Ejbtut\props>
---------------------------------------------------------------------------
and all the path :

CLASSPATH :
  .;%J2EE_HOME%\lib\j2ee.jar;%J2EE_HOME%\lib\locale;C:\Documents and Settings\meow\My Documents\Ejbtut

path :
   C:\j2sdkee1.3\bin; C:\jdk1.3.1\bin; C:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin;

J2EE_HOME :
  j2sdkee1.3

JAVA_HOME :
  jdk1.3.1

-------------------------------
 current errors from .netbean :

 Ejbtut/PropsBean.java [8:1] package javax.ejb does not exist
import javax.ejb.*;
^
Ejbtut/PropsBean.java [12:1] package javax.ejb does not exist
public class PropsBean implements javax.ejb.EntityBean {
                                           ^
Ejbtut/PropsBean.java [22:1] package javax.ejb does not exist
        javax.ejb.EntityContext ejbEntityContext = null;
                 ^
Ejbtut/PropsBean.java [52:1] package javax.ejb does not exist
                throws javax.ejb.CreateException, java.rmi.RemoteException
                                ^
Ejbtut/PropsBean.java [65:1] package javax.ejb does not exist
        public void setEntityContext( javax.ejb.EntityContext ejbEntityContext )
                                               ^
Ejbtut/PropsBean.java [87:1] package javax.ejb does not exist
                throws java.rmi.RemoteException, javax.ejb.RemoveException
                                                          ^
Ejbtut/Props.java [8:1] package javax.ejb does not exist
import javax.ejb.*;
^
Ejbtut/Props.java [11:1] package javax.ejb does not exist
public interface Props extends javax.ejb.EJBObject {
                                        ^
Ejbtut/PropsHome.java [8:1] package javax.ejb does not exist
import javax.ejb.*;
^
Ejbtut/PropsHome.java [12:1] package javax.ejb does not exist
public interface PropsHome extends javax.ejb.EJBHome {
                                            ^
Ejbtut/PropsHome.java [16:1] package javax.ejb does not exist
                        ) throws javax.ejb.CreateException, java.rmi.RemoteException;
                                          ^
Ejbtut/PropsHome.java [18:1] package javax.ejb does not exist
        Props findByPrimaryKey( java.lang.String pkey ) throws javax.ejb.FinderException, java.rmi.RemoteException;
                                                                        ^
12 errors
Errors compiling Ejbtut.


0
 
meow00Author Commented:
Hi sompol_kiatkamolchai,

   Here is what I got in the test dir using javac -d. I didn't get errors, but I don't have *.class, either .... :-(
(but I got those using javac *.java)
------------------------------------------------------------
C:\Documents and Settings\meow\props>javac -d Props.java

C:\Documents and Settings\meow\props>javac -d PropsBean.java

C:\Documents and Settings\meow\props>javac -d PropsHome.java

C:\Documents and Settings\meow\props>dir
 Volume in drive C has no label.
 Volume Serial Number is 0000-042C

 Directory of C:\Documents and Settings\meow\props

2004/09/06  &#19978;&#21320; 12:31    <DIR>          .
2004/09/06  &#19978;&#21320; 12:31    <DIR>          ..
2004/09/05  &#19978;&#21320; 01:25               531 Props.java
2004/09/05  &#19978;&#21320; 01:25             2,552 PropsBean.java
2004/09/05  &#19978;&#21320; 01:25               542 PropsHome.java
               3 File(s)          3,625 bytes
               2 Dir(s)  16,669,421,568 bytes free

C:\Documents and Settings\meow\props>javac *.java

C:\Documents and Settings\meow\props>dir
 Volume in drive C has no label.
 Volume Serial Number is 0000-042C

 Directory of C:\Documents and Settings\meow\props

2004/09/06  &#19978;&#21320; 12:46    <DIR>          .
2004/09/06  &#19978;&#21320; 12:46    <DIR>          ..
2004/09/06  &#19978;&#21320; 12:46               299 Props.class
2004/09/05  &#19978;&#21320; 01:25               531 Props.java
2004/09/06  &#19978;&#21320; 12:46             1,474 PropsBean.class
2004/09/05  &#19978;&#21320; 01:25             2,552 PropsBean.java
2004/09/06  &#19978;&#21320; 12:46               393 PropsHome.class
2004/09/05  &#19978;&#21320; 01:25               542 PropsHome.java
               6 File(s)          5,791 bytes
               2 Dir(s)  16,669,417,472 bytes free

0
 
sompol_kiatkamolchaiCommented:
Ummm. I think you have to set classpath in .netbean. Try to find it in menu. Sorry that I can not help you much about .netbean since I don't have experience with it.
0
 
objectsCommented:
Looks like netbeans is not finding j2ee.jar, you may need to specify its location seperately for the ide.
Does it work from the command line using javac?
0
 
sompol_kiatkamolchaiCommented:
javac -d . Props.java
            ^
             |
            need .
0
 
objectsCommented:
> Here is what I got in the test dir using javac -d. I didn't get errors, but I don't have *.class, either .... :-(

Thats because the -d option says to put them elsewhere.
Remove it and it'll put them in same directory.
0
 
objectsCommented:


for netbeans try mounting the jars by right clicking on filesystem and selecting "mount archives"
0
 
meow00Author Commented:
hi sompol_kiakamolchai,

   It works with javac -d . Props.java.  Thanks !

Hi objects,

   I have got the jar file mounted in the .netbean ... Thanks ...

  Thanks all ! I am going to take a further look of beans ....
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 24
  • 14
  • 11
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now