Hello,

 

in a project of a new customer we have to add several functionalities to an
existing desktop application (swing) which accesses a mssql-database-server.
To simplify the process of testing and packaging for a team of 4 developers,
we've set up maven.

 

Problem is, that we have to use openjpa (the application already uses it).
But I have some serious issues with the javax.persistence which is needed
for openjpa:

 

[INFO] Exception in thread "main" java.lang.NoClassDefFoundError:
javax/persistence/Persistence

[INFO] at tld.company.appname.database.meta (Startup.java:19)

[INFO] Caused by: java.lang.ClassNotFoundException:
javax.persistence.Persistence

[INFO] at java.net.URLClassLoader$1.run(Unknown Source)

 

As you can see, javax.persistence is not available in the classpath. I have
added the following dependency to my pom.xml to hopefully solve this issue,
but it didn't work:

<dependency>

                <groupId>javax.persistence</groupId>

                <artifactId>persistence-api</artifactId>

                <version>1.0</version>

                <type>jar</type>

                <scope>compile</scope>

</dependency>

 

Sill doesn't find the persistence api.The other (important) dependencies for
the database-connection are:

 

<dependency>

                <groupId>org.apache.openjpa</groupId>

                <artifactId>apache-openjpa</artifactId>

                <version>1.2.0</version>

                <type>pom</type>

                <scope>compile</scope>

</dependency>

<dependency>

                <groupId>net.sourceforge.jtds</groupId>

                <artifactId>jtds</artifactId>

                <version>1.2.2</version>

                <type>jar</type>

                <scope>compile</scope>

</dependency>

 

I've searched a lot, but didn't find other solutions than converting the
project to hibernate or to install the j2ee-sdk. The first solution
(hibernate) is a little too much at the moment (this would require a bigger
amount of time and probably a change-request). The second one would be my
last choice, as we have nothing to do with j2ee until now.

 

Is there any easier way (hopefully simply by adding some package to the
pom.xml)? Or did I overlook something? Everything works without the
database, every additional library (e.g. iText) can be found, so what can I
do?

 

If you need any descriptions or additional information, let me know!

 

Thanks in advance!

Regards,

Uli

Reply via email to