[Spring Integration] - Re: Unabled to return specified bean factory in web applicat
by ivanyuan
Hi Marius,
Finally it works! I just replaced the deployer with jboss-spring-jdk5-2.5.jar. It works now. Thank you so so much!
I have few other questions for you:
1. With this spring deployer, can the jboss-spring.xml in the spring archive file take the tokens from a properties file in default/conf? It sounds abviously. But just want to make sure.
2. If I have two spring archive files, say FATHER.spring and MOTHER.spring, from a CHILD.war, is it possible for the CHILD to inherit spring beans from both FATHER and MOTHER? Can web context factory have two parents? If the spring deployer can merge two factories into one, say PARENT, then CHILD can easily take beans from PARENT (i.e. both of FATHER and MOTHER), not sure if this is the behavior of the current spring deployer. If not, it would be a very useful feature.
This morning, I installed JBoss 5.1.0-CR1 and Spring deployer (3.2) from SNOWDROP distribution. I tried my spring archive and web service war. I got the following exception. It seems that, for deployer 2.5 (with JBOSS 4.x) and 3.2 (with JBOSS 5.x), spring archives have different structure. The way to retrieve spring bean in web service seems to be different too.
Thank you so much for helping me on this. Have a nice weekend!
Ivan
------------
Below is the stacktrace of JBOSS 5.1.0-CR1
| 2009-11-20 15:44:22,797 ERROR [org.apache.catalina.core.StandardContext] (main) Context [/test-spring-web-service] startup failed due to previous errors
|
| java.lang.RuntimeException: mapped-name is required for org.apache.cxf.buslifecycle.CXFBusLifeCycleManager/bus of deployment test-spring-web-service.war
|
| at org.jboss.web.tomcat.service.injection.WebResourceHandler.loadXmlResourceEnvRefs(WebResourceHandler.java:287)
|
| at org.jboss.web.tomcat.service.injection.WebResourceHandler.loadXml(WebResourceHandler.java:325)
|
| at org.jboss.web.tomcat.service.TomcatInjectionContainer.processMetadata(TomcatInjectionContainer.java:550)
|
| at org.jboss.web.tomcat.service.WebCtxLoader.start(WebCtxLoader.java:158)
|
| at org.apache.catalina.core.StandardContext.start(StandardContext.java:4272)
|
| at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
|
| at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
|
| at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
|
| at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
|
| at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
|
| 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:157)
|
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
|
| 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:668)
|
| at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
|
| at $Proxy38.start(Unknown Source)
|
| at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
|
| at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
|
| at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
|
| at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
|
| at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
|
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
|
| at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
|
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
|
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
|
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
|
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
|
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
|
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
|
| at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
|
| at org.jboss.system.ServiceController.start(ServiceController.java:460)
|
| at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
|
| at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
|
| at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
|
| at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
|
| at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
|
| at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
|
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
|
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
|
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
|
| at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
|
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
|
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
|
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
|
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
|
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
|
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
|
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
|
| at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
|
| at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
|
| at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
|
| at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
|
| at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
|
| at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)
|
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
|
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
|
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
|
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
|
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
|
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
|
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
|
| at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)
|
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)
|
| at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
|
| at org.jboss.Main.boot(Main.java:216)
|
| at org.jboss.Main$1.run(Main.java:546)
|
| at java.lang.Thread.run(Thread.java:595)
|
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266839#4266839
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266839
14 years, 11 months
[Spring Integration] - Re: Unabled to return specified bean factory in web applicat
by ivanyuan
Marius,
Here is the stacktrace. Please take a look while I am trying to sync up versions as you advised.
Thanks,
| 2009-11-20 15:52:44,238 ERROR [org.jboss.deployment.MainDeployer] Could not create deployment: file:/C:/jboss-4.2.2.GA/server/default/deploy/MySpringBean.spring
|
| java.lang.NoClassDefFoundError: org/springframework/beans/factory/xml/DefaultXmlBeanDefinitionParser
|
| at java.lang.ClassLoader.defineClass1(Native Method)
|
| at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
|
| at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
|
| at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
|
| at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
|
| at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
|
| at java.security.AccessController.doPrivileged(Native Method)
|
| at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
|
| at org.jboss.mx.loading.RepositoryClassLoader.findClassLocally(RepositoryClassLoader.java:682)
|
| at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassLoader.java:662)
|
| at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
|
| at org.jboss.mx.loading.RepositoryClassLoader.loadClassLocally(RepositoryClassLoader.java:200)
|
| at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:131)
|
| at org.jboss.mx.loading.LoadMgr3.nextTask(LoadMgr3.java:399)
|
| at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:527)
|
| at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)
|
| at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
|
| at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
|
| at org.jboss.spring.factory.NamedXmlBeanDefinitionReader.<init>(NamedXmlBeanDefinitionReader.java:45)
|
| at org.jboss.spring.factory.NamedXmlApplicationContext.loadBeanDefinitions(NamedXmlApplicationContext.java:64)
|
| at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
|
| at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423)
|
| at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353)
|
| at org.jboss.spring.factory.NamedXmlApplicationContext.<init>(NamedXmlApplicationContext.java:58)
|
| at org.jboss.spring.factory.NamedXmlApplicationContext.<init>(NamedXmlApplicationContext.java:48)
|
| at org.jboss.spring.factory.ApplicationContextLoaderImpl.createBeanFactory(ApplicationContextLoaderImpl.java:36)
|
| at org.jboss.spring.factory.AbstractBeanFactoryLoader.create(AbstractBeanFactoryLoader.java:85)
|
| at org.jboss.spring.deployment.SpringDeployer.create(SpringDeployer.java:116)
|
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
|
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
|
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
|
| at sun.reflect.GeneratedMethodAccessor20.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 $Proxy9.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.startService(AbstractDeploymentScanner.java:336)
|
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
|
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
|
| at sun.reflect.GeneratedMethodAccessor3.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.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
|
| at $Proxy0.start(Unknown Source)
|
| at org.jboss.system.ServiceController.start(ServiceController.java:417)
|
| 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.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:1025)
|
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
|
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
|
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
|
| 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.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 $Proxy5.deploy(Unknown Source)
|
| at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
|
| at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
|
| at org.jboss.Main.boot(Main.java:200)
|
| at org.jboss.Main$1.run(Main.java:508)
|
| at java.lang.Thread.run(Thread.java:595)
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266835#4266835
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266835
14 years, 11 months
[Spring Integration] - Re: Unabled to return specified bean factory in web applicat
by ivanyuan
Hi Marius,
I did more testing. The problem is becoming more specific.
I tried both spring deployer release 2 and release 3.
It contains
| jboss-spring-jdk5.jar
| spring-aop.jar
| spring-beans.jar
| spring-context.jar
| spring-core.jar
|
I am not clear which version of the spring framework come along with depoyer (say version 3). After I replaced spring jars in default/lib with them, it is okay to deploy my spring archive. However it doesn't work with spring-web.jar, which come from spring framework package. It seems the the spring-web.jar (from spring framework) and other spring jar files (from deployer) are incompatible. Can you please tell me which spring-web.jar work well with spring jar files (along with spring deployer release 3)?
I also replaced spring jar files with spring framework 2.5.5 or 2.0.8 or 1.0.8, it turns out the spring deployer couldn't find DefaultXmlBeanDefinitionParser.
| java.lang.NoClassDefFoundError: org/springframework/beans/factory/xml/DefaultXmlBeanDefinitionParser
|
Yes, DefaultXmlBeanDefinitionParser doesn't exist in any of above spring frameworks. It seems that the spring jar files in the deployer are customized somehow. Can you verify that as well? How can I solve this incompatible problem?
Thanks,
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266817#4266817
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266817
14 years, 11 months
[JBoss Messaging Users] - Problems with examples.
by sacauskis
I'm running jboss 4.2.3GA on windows XP I'm running java jdk1.6.0_11 and I've installed jboss-messaging-1.4.5.GA and followed install instructions here:http://labs.jboss.com/file-access/default/members/jbossmessaging/fre....
I've had to change my org.jboss.services.binding.ServiceBindingManager in jboss-services.xml to the set ports-01 because of a port conflict on my machine. I'm running the queue validation section of the above document Section 4.3 to validate my installation. When I run it I get the following stack trace:
F:\jboss-messaging-1.4.5.GA\examples\queue>ant
Buildfile: build.xml
identify:
[echo] ####################################################################
#######
[echo] # Running the QUEUE example
#
[echo] ####################################################################
#######
[echo] The queue: testQueue
[echo] The client jar: ../..//jboss-messaging-client.jar
sanity-check:
init:
compile:
run:
[java] javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: javax.naming.
CommunicationException: Receive timed out [Root exception is java.net.SocketTime outException: Receive timed out] [Root exception is javax.naming.CommunicationEx
ception: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]]
[java] at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:
1562)
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:63
4)
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:62
7)
[java] at javax.naming.InitialContext.lookup(InitialContext.java:392)
[java] at org.jboss.example.jms.common.Util.doesDestinationExist(Util.j
ava:55)
[java] at org.jboss.example.jms.common.ExampleSupport.setup(ExampleSupp
ort.java:236)
[java] at org.jboss.example.jms.common.ExampleSupport.setup(ExampleSupp
ort.java:197)
[java] at org.jboss.example.jms.common.ExampleSupport.run(ExampleSuppor
t.java:147)
[java] at org.jboss.example.jms.queue.QueueExample.main(QueueExample.ja
va:134)
[java] Caused by: javax.naming.CommunicationException: Failed to connect to
server localhost:1099 [Root exception is javax.naming.ServiceUnavailableExcepti
on: Failed to connect to server localhost:1099 [Root exception is java.net.Conne
ctException: Connection refused: connect]]
[java] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java
:274)
[java] at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:
1533)
[java] ... 8 more
[java] Caused by: javax.naming.ServiceUnavailableException: Failed to conne
ct to server localhost:1099 [Root exception is java.net.ConnectException: Connec
tion refused: connect]
[java] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java
:248)
[java] ... 9 more
[java] Caused by: java.net.ConnectException: Connection refused: connect
[java] at java.net.PlainSocketImpl.socketConnect(Native Method)
[java] at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
[java] at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.jav
a:195)
[java] at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
[java] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
[java] at java.net.Socket.connect(Socket.java:519)
[java] at java.net.Socket.connect(Socket.java:469)
[java] at java.net.Socket.(Socket.java:366)
[java] at java.net.Socket.(Socket.java:267)
[java]
[java] Please verify if you have access to the server. If you are using JBo
ssEAP maybe you don't have security access
[java] at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocke
tFactory.java:84)
[java] at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocke
tFactory.java:77)
[java] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java
:244)
[java] ... 9 more
[java]
[java] #####################
[java] ### FAILURE! ###
[java] #####################
BUILD FAILED
F:\jboss-messaging-1.4.5.GA\examples\queue\build.xml:79: Java returned: 1
How do I change the port it is looking from 1099 to the one that ports1 uses 1199?
Thanks for the help.
Mike
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266816#4266816
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266816
14 years, 11 months
[JBoss Messaging Users] - Re: message publishing to stopped topic
by strzyga
Thanks for the reply,
Here's the code for two MBeans - producer and consumer:
Producer:
| package topictest;
|
| import java.util.concurrent.atomic.AtomicLong;
|
| import javax.annotation.Resource;
| import javax.jms.JMSException;
| import javax.jms.Session;
| import javax.jms.TextMessage;
| import javax.jms.Topic;
| import javax.jms.TopicConnection;
| import javax.jms.TopicConnectionFactory;
| import javax.jms.TopicPublisher;
| import javax.jms.TopicSession;
|
| import org.apache.log4j.Logger;
| import org.jboss.annotation.ejb.Service;
|
| @Service(objectName = "test:service=Producer")
| public class TestProducer implements TestProducerMBean {
|
| @Resource(mappedName = "java:/JmsXA")
| private TopicConnectionFactory tConnFactory;
|
| private TopicSession tSession;
|
| private TopicConnection connection;
|
| @Resource(mappedName = "/topic/test-Topic")
| private Topic topic;
|
| private TopicPublisher publisher;
|
| private AtomicLong counter = new AtomicLong();
|
| private static final Logger logger = Logger.getLogger(TestProducer.class);
|
| @Override
| public void send(Integer msgNum) throws JMSException {
|
| for (int i = 0; (i < msgNum || -1 == msgNum); i++) {
| String messageText = String.valueOf(counter.getAndIncrement());
| TextMessage msg = tSession.createTextMessage(messageText);
| publisher.publish(msg);
| logger.info("Published " + messageText);
|
| try {
| Thread.sleep(500);
| } catch (InterruptedException ignored) {
| }
| }
| }
|
| @Override
| public void start() throws JMSException {
| connection = tConnFactory.createTopicConnection();
| tSession = connection.createTopicSession(false,
| Session.AUTO_ACKNOWLEDGE);
| publisher = tSession.createPublisher(topic);
| }
|
| @Override
| public void stop() throws JMSException {
| if (publisher != null) {
| publisher.close();
| tSession.close();
| connection.close();
| }
| }
|
| }
|
Management interface for Producer:
| package topictest;
|
| import javax.jms.JMSException;
|
| import org.jboss.annotation.ejb.Management;
|
| @Management
| public interface TestProducerMBean {
| void start() throws JMSException;
| void stop() throws JMSException;
| void send(Integer msgNum) throws JMSException;
| }
|
Consumer:
| package topictest;
|
| import javax.annotation.Resource;
| import javax.jms.JMSException;
| import javax.jms.Message;
| import javax.jms.MessageListener;
| import javax.jms.Session;
| import javax.jms.TextMessage;
| import javax.jms.Topic;
| import javax.jms.TopicConnection;
| import javax.jms.TopicConnectionFactory;
| import javax.jms.TopicSession;
| import javax.jms.TopicSubscriber;
|
| import org.apache.log4j.Logger;
| import org.jboss.annotation.ejb.Service;
|
| @Service(objectName = "test:service=Consumer")
| public class TestConsumer implements TestConsumerMBean, MessageListener{
|
| @Resource(mappedName = "java:/JmsXA")
| private TopicConnectionFactory tConnFactory;
|
| @Resource(mappedName = "/topic/test-Topic")
| private Topic topic;
|
| private TopicSession session;
| private TopicConnection connection;
| private TopicSubscriber subscriber;
|
| private static final Logger logger = Logger.getLogger(TestConsumer.class);
|
| @Override
| public void create() throws JMSException {
| connection = tConnFactory.createTopicConnection();
| connection.setClientID("test-client");
| session = connection.createTopicSession(false, Session.CLIENT_ACKNOWLEDGE);
| subscriber = session.createDurableSubscriber(topic, "test-subscriber");
| connection.start();
| }
|
| @Override
| public void destroy() throws JMSException {
| session.close();
| }
|
| @Override
| public void start() throws JMSException {
| startReceiving();
| }
|
| @Override
| public void startReceiving() throws JMSException {
| subscriber.setMessageListener(this);
| }
|
| @Override
| public void stopReceiving() throws JMSException {
| subscriber.setMessageListener(null);
| }
|
| @Override
| public void onMessage(Message arg0) {
| TextMessage message = (TextMessage) arg0;
| try {
| logger.info("Received " + message.getText());
| } catch (JMSException e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| }
| }
| }
|
Management interface for Consumer:
| package topictest;
|
| import javax.jms.JMSException;
|
| import org.jboss.annotation.ejb.Management;
|
| @Management
| public interface TestConsumerMBean {
|
| void create() throws JMSException;
| void destroy() throws JMSException;
| void startReceiving() throws JMSException;
| void stopReceiving() throws JMSException;
| void start() throws JMSException;
| }
|
Topic deployment descriptor that i'm using:
| <?xml version="1.0" encoding="UTF-8"?>
| <server>
| <mbean code="org.jboss.jms.server.destination.TopicService"
| name="test:service=Topic,name=test-Topic"
| xmbean-dd="xmdesc/Topic-xmbean.xml">
| <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
| <depends>jboss.messaging:service=PostOffice</depends>
| </mbean>
| </server>
|
And my JmsXA config:
| <tx-connection-factory>
| <jndi-name>JmsXA</jndi-name>
| <xa-transaction/>
| <track-connection-by-tx/>
| <rar-name>jms-ra.rar</rar-name>
| <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
| <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
| <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
| <config-property name="Strict" type="java.lang.Boolean">false</config-property>
| <max-pool-size>20</max-pool-size>
| <security-domain-and-application>JmsXARealm</security-domain-and-application>
| </tx-connection-factory>
|
How to reproduce:
1) find Producer in jmx-console and invoke it's send() operation, with argument specifying number of messages to publish; in jboss log you will see something like this:
| 2009-11-20 18:57:03,498 INFO [topictest.TestProducer] Published 0
| 2009-11-20 18:57:03,499 INFO [topictest.TestConsumer] Received 0
| 2009-11-20 18:57:04,002 INFO [topictest.TestProducer] Published 1
| 2009-11-20 18:57:04,003 INFO [topictest.TestConsumer] Received 1
| 2009-11-20 18:57:04,504 INFO [topictest.TestProducer] Published 2
| 2009-11-20 18:57:04,505 INFO [topictest.TestConsumer] Received 2
|
2) while Producer is publishing - go to test-Topic and invoke it's stop() operation; you will see something like this:
| 2009-11-20 18:57:04,002 INFO [topictest.TestProducer] Published 1
| 2009-11-20 18:57:04,003 INFO [topictest.TestConsumer] Received 1
| 2009-11-20 18:57:04,504 INFO [topictest.TestProducer] Published 2
| 2009-11-20 18:57:04,505 INFO [topictest.TestConsumer] Received 2
| 2009-11-20 18:57:04,821 INFO [org.jboss.jms.server.destination.TopicService] Topic[/topic/test-Topic] stopped
| 2009-11-20 18:57:05,005 INFO [topictest.TestProducer] Published 3
| 2009-11-20 18:57:05,508 INFO [topictest.TestProducer] Published 4
| 2009-11-20 18:57:06,008 INFO [topictest.TestProducer] Published 5
|
and there are no exceptions after "Topic stopped" log.
You can also stop consumer by invoking it's stopReceiving() operation and watch that, after stopping topic, messages are not persisted to DB.
Does producer has to check in some way that topic is stopped and stop publishing?
Thanks
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266813#4266813
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266813
14 years, 11 months
Re: [jboss-user] javax.persistence.EntityNotFoundException: deleted entity passed to persist
by Laura Barroso Perez
working around this exception(avax.persistence.EntityNotFoundException:
deleted entity passed to persist) I have the idea of remove the entity
through a query...this is my code:
String query="delete from Block block where
block.blockPK.blockId='"+blockPk.getBlockId()+" ' and
block.blockPK.enterpriseId=' "+ blockPk.getEnterpriseId()+" ' ";
application.getDataService().executeQuery(query, 1);
BlockPk represents my primary key...the problem now is this exception:
Caused by: javax.ejb.EJBException: java.lang.IllegalStateException:
org.hibernate.hql.QueryExecutionRequestException: Not supported for DML
operations [delete from org.desoft.dcp.ag.entity.Block block where
block.blockPK.blockId='h' and block.blockPK.enterpriseId='cea']
at
org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:77)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
at
org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:10
2)
could anyone help me ,please!!!!
14 years, 11 months