[EJB 3.0] - Unit test EJB3 Exception
by mvpc
Hello people! I'm having trouble on EJB3 unit test.
I'm getting a class cast exception when i try to retrieve the local bean interface for unit testing. My code is the following:
// configure the enviroment
Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, "localhost:1099"); env.put(Context.URL_PKG_PREFIXES,"org.jboss.naming.org.jnp.interfaces" );
this.ctx = new InitialContext(env);
//get the context
MyLocal local = (MyLocal)PortableRemoteObject.narrow(ctx.lookup("MyBean/local"), MyLocal.class);//-> here i gert the exception
And the exception is that below
java.lang.ClassCastException: javax.naming.Reference cannot be cast to org.omg.CORBA.Object
So please if you have experienced the same problem, tell me about.
Thanks!!
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4220635#4220635
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4220635
17 years, 1 month
[JBoss Messaging] - Test org.jboss.test.jbossmessaging.test.JBossJMSUnitTestCase
by burdeasa
I work for Unisys corporation. I'm attempting to certify JBoss EAP 4.3 CP04 running on our MCP system. This apparently includes JBoss Messaging 1.4.0.SP3_CP07-brew.
When I run the JBoss testsuite, over 99% of the tests pass, but I have a few stubborn failures.
In particular, the test org.jboss.test.jbossmessaging.test.JBossJMSUnitTestCase passes about half of the time, but fails about the other half when I run it individually. When the test fails, the testcase testRequestReplyQueue hangs and the test.log file shows:
2009-03-23 16:13:45,500 ERROR [org.jboss.test.jbossmessaging.test.JBossJMSUnitTestCase$1] Error
| java.lang.UnsupportedOperationException: Destination not specified
| at org.jboss.jms.client.container.ProducerAspect.handleSend(ProducerAspect.java:157)
| at org.jboss.aop.advice.org.jboss.jms.client.container.ProducerAspect46.invoke(ProducerAspect46.java)
| at org.jboss.jms.client.delegate.ClientProducerDelegate$send_3961598017717988886.invokeNext(ClientProducerDelegate$send_3961598017717988886.java)
| at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)
| at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
| at org.jboss.jms.client.delegate.ClientProducerDelegate$send_3961598017717988886.invokeNext(ClientProducerDelegate$send_3961598017717988886.java)
| at org.jboss.jms.client.delegate.ClientProducerDelegate.send(ClientProducerDelegate.java)
| at org.jboss.jms.client.JBossMessageProducer.send(JBossMessageProducer.java:164)
| at org.jboss.jms.client.JBossMessageProducer.send(JBossMessageProducer.java:207)
| at org.jboss.jms.client.JBossMessageProducer.send(JBossMessageProducer.java:145)
| at org.jboss.jms.client.JBossMessageProducer.send(JBossMessageProducer.java:136)
| at org.jboss.test.jbossmessaging.test.JBossJMSUnitTestCase$1.run(JBossJMSUnitTestCase.java:248)
This appears to be similar to the error reported in
https://jira.jboss.org/jira/browse/JBMESSAGING-1259
However, that JIRA entry has no information about the problem cause or solution.
I have spent many hours over several days trying to determine how the destination could be null in some cases (causing the failure), and OK in other cases. So far, I have been unable to determine the cause.
Is there anyone who might be able to give me a clue?
Thanks!
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4220608#4220608
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4220608
17 years, 1 month
[JBoss jBPM] - A question on Transitions
by Toriton
Hi all, i ahve a little question.
This is a part of my Process definition
| <state name="stateA">
| <event type="node-enter">
| <action class="com.example.AnActionHandler"></action>
| </event>
| <event type="node-leave">
| <cancel-timer name="MailSender"/>
| </event>
| <timer duedate="30 seconds" name="MailSender" transition="to nodeMail"></timer>
| <transition to="stateB" name="to stateB"></transition>
| <transition to="nodeMail" name="to nodeMail"></transition>
| </state>
|
In this case i have a stateA that have 2 transitions, one is related at normal workflow, the transition named to stateB, and the other that is invoked only from a timer.
And it work properly if i invoke the signal() method from a webapp that i use to test the process workflow.
But the question is: there is any chance to configure the transition nodeMail to be invoked only by the timer? and not from the signal() method?
Because if configured as i described before, the signal() method is perfect anyway to call correctly the transition to stateB, but if the order of the transitions is changed in:
| <transition to="nodeMail" name="to nodeMail"></transition>
| <transition to="stateB" name="to stateB"></transition>
|
the transition named to nodeMail is the only one transition available invoking the signal() method.
I know that i can call transition by name too, but i was looking if there was a chance to lock some transition to be executed if who is calling is not the one i expect.
Thank in advance for any :) reply.
T.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4220607#4220607
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4220607
17 years, 1 month