[EJB 3.0] - Re: Can you Inject Local EJB from separate ear file?
by jfrankman
Thanks for the tip. Your suggestion solved my problem. I also found that I had to change the jboss config to use callbyvalue per this article:
http://wiki.jboss.org/wiki/ClassLoadingConfiguration
Now I am almost there. I can inject the session bean and call a method, but now the object returned by the session beans method cannot be cast into my class:
NexusEventDefinition def= nexusEventsService.findNexusEventDefinitionByName("Synchronous event that does neat things.");
I get a class cast exception:
anonymous wrote :
| java.lang.ClassCastException: com.idfbins.nexusevents.vo.NexusEventDefinition
| at $Proxy175.findNexusEventDefinitionByName(Unknown Source)
| at com.idfbins.keybank.KeyBankCheckImagesMessageHandler.onMessage(KeyBankCheckImagesMessageHandler.java:76)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
| at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
| at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:118)
| at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
| at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPolicy.invokeInNoTx(TxPolicy.java:66)
| at org.jboss.aspects.tx.TxInterceptor$NotSupported.invoke(TxInterceptor.java:112)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.mdb.MessagingContainer.localInvoke(MessagingContainer.java:249)
| at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.delivery(MessageInflowLocalProxy.java:268)
| at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.invoke(MessageInflowLocalProxy.java:138)
| at $Proxy103.onMessage(Unknown Source)
| at org.jboss.resource.adapter.jms.inflow.JmsServerSession.onMessage(JmsServerSession.java:178)
| at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:891)
| at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
| at org.jboss.mq.SpySession.run(SpySession.java:323)
| at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:237)
| at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
| at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
| at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:756)
| at java.lang.Thread.run(Thread.java:595)
Any idea why I am getting the class cast exception?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4163885#4163885
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4163885
17 years, 11 months
[JBossWS] - Re: Schema Validation - Failed to read schema document
by bbucy
Decided to do some debugging. Looks like SOAPBodyElementDoc.validatePayload calls a method (e.g. SchemaExtractor.getSchemaUrl) which extracts the wsdl:types from the WSDL document resulting in a temporary file located at ${JBOSS_ROOT}\server\default\tmp\jbossws. This temporary schema is used for validation. The problem being my import is in the wsdl:types with a SchemaLocation of "WSTest.xsd". WSTest.xsd is no longer in the same directory; thus is not found by parser. If I manual move my WSTest.xsd to the "tmp" directory the transaction goes thru (e.g. schema validation fails; there is a bad pattern facet in my schema).
So I guess my question is, am I defining the SchemaLocation correctly (e.g. SchemaLocation="WSTest.xsd") or does getSchemaUrl need to identify imports and either redefine the location or copy the schema to the "tmp" directory along with extracted wsdl:types schema?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4163882#4163882
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4163882
17 years, 11 months
[EJB 3.0] - Error deploying MDB with Jboss5 Beta4 with deployment descri
by Nouredine13
Hello,
when I try to deploy a simple mdb that connects with a jms/queue I have the following error:
*** CONTEXTS IN ERROR: Name -> Error
jboss.j2ee:jar=testMDB-ejb.jar,name=MDB1Bean,service=EJB3 -> org.jboss.deployment.DeploymentException: Required config property RequiredConfigPropertyMetaData@16ce9df[name=destinationType descriptions=[DescriptionMetaData@b80eb0[language=en]]] for messagingType 'javax.jms.MessageListener' not found in activation config [] ra=jboss.jca:service=RARDeployment,name='jms-ra.rar'
jboss.j2ee:jar=testMDB-ejb.jar,name=SimpleMessageEJB,service=EJB3 -> org.jboss.deployment.DeploymentException: Required config property RequiredConfigPropertyMetaData@16ce9df[name=destinationType descriptions=[DescriptionMetaData@b80eb0[language=en]]] for messagingType 'javax.jms.MessageListener' not found in activation config [ActivationConfigProperty(subscriptionDurability=false), ActivationConfigProperty(
ConnectionFactoryName
=
ConnectionFactory
), ActivationConfigProperty(
destinationType
=
javax.jms.Queue
), ActivationConfigProperty(
destination
=
queue/Capabilities
)] ra=jboss.jca:service=RARDeployment,name='jms-ra.rar'
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:576)
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:559)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:291)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
when I replace the deployments descriptor by annotations, it works fine!
for information : i user JBoss 5 Beta4
and here the code of my example :
package mdb.simple;
import javax.ejb.MessageDriven;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.ObjectMessage;
import javax.jms.TextMessage;
@MessageDriven
public class MDB1Bean implements MessageListener {
public MDB1Bean() {
}
public void onMessage(Message message) {
try {
if (message instanceof TextMessage) {
TextMessage msgText = (TextMessage) message;
System.out.print(msgText.getText());
}
if (message instanceof ObjectMessage) {
ObjectMessage objectMessage = (ObjectMessage) message;
Object obj = (Object) objectMessage.getObject();
System.out.print(obj.toString());
}
} catch (JMSException ex) {
System.out.println("JMSExeption when try get message");
}
}
}
and the deployments descriptor ejb-jar.xml :
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
<display-name>SimpleMessageJAR</display-name>
<enterprise-beans>
<message-driven>
<display-name>SimplesMessageEJB</display-name>
<ejb-name>SimpleMessageEJB</ejb-name>
<ejb-class>mdb.simple.MDB1Bean</ejb-class>
<messaging-type>javax.jms.MessageListener</messaging-type>
<transaction-type>Container</transaction-type>
<activation-config>
<activation-config-property>
<activation-config-property-name>
destinationType
</activation-config-property-name>
<activation-config-property-value>
javax.jms.Queue
</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>
destination
</activation-config-property-name>
<activation-config-property-value>
queue/Capabilities
</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>
ConnectionFactoryName
</activation-config-property-name>
<activation-config-property-value>
ConnectionFactory
</activation-config-property-value>
</activation-config-property>
</activation-config>
</message-driven>
</enterprise-beans>
</ejb-jar>
Note that this work fine with Jboss 4.2.2 GA .
if somone have any solution of this error ? thank's a lot.
Best Regard's
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4163880#4163880
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4163880
17 years, 11 months