Solved

entity bean ...

Posted on 2004-09-05
57
1,500 Views
Last Modified: 2013-11-24
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
Comment
Question by:meow00
  • 24
  • 14
  • 11
  • +2
57 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 11984266
What is the script btw?
0
 
LVL 92

Expert Comment

by:objects
ID: 11986459
Make sure you have a j2ee jar in your classpath, either from installing J2EE or from your container.
0
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11986579
What is the error when compiling?
0
 
LVL 1

Author Comment

by:meow00
ID: 11986801
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
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11986812
It'sure that you don't have library(j2ee.jar). I will find the link for you to download.
0
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11986814
0
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11986817
0
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11986830
After installing, please find j2ee.jar and include to classpath.
0
 
LVL 1

Author Comment

by:meow00
ID: 11986978
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
 
LVL 1

Author Comment

by:meow00
ID: 11987001
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
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11987012
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
 
LVL 1

Author Comment

by:meow00
ID: 11987050
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
 
LVL 30

Expert Comment

by:mayankeagle
ID: 11987064
>> CLASSPATH :
>> .;%J2EE_HOME%\lib\j2ee.jar;%J2EE_HOME%\lib\locale

And what is J2EE_HOME set to?
0
 
LVL 1

Author Comment

by:meow00
ID: 11987070
Hi,

   Here they are :

J2EE_HOME : C:\j2sdkee1.3
JAVA_HOME : C:\jdk1.3.1
0
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11987072
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
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11987080
Yes. J2EE_HOME should set to c:\j2sdkee1.3. You head to the right way.
0
 
LVL 30

Expert Comment

by:mayankeagle
ID: 11987081
>> CLASSPATH
>> .;%J2EE_HOME%\lib\j2ee.jar;%J2EE_HOME%\lib\locale

Try making it:

%J2EE_HOME%\lib\j2ee.jar;%J2EE_HOME%\lib\locale;.
0
 
LVL 1

Author Comment

by:meow00
ID: 11987102
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
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11987107
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
 
LVL 1

Author Comment

by:meow00
ID: 11987128
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
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11987139
please dump Props.java and PropsHome.java, I think there are missing import statement or package name not defined in Props.java
0
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11987145
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
 
LVL 1

Author Comment

by:meow00
ID: 11987152
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
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11987212
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
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11987243
OK. I see you source in the question, I will try to compile too.
0
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11987252
!! I can compile it.
0
 
LVL 92

Expert Comment

by:objects
ID: 11987253
> 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
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11987267
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11987274
type set classpath

c:\....>set classpath

and paste the output here. I think you may not include . to classpath
0
 
LVL 92

Expert Comment

by:objects
ID: 11987315
>  I think you may not include . to classpath

Not necessary if you include the location of the source tree as I specified above
0
 
LVL 1

Author Comment

by:meow00
ID: 11987495
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
 
LVL 1

Author Comment

by:meow00
ID: 11987516
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
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11987540
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
 
LVL 30

Expert Comment

by:mayankeagle
ID: 11987541
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
 
LVL 92

Expert Comment

by:objects
ID: 11987547
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
 
LVL 30

Expert Comment

by:mayankeagle
ID: 11987553
I think the Props.class will get created in a props folder.
0
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11987565
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
 
LVL 30

Expert Comment

by:mayankeagle
ID: 11987581
>> 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
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11987582
Try this

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

It will automatically create folder as package name specified.
0
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11987588
Yes. We mention to the same thing but I don't copy from you. I posted it just after you 4 seconds.
0
 
LVL 30

Expert Comment

by:mayankeagle
ID: 11987593
>>  but I don't copy from you.

I know ;-)
0
 
LVL 92

Expert Comment

by:objects
ID: 11987603
> 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
 
LVL 30

Expert Comment

by:mayankeagle
ID: 11987609
>> 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
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11987616
>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
 
LVL 92

Expert Comment

by:objects
ID: 11987626
Heres some background for you:

http://mindprod.com/jgloss/classpath.html
0
 
LVL 92

Expert Comment

by:objects
ID: 11987638
> It's just adhoc solution for this question

Better to fix it properly :)
0
 
LVL 1

Author Comment

by:meow00
ID: 11987703
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
 
LVL 92

Expert Comment

by:objects
ID: 11987723
> I did change temp to props and include the classpath

post the current directory structure and your classpath.
0
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11987743
Do you try

javac -d . Props.java
javac -d . PropsBean.java
javac -d . PropsHome.java
0
 
LVL 1

Author Comment

by:meow00
ID: 11987755
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
 
LVL 1

Author Comment

by:meow00
ID: 11987778
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
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11987784
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
 
LVL 92

Expert Comment

by:objects
ID: 11987790
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
 
LVL 11

Accepted Solution

by:
sompol_kiatkamolchai earned 300 total points
ID: 11987793
javac -d . Props.java
            ^
             |
            need .
0
 
LVL 92

Expert Comment

by:objects
ID: 11987807
> 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
 
LVL 92

Assisted Solution

by:objects
objects earned 200 total points
ID: 11987814


for netbeans try mounting the jars by right clicking on filesystem and selecting "mount archives"
0
 
LVL 1

Author Comment

by:meow00
ID: 11987860
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now