2

I'm a bit confused. I need to compile a project in jDeveloper 11.1.1.6.0. The server side of the project is deployed on the Glassfish server. On the machine of the project's creator everything compiles without any problems.

Using project properties -> Libraries and Classpath I added the libraries such as gf-client.jar, security etc. from $glassfish_home/glassfish/modules and some others (e.g. hibernate3.jar from hibernate dir).

When I try to compile the project I receive the following errors:

package javax.annotation.security does not exist

and

package javax.persistence does not exist.

I suppose that I miss some jars to include. I tried to find which jars (from Glassfish or from JDK) contain javax.annotation.* and javax.persistence.* but I couldn't.

If you have any ideas I would be thankful!

Piotr Nowicki
  • 17,914
  • 8
  • 63
  • 82
Oleg
  • 467
  • 1
  • 8
  • 17
  • Have you tried adding dependency on this artifact: http://mvnrepository.com/artifact/javax/javaee-api/6.0 ? – Piotr Nowicki Nov 15 '12 at 09:22
  • Thank you for reply, @PiotrNowicki! I downloaded `javaee-api-6.0.jar` and added it in the same way. I still get these error messages. Am I right if I say that the downloaded jar file contains only declarations of methods etc, but not implementation? Can it be the reason, because acoording to the page infrormation all packages I need are there. – Oleg Nov 15 '12 at 10:34
  • These package / API is only for compilation - as you've said these are only interfaces / declarations - no implementation. The implementation will be available in the deployment environment. It's interesting why you're getting compile-time errors... – Piotr Nowicki Nov 15 '12 at 10:45

2 Answers2

0

So I found the source of the problem. The application consists of 2 projects, of which only one (mentioned in the question) uses EJB. I'm not sure if it is the way it should be, but I tried adding ejb-files to another project. And after clean all and rebuild all it compiled like a charm for me. I hope this will help somebody in the future.

Oleg
  • 467
  • 1
  • 8
  • 17
0

I was having the same problem and was able to solve it by adding a couple of dependencies to the Maven pom.xml file. See this answer for more details.

Community
  • 1
  • 1
A. Rick
  • 649
  • 5
  • 11