Alright, I am back.
So I tried with your persistence.xml - and it works! It's the extra information
(xmlns, xsi) that did the trick because I did have the name specified in my original
persistence.xml. I gotta figure out what that extra bit does.
Anyhow, moving on, I tried to run the Client. But the JVM is complaining that the class
cannot be found. Now I have a question regarding this. Does the JVM look for Client.class
in the EJB-JAR file or the directory where the classes had been generated and placed
during compilation?
Just to refresh, my directory structure looks like this:
build.xml
src/main/java/org/rij/*.java
src/main/resources/META-INF/persistence.xml
src/main/resources/jndi.properties
target/classes/org/rij/*.class (all of the class files)
target/classes/META-INF/persistence.xml
target/mojo.jar
Also. the part of build file that runs the client is as follows:
| <target name="run.client" depends="ejbjar">
| <java classname="Client" fork="yes" dir=".">
| <classpath refid="classpath"/>
| </java>
| </target>
|
Since the classpath is important, here is the relevant part of the build file that sets
the classpath.
| <property environment="env"/>
| <property name="src.dir"
value="${basedir}/src/main/java"/>
| <property name="src.resources"
value="${basedir}/src/main/resources"/>
| <property name="jboss.dir"
value="${env.JBOSS_HOME}"/>
| <property name="jboss.deploy.dir"
value="${jboss.dir}/server/default/deploy"/>
| <property name="target.dir" value="${basedir}/target"/>
| <property name="target.classes.dir"
value="${basedir}/target/classes"/>
| <property name="common.lib.one"
value="C:/opt/jboss-5.0.0.GA/common/lib"/>
| <property name="common.lib.two"
value="C:/opt/jboss-5.0.0.GA/client"/>
|
|
|
| <!-- Next, specify where the client app is. client-config which has JNDI
properties -->
| <path id="classpath">
| <fileset dir="${common.lib.one}">
| <include name="*.jar"/>
| </fileset>
| <fileset dir="${common.lib.two}">
| <include name="*.jar"/>
| </fileset>
| <pathelement location="${target.dir}"/>
| <pathelement location="${target.classes.dir}"/>
| </path>
|
The second pathelement tag shows the exact location of the class, in case the JVM looks
for the class file specifically. If instead the EJB-JAR is used, then I have not
explicitly mentioned that. But my assumption is that the deploy directory in default
server is automatically scanned?
-Rij
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4219564#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...