How to print out the line of code causing the bug

L

laredotornado

Hi,

Using Java 1.5. When I run my JUnit test that calls a remote EJB, a
RemoteException is returned. Although it prints out the method that
failed, it doesn't print the line number ...

[junit] Error: EJB Object Pool exception:
java.rmi.RemoteException: EJB Exception: ; nested exception is:
[junit] java.lang.NullPointerException
[junit] at
com.myco.safariview.cedarpoint.delegates.CPDelegate.deleteSubscriber
(Unknown Source)
[junit] at DeleteAddSubscriberTest.testDeleteSubscriber(Unknown
Source)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
[junit] at java.lang.reflect.Method.invoke(Method.java:585)
[junit] at junit.framework.TestCase.runTest(TestCase.java:168)
[junit] at junit.framework.TestCase.runBare(TestCase.java:134)

What do I need to do when building the remote EJB so that I can get a
line number instead of "Unknown Source"? Below is the ant task (1.6)
I use to generate the EJB. Let me know what other info I should
provide.

Thanks, - Dave

<target name="generate-admin-ejb" depends="check-ejbgen">
<delete dir="${deployment}/META-INF"/>
<mkdir dir="${deployment}/META-INF"/>
<ejbgen
source="1.5"
outputDir="${src}"
sourcepath="${src}"
descriptorDir="${deployment}/META-INF"
exitOnError="true"
verbose="true"
<classpath refid="project.class.path"/>
<fileset dir="${src}" includes="**/*AdminBean.java" />
</ejbgen>

<replace dir="${src}" token="$" value="." >
<include name="**/*Query.java"/>
</replace>
<java classname="com.bea.wls.ejbgen.EJBGen" fork="true"
failonerror="true" dir="${src}">
<classpath>
<pathelement path="${java.class.path}"/>
<pathelement location="${ejbgen-jar-path}"/>
</classpath>
<arg value="${src}/com/myco/safariview/cedarpoint/ejb/sb/
CPAdminBean.java"/>
<arg value="-exitOnError"/>
<arg value="-verbose"/>
<arg value="-wls81"/>
</java>
<move todir="${deployment}/META-INF">
<fileset dir="${src}" includes="*ejb-jar.xml"/>
</move>
<delete>
<fileset dir="${src}" includes="*.xml"/>
</delete>
</target>
 
S

Sigfried

laredotornado a écrit :
Hi,

Using Java 1.5. When I run my JUnit test that calls a remote EJB, a
RemoteException is returned. Although it prints out the method that
failed, it doesn't print the line number ...

[junit] Error: EJB Object Pool exception:
java.rmi.RemoteException: EJB Exception: ; nested exception is:
[junit] java.lang.NullPointerException
[junit] at
com.myco.safariview.cedarpoint.delegates.CPDelegate.deleteSubscriber
(Unknown Source)
[junit] at DeleteAddSubscriberTest.testDeleteSubscriber(Unknown
Source)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
[junit] at java.lang.reflect.Method.invoke(Method.java:585)
[junit] at junit.framework.TestCase.runTest(TestCase.java:168)
[junit] at junit.framework.TestCase.runBare(TestCase.java:134)

What do I need to do when building the remote EJB so that I can get a
line number instead of "Unknown Source"? Below is the ant task (1.6)
I use to generate the EJB. Let me know what other info I should
provide.

Thanks, - Dave

<target name="generate-admin-ejb" depends="check-ejbgen">
<delete dir="${deployment}/META-INF"/>
<mkdir dir="${deployment}/META-INF"/>
<ejbgen
source="1.5"
outputDir="${src}"
sourcepath="${src}"
descriptorDir="${deployment}/META-INF"
exitOnError="true"
verbose="true"

There must be an attribute like for javac (debug="true") in ejbgen.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top