Forums Register Login

Help Please: Getting package does not exist for "javax.ejb.*"

+Pie Number of slices to send: Send
Hi,

Could you please help me on this? I am using NetBeans 7.0, and I am getting package does not exist for "javax.ejb.*" message.
Not sure what I am missing.

I am using java 6, I have tried everything checked the class path, checked everything. But still having the same problem.

I have Installed J2EE, and tried to set the J2EE_HOME path directory. I am using Win7. I have created to path directory on "Environment Variables" setting it to "C:\Sun\AppServer"

this is where I have my j2ee.jar file. Not sure what setill missing?
Thanks
+Pie Number of slices to send: Send
Are you compiling your code from command line or Netbeans? Did you add an application server to your Netbeans project?
+Pie Number of slices to send: Send
Hi,

Thanks for the reply. I have my JBoss Application server added to my NetBeans.

I am not trying to run it from the command line, I am receiving the error message in Netbeans, and this is before I compile my file. a pop-up error message is displayed and
the line "import javax.ejb.*" is red-marked.

thanks
+Pie Number of slices to send: Send
Are you sure you have the java-ee-6 api (or it's implementation) in your classpath?
+Pie Number of slices to send: Send
CLASSPATH .;C:\Program Files\Java\jdk1.6.0_15\lib

J2EE_HOME C:\Sun\AppServer

JAVA_HOME C:\Program Files\Java\jdk1.6.0_15

those are all I have defined. Not sure What I am missing here.

Thanks
+Pie Number of slices to send: Send
In NetBeans if you view the details of your project and then look at 'libraries' entry, do you see javax.* JAR's?

They should be derived from the application server you configured your project with.
If not, you must add at least the Java EE API to be able to use code-assistant and get rid of errors. Such API must not be included in your deployment archive, as the javax.* libraries are provided by the container.

You can use your application server JAR's or if you're using maven you can i.e. use the following dependency:



It's used only in compilation and testing phases - the target container will provide it's own implementation during runtime.

Cheers!
+Pie Number of slices to send: Send

Thank you so much! I have fixed the problem with your help. What I did is, I right clicked on the project, I selected the libraries option and then I did include/import my J2EE.jar file. and this fixed the problem.

Thanks again:)
+Pie Number of slices to send: Send
No problem - glad it worked.
Remember to always leap before you look. But always take the time to smell the tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 10120 times.
Similar Threads
Getting error while compling the First Java file
Error Compiling EJBs from command prompt
ejb compiling
Error Compiling EJBs from command prompt
Package ... not found errors with 1.4
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 04:24:32.