[JBoss Messaging] - Cannot consume remote JBoss Messaging Destination
by toddjtidwell
I've got an interesting problem:
I have a JBoss 4.0.4 GA instance running with the new CR4 release of JBoss Messaging. I have a single Topic there that I can connect to and consume with a stand-alone application using the jboss-messaging-client.jar.
However, I also have a custom service running in a separate JBoss instance. That service needs to consume (and publish to) that same Topic. So, I have code like the following:
| ConnectionFactory connectionFactory = (ConnectionFactory) ic.lookup)(FACTORY_NAME);
|
| Connection connection=connectionFactory.createConnection();
|
| Session session=connection.createSession(false, Session.CLIENT_ACK);
|
| Destination destination=(Destination) initialContext.lookup(destinationName);
|
| MessageProducer producer=session.createProducer(destination);
|
Now, the destination comes back successfully as a org.jboss.jms.destination.JBossTopic oject and is not null.
Sadly, the line where I create a producer throws the exception at the bottom of this post. Does anyone have any thoughts on how best to accomplish what I'm trying to do here and what might cause this error? Keep in mind, this *exact* code works fine in the stand-alone application.
| javax.jms.InvalidDestinationException: Not a JBossDestination:JBossTopic[ClientBoundMessages]
| at org.jboss.jms.client.JBossSession.createProducer(JBossSession.java:206)
| at com.aga.messaging.DestinationHandler.connect(DestinationHandler.java:172)
| at com.aga.socketserver.SocketServerService.start(SocketServerService.java:88)
| 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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:995)
| at $Proxy0.start(Unknown Source)
| at org.jboss.system.ServiceController.start(ServiceController.java:417)
| at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy4.start(Unknown Source)
| at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
| at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy6.deploy(Unknown Source)
| at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
| at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965612#3965612
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965612
19 years, 8 months
[EJB 3.0] - My collection is not initializing; due to inheritance?
by SmokingAPipe
I have a Person class, which keeps a List of MailingAddress objects. There is a sub-class of Person called Customer which adds a few fields. The MailingAddress itself is a sub-class of an Address object. Person has @OneToMany annotation on its MailingAddress collection, and Address has a @ManyToOne annotation on its Person member.
When I use a PersistenceManager to load up a Customer from the DB, the list of MailingAddresses is always empty.
Is this type of use supported? When I create a new Customer, I also create a new MailingAddress. I set the MailingAddress in the Customer and then I persist the Customer, and I can see it is all saved in the db. But when I load the Customer back, it gives me an empty List. I think it's not even a proxy; it's just a plain old Java List.
I know there are two inheritances happening here: Customer is a subclass of Person, and MailingAddress is a subclass of Address. Should this be working?
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965610#3965610
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965610
19 years, 8 months
[JBoss Seam] - Is there a workable version of JBossSEAM?
by VotTak
Well... Downloaded suggested JBossSEAM and one of the nightly builds jboss-seam-CVS.20060809.
Followed short guide. Got 2 *.ear files with different sizes. After deployment both shows ERRORs.
20:34:30,343 ERROR [LocaleUtils] Locale name null or empty, ignoring
20:34:30,859 INFO [StartupServletContextListener] ServletContext 'C:\Program Fi
les\jboss-4.0.4.GA\server\default\.\tmp\deploy\tmp40635jboss-seam-booking.ear-co
ntents\jboss-seam-booking-exp.war\' initialized.
20:34:30,890 INFO [EARDeployer] Started J2EE application: file:/C:/Program File
s/jboss-4.0.4.GA/server/default/deploy/jboss-seam-booking.ear
20:34:30,906 INFO [EARDeployer] Init J2EE application: file:/C:/Program Files/j
boss-4.0.4.GA/server/default/deploy/sample.ear
20:34:30,937 ERROR [MainDeployer] Could not create deployment: file:/C:/Program
Files/jboss-4.0.4.GA/server/default/tmp/deploy/tmp40636sample.ear-contents/sampl
eEJB.jar
org.jboss.deployment.DeploymentException: expected one enterprise-beans tag
at org.jboss.metadata.MetaData.getUniqueChild(MetaData.java:113)
And at the end.....
--- Incompletely deployed packages ---
org.jboss.deployment.DeploymentInfo@d6d6ec0b { url=file:/C:/Program Files/jboss-
4.0.4.GA/server/default/deploy/sample.ear }
deployer: org.jboss.deployment.EARDeployer@bf053f
status: Deployment FAILED reason: expected one enterprise-beans tag
state: FAILED
watch: file:/C:/Program Files/jboss-4.0.4.GA/server/default/deploy/sample.ear
altDD: null
lastDeployed: 1155774870921
lastModified: 1155774870890
mbeans:
OK. So I decided to follow JBossSeamGettingStartedGuide.
In step #4 I noticed that I am creating progect "simple" although on the picture there is also a progect "jboss-seam-1.0.1GA. How to create that one using downloaded files? Is that progect important at all?
In step #5 after I typed "seam scaffold-wtp-project sample" I got this:
"BUILD FAILED
C:\jboss\seam\seam-gen\build.xml:71: C:\jboss\seam\seam-gen\src not found."
Also tried to follow JBossSEAMReverseEngineerGuide.
When I generated a skeleton Seam application(from Oracle 9, 1 table only) I got:
import javax.ejb.Interceptors;
Had to change it to:
import javax.interceptor.Interceptors;
after this change I was able to deploy *.ear but it failed during deployment as:
21:24:07,921 ERROR [SchemaExport] invalid schema name: GCORK in statement [creat
e table GCORK.HAZARD_INDEX]
21:24:08,468 INFO [Component] Component: org.jboss.seam.core.init, scope: APPLI
CATION, type: JAVA_BEAN, class: org.jboss.seam.core.Init
21:24:08,468 ERROR [[/seamapp]] Exception sending context initialized event to l
istener instance of class org.jboss.seam.servlet.SeamListener
java.lang.IllegalArgumentException: no property for configuration setting: org.j
boss.seam.core.init.managedPersistenceContexts
at org.jboss.seam.Component.initInitializers(Component.java:311)
later I got:
21:24:08,953 INFO [FacesConfigurator] Reading config /WEB-INF/faces-config.xml
21:24:09,046 ERROR [LocaleUtils] Locale name null or empty, ignoring
21:24:09,296 INFO [StartupServletContextListener] ServletContext 'C:\Program Fi
les\jboss-4.0.4.GA\server\default\.\tmp\deploy\tmp35721seamapp.ear-contents\seam
app-exp.war\' initialized.
21:24:09,296 ERROR [StandardContext] Error listenerStart
21:24:09,296 ERROR [StandardContext] Context [/seamapp] startup failed due to pr
evious errors
21:24:09,296 WARN [ServiceController] Problem starting service jboss.web.deploy
ment:war=seamapp.war,id=-1894308984
org.jboss.deployment.DeploymentException: URL file:/C:/Program Files/jboss-4.0.4
.GA/server/default/tmp/deploy/tmp35721seamapp.ear-contents/seamapp-exp.war/ depl
oyment failed
Later:
21:24:09,296 ERROR [MainDeployer] Could not start deployment: file:/C:/Program F
iles/jboss-4.0.4.GA/server/default/tmp/deploy/tmp35721seamapp.ear-contents/seama
pp.war
and at the end I got:
--- Incompletely deployed packages ---
org.jboss.deployment.DeploymentInfo@751eba08 { url=file:/C:/Program Files/jboss-
4.0.4.GA/server/default/deploy/seamapp.ear }
deployer: org.jboss.deployment.EARDeployer@bf053f
status: Deployment FAILED reason: URL file:/C:/Program Files/jboss-4.0.4.GA/se
rver/default/tmp/deploy/tmp35721seamapp.ear-contents/seamapp-exp.war/ deployment
failed
state: FAILED
watch: file:/C:/Program Files/jboss-4.0.4.GA/server/default/deploy/seamapp.ear
altDD: null
lastDeployed: 1155777846484
lastModified: 1155777845937
mbeans:
persistence.units:ear=seamapp.ear,jar=seamapp.ejb3.jar,unitName=entityManage
r state: Started
jboss.j2ee:ear=seamapp.ear,jar=seamapp.ejb3,name=HazardIndexEditorBean,servi
ce=EJB3 state: Started
jboss.j2ee:ear=seamapp.ear,jar=seamapp.ejb3,name=HazardIndexFinderBean,servi
ce=EJB3 state: Started
jboss.j2ee:ear=seamapp.ear,jar=seamapp.ejb3,name=DefaultHazardIndexSelector,
service=EJB3 state: Started
--- MBeans waiting for other MBeans ---
ObjectName: jboss.web.deployment:war=seamapp.war,id=-1894308984
State: FAILED
Reason: org.jboss.deployment.DeploymentException: URL file:/C:/Program Files/j
boss-4.0.4.GA/server/default/tmp/deploy/tmp35721seamapp.ear-contents/seamapp-exp
.war/ deployment failed
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: jboss.web.deployment:war=seamapp.war,id=-1894308984
State: FAILED
Reason: org.jboss.deployment.DeploymentException: URL file:/C:/Program Files/j
boss-4.0.4.GA/server/default/tmp/deploy/tmp35721seamapp.ear-contents/seamapp-exp
.war/ deployment failed
Anyway... I killed a couple of days to get these results while I expected to get some working code. So here is a question:
Can anyone point me to the right direction on how to make it work or where to get workable versions which are working as it is described in Guides?
All responses are highly appreciated. Thank you very much.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965608#3965608
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965608
19 years, 8 months
[Beginners Corner] - If processing of one message failed in the onmessage() funct
by pxpwxj
My consumer shoulde recieve and process message asynchronously.My question is:If processing of one message failed in the onmessage() function,how to tell the jboosmq resend it to consumer again?
I do not mdb,and I do not want to use transaction when processing messages because transaction slow down the speed of processing.
If i set session to AUTOACKNOWLEGE mode,the session will simply acknowlege the message when the onmessage function return,it do not even know whether the message processing suceeded or failed,and because the onmessage() can not return any value to notify session of any thing, and the onmessage() function should not throw any exception to indicate any unsuccessful state.so how can i tell the jboss mq :"this message is not well processed due to some external factor.please resend it to one of those consumer again!"
thank you very much for help!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965605#3965605
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965605
19 years, 8 months