[Clustering/JBoss] - :: Question On JBoss Clustering with Hibernate Second Level
by BhaktavatsalamReddy
Hi,
I having striving to do clustering on JBoss. It is giving lot of problems.
Let me first give the environment I am using:
=> JBoss4.2. GA
=> JBossCache - Bundled along with JBoss installation
=> EJB 3.0
=> Hibernate 3.2.X
Stateless Session Ejb communicates with Hibernates POJOs. Internally Hibernate using JBossCache as the second level Cache.
It is working fine on Single machine without clustering.
It is giving problem only on Clustering, but it is raising exceptions during the deployment time one or the other.
I am providing the complete stack trace and configuration include iGroups related config stuff for the second level cache state transfer.
Please let me know where am I going wrong.
Here is the cluster-service.xml
===================
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!-- -->
<!-- Clustering Service Configuration -->
<!-- -->
<!-- ===================================================================== -->
<!-- ==================================================================== -->
<!-- Cluster Partition: defines cluster -->
<!-- ==================================================================== -->
<!-- Name of the partition being built -->
${jboss.partition.name:DefaultPartition}
<!-- The address used to determine the node name -->
10.5.1.231
<!-- Determine if deadlock detection is enabled -->
False
<!-- Max time (in ms) to wait for state transfer to complete. Increase for large states -->
60000
<!-- The JGroups protocol configuration -->
The default UDP stack:
- If you have a multihomed machine, set the UDP protocol's bind_addr attribute to the
appropriate NIC IP address, e.g bind_addr="192.168.0.2".
- On Windows machines, because of the media sense feature being broken with multicast
(even after disabling media sense) set the UDP protocol's loopback attribute to true
-->
<!--
<UDP mcast_addr="${jboss.partition.udpGroup:228.1.2.3}"
mcast_port="${jboss.hapartition.mcast_port:45566}"
tos="8"
ucast_recv_buf_size="20000000"
ucast_send_buf_size="640000"
mcast_recv_buf_size="25000000"
mcast_send_buf_size="640000"
loopback="false"
discard_incompatible_packets="true"
enable_bundling="false"
max_bundle_size="64000"
max_bundle_timeout="30"
use_incoming_packet_handler="true"
use_outgoing_packet_handler="false"
ip_ttl="${jgroups.udp.ip_ttl:2}"
down_thread="false" up_thread="false"/>
<PING timeout="2000"
down_thread="false" up_thread="false" num_initial_members="3"/>
<MERGE2 max_interval="100000"
down_thread="false" up_thread="false" min_interval="20000"/>
<FD_SOCK down_thread="false" up_thread="false"/>
<FD timeout="10000" max_tries="5" down_thread="false" up_thread="false" shun="true"/>
<VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false"/>
<pbcast.NAKACK max_xmit_size="60000"
use_mcast_xmit="false" gc_lag="0"
retransmit_timeout="300,600,1200,2400,4800"
down_thread="false" up_thread="false"
discard_delivered_msgs="true"/>
<UNICAST timeout="300,600,1200,2400,3600"
down_thread="false" up_thread="false"/>
<pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
down_thread="false" up_thread="false"
max_bytes="400000"/>
<pbcast.GMS print_local_addr="true" join_timeout="3000"
down_thread="false" up_thread="false"
join_retry_timeout="2000" shun="true"
view_bundling="true"/>
<FRAG2 frag_size="60000" down_thread="false" up_thread="false"/>
<pbcast.STATE_TRANSFER down_thread="false" up_thread="false" use_flush="false"/>
-->
<!-- Alternate TCP stack: customize it for your environment, change bind_addr and initial_hosts -->
<TCP bind_addr="10.5.1.231" start_port="7800" loopback="true"
tcp_nodelay="true"
recv_buf_size="640000"
send_buf_size="640000"
discard_incompatible_packets="true"
enable_bundling="false"
max_bundle_size="64000"
max_bundle_timeout="30"
use_incoming_packet_handler="true"
use_outgoing_packet_handler="false"
down_thread="false" up_thread="false"
use_send_queues="false"
sock_conn_timeout="300"
skip_suspected_members="true"/>
<TCPPING initial_hosts="10.5.1.231[7800]" port_range="3"
timeout="3000"
down_thread="false" up_thread="false"
num_initial_members="1"/>
<MERGE2 max_interval="100000"
down_thread="false" up_thread="false" min_interval="20000"/>
<FD_SOCK down_thread="false" up_thread="false"/>
<FD timeout="10000" max_tries="5" down_thread="false" up_thread="false" shun="true"/>
<VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false"/>
<pbcast.NAKACK max_xmit_size="60000"
use_mcast_xmit="false" gc_lag="0"
retransmit_timeout="300,600,1200,2400,4800"
down_thread="false" up_thread="false"
discard_delivered_msgs="true"/>
<pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
down_thread="false" up_thread="false"
max_bytes="400000"/>
<pbcast.GMS print_local_addr="true" join_timeout="3000"
down_thread="false" up_thread="false"
join_retry_timeout="2000" shun="true"
view_bundling="true"/>
<pbcast.STATE_TRANSFER down_thread="true" up_thread="true" use_flush="true"/>
jboss:service=Naming
Here is the treecache.xml
=================
<?xml version="1.0" encoding="UTF-8" ?>
jboss:service=Naming
jboss:service=TransactionManager
org.jboss.cache.JBossTransactionManagerLookup
PESSIMISTIC
NONE
LOCAL
<!-- Clustering Related when the Second Level Cache Is Enabled -->
0
0
false
true
false
20000
30000
false
40000
${jboss.partition.name:DefaultPartition}
org.jboss.cache.eviction.LRUPolicy
5
10000
3600
86400
5000
3600
3600
5000
3600
3600
5000
3600
3600
5000
3600
3600
5000
3600
3600
5000
3600
3600
5000
3600
3600
false
false
org.jboss.cache.loader.FileCacheLoader
location=treecache
false
true
false
true
<TCP bind_addr="10.5.1.231" start_port="7800" loopback="true"
tcp_nodelay="true"
recv_buf_size="640000"
send_buf_size="640000"
discard_incompatible_packets="true"
enable_bundling="false"
max_bundle_size="64000"
max_bundle_timeout="30"
use_incoming_packet_handler="true"
use_outgoing_packet_handler="false"
down_thread="false" up_thread="false"
use_send_queues="false"
sock_conn_timeout="300"
skip_suspected_members="true"/>
<TCPPING initial_hosts="10.5.1.231[7800]" port_range="3"
timeout="3000"
down_thread="false" up_thread="false"
num_initial_members="1"/>
<MERGE2 max_interval="100000"
down_thread="false" up_thread="false" min_interval="20000"/>
<FD_SOCK down_thread="false" up_thread="false"/>
<FD timeout="10000" max_tries="5" down_thread="false" up_thread="false" shun="true"/>
<VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false"/>
<pbcast.NAKACK max_xmit_size="60000"
use_mcast_xmit="false" gc_lag="0"
retransmit_timeout="300,600,1200,2400,4800"
down_thread="false" up_thread="false"
discard_delivered_msgs="true"/>
<pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
down_thread="false" up_thread="false"
max_bytes="400000"/>
<pbcast.GMS print_local_addr="true" join_timeout="3000"
down_thread="false" up_thread="false"
join_retry_timeout="2000" shun="true"
view_bundling="true"/>
<pbcast.STATE_TRANSFER down_thread="true" up_thread="true" use_flush="true"/>
Her is the Hibernate config file:
====================
true
org.hibernate.cache.TreeCacheProvider
true
true
true
false
<!-- Enable Second Level Caching -->
<class-cache class="com.abc.hibernate.account.CompanyImpl" usage="transactional" region="CompanyImpl"/>
<class-cache class="com.abc.hibernate.account.CompanyImpl" usage="transactional" region="LicenceImpl"/>
<!-- collections caches -->
<collection-cache collection="com.abc.hibernate.account.CompanyImpl.licenses" usage="transactional" region="CompanyImpl.licenses"/>
Complete Stack Trace:
18:36:03,703 ERROR [STDERR] [Fatal Error] :-1:-1: Premature end of file.
18:36:03,765 ERROR [STDERR] %%%% Error Creating SessionFactory %%%%
18:36:03,796 ERROR [STDERR] org.hibernate.cache.CacheException: org.jboss.util.NestedRuntimeException: Premature end of file.; - nested throwable: (org.xml.sax.SAXParseException: Premature end of file.)
at org.hibernate.cache.TreeCacheProvider.start(TreeCacheProvider.java:78)
at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:183)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at com.rs.mambo.hibernate.session.HibernateSessionFactory.getSessionFactory(HibernateSessionFactory.java:64)
at com.rs.mambo.hibernate.session.HibernateSessionFactory.currentSession(HibernateSessionFactory.java:50)
at com.rs.mambo.ejb.session.config.ConfigurationBean.loadConfiguration(ConfigurationBean.java:32)
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.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.invokeInOurTx(TxPolicy.java:79)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
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.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:214)
at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:184)
at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:81)
at $Proxy205.loadConfiguration(Unknown Source)
at com.rs.mambo.adapter.ConfigAdapter.loadConfiguration(ConfigAdapter.java:22)
at com.rs.mambo.servlet.StartupServlet.init(StartupServlet.java:29)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4069)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4373)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.apache.catalina.core.StandardContext.init(StandardContext.java:5310)
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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
at org.jboss.web.WebModule.startModule(WebModule.java:83)
at org.jboss.web.WebModule.startService(WebModule.java:61)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor433.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 $Proxy45.start(Unknown Source)
at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
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.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
at org.jboss.system.InterceptorServiceMBean
18:36:03,796 ERROR [STDERR] Support.invokeNext(InterceptorServiceMBeanSupport.java:238)
at org.jboss.ws.integration.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:93)
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
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 $Proxy46.start(Unknown Source)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor18.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:610)
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)
Caused by: org.jboss.util.NestedRuntimeException: Premature end of file.; - nested throwable: (org.xml.sax.SAXParseException: Premature end of file.)
at org.jboss.util.propertyeditor.DocumentEditor.getAsDocument(DocumentEditor.java:88)
at org.jboss.util.propertyeditor.ElementEditor.setAsText(ElementEditor.java:41)
at org.jboss.cache.PropertyConfigurator.configure(PropertyConfigurator.java:252)
at org.jboss.cache.PropertyConfigurator.configure(PropertyConfigurator.java:161)
at org.hibernate.cache.TreeCacheProvider.start(TreeCacheProvider.java:69)
... 130 more
Caused by: org.xml.sax.SAXParseException: Premature end of file.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.jboss.util.propertyeditor.DocumentEditor.getAsDocument(DocumentEditor.java:79)
... 134 more
18:36:03,796 ERROR [ExceptionUtil] ==========================================================
18:36:03,796 ERROR [ExceptionUtil] ============== Exception ID: 1183685763796 ==============
18:36:03,828 ERROR [ExceptionUtil] ============== Status Code : 2000 ==============
18:36:03,828 ERROR [ExceptionUtil] ============== Exception Message : java.lang.NullPointerException ==============
18:36:03,828 ERROR [ExceptionUtil] ============== Exception Class : class javax.ejb.EJBException ==============
18:36:03,828 ERROR [ExceptionUtil] --------------- Root Cause Exception Trace ---------------
18:36:03,828 ERROR [ExceptionUtil]
java.lang.NullPointerException
at com.rs.mambo.hibernate.session.HibernateSessionFactory.currentSession(HibernateSessionFactory.java:53)
at com.rs.mambo.ejb.session.config.ConfigurationBean.loadConfiguration(ConfigurationBean.java:32)
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.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.invokeInOurTx(TxPolicy.java:79)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
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.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:214)
at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:184)
at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:81)
at $Proxy205.loadConfiguration(Unknown Source)
at com.rs.mambo.adapter.ConfigAdapter.loadConfiguration(ConfigAdapter.java:22)
at com.rs.mambo.servlet.StartupServlet.init(StartupServlet.java:29)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4069)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4373)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.apache.catalina.core.StandardContext.init(StandardContext.java:5310)
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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
at org.jboss.web.WebModule.startModule(WebModule.java:83)
at org.jboss.web.WebModule.startService(WebModule.java:61)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor433.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)
Thanks in Advance.
Bhakta
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061083#4061083
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061083
18Â years, 9Â months
[JBoss Seam] - Accessing Seam Web Service
by twocoasttb
Has anyone had success writing a client for a Seam web service? I've got a skeleton modeled after the seambay example:
@Remote
| public interface AgentRemote {
|
| public void processOrder();
|
| }
@Stateless
| @WebService(name="AgentService", serviceName="AgentService")
| public class Agent implements AgentRemote {
|
| @WebMethod
| public void processOrder() {
| System.out.println("METHOD CALLED");
| }
|
| }
When deployed, I can get the following WSDL from the service:
<definitions name='AgentService' targetNamespace='http://service.web.tcsc.twocoast.com/' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://service.web.tcsc.twocoast.com/' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
| <types>
| <xs:schema targetNamespace='http://service.web.tcsc.twocoast.com/' version='1.0' xmlns:tns='http://service.web.tcsc.twocoast.com/' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
| <xs:element name='processOrder' type='tns:processOrder'/>
| <xs:element name='processOrderResponse' type='tns:processOrderResponse'/>
| <xs:complexType name='processOrder'/>
| <xs:complexType name='processOrderResponse'/>
| </xs:schema>
| </types>
| <message name='AgentService_processOrder'>
| <part element='tns:processOrder' name='processOrder'></part>
| </message>
| <message name='AgentService_processOrderResponse'>
| <part element='tns:processOrderResponse' name='processOrderResponse'></part>
| </message>
| <portType name='AgentService'>
| <operation name='processOrder' parameterOrder='processOrder'>
| <input message='tns:AgentService_processOrder'></input>
| <output message='tns:AgentService_processOrderResponse'></output>
| </operation>
| </portType>
| <binding name='AgentServiceBinding' type='tns:AgentService'>
| <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
| <operation name='processOrder'>
| <soap:operation soapAction=''/>
| <input>
| <soap:body use='literal'/>
| </input>
| <output>
| <soap:body use='literal'/>
| </output>
| </operation>
| </binding>
| <service name='AgentService'>
| <port binding='tns:AgentServiceBinding' name='AgentServicePort'>
| <soap:address location='http://127.0.0.1:8080/AgentService/Agent'/>
| </port>
| </service>
| </definitions>
I've tried writing simple clients in both Axis and Axis2. Here's the Axis2 version:
import org.apache.axiom.om.OMAbstractFactory;
| import org.apache.axiom.om.OMElement;
| import org.apache.axiom.om.OMFactory;
| import org.apache.axiom.om.OMNamespace;
| import org.apache.axis2.AxisFault;
| import org.apache.axis2.addressing.EndpointReference;
| import org.apache.axis2.client.Options;
| import org.apache.axis2.client.ServiceClient;
|
| public class Client {
| public static void main(String[] args) throws Exception {
|
| try {
|
| String endpoint="http://127.0.0.1:8080/AgentService/Agent";
| EndpointReference targetEPR = new EndpointReference(endpoint);
|
| OMFactory fac = OMAbstractFactory.getOMFactory();
| OMNamespace omNs = fac.createOMNamespace("http://twocoast.com/service", "tcsc");
| OMElement payload = fac.createOMElement("processOrder", omNs);
| Options options = new Options();
| options.setTo(targetEPR);
| //options.setAction("tcsc:processOrder");
|
| ServiceClient sender = new ServiceClient();
| sender.setOptions(options);
| OMElement result = sender.sendReceive(payload);
| sender.fireAndForget(result);
| } catch (AxisFault axisFault) {
| axisFault.printStackTrace();
| }
|
| }
| }
Regardless of the client, I get the following error in response to a request:
org.apache.axis2.AxisFault: Endpoint {http://service.web.tcsc.twocoast.com/}AgentServicePort does not contain operation meta data for: {http://twocoast.com/service}processOrder
| at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:434)
| at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:373)
| at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
| at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:520)
| at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:500)
| at Client.main(Client.java:27)
I've seen this error referenced in the JBoss WS forums, but haven't found a definitive answer. Has anyone had more luck with this than I have? BTW, I'm deploying to JBoss AS 4.2.0.GA and using Seam 2.0.0.BETA1
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061071#4061071
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061071
18Â years, 9Â months
[JBoss Seam] - Getting objects from conversation in a custom PhaseListener
by JakeC
I need to make a URL that can download a binary file based on information stored in a long running conversation. I can get it to work fine once from a page, but the second time, it fails with:
ERROR [PhaseListenerManager] Exception in PhaseListener RESTORE_VIEW(1) afterPhase
| java.lang.IllegalStateException: No active event context
| at org.jboss.seam.core.Manager.instance(Manager.java:267)
I'm pretty sure something I'm doing is ending the long running conversation, because if I just download a document once, then try to continue with my workflow by going to the next page, or even just refresh the current page, I get a similar error:
org.jboss.seam.NoConversationException: no long-running conversation for @Conversational bean
I'm pretty new at Seam, so if I'm making a colossal blunder, please be kind... :-) I've searched all over trying to figure out what is going on, but I just can't seem to find anything relevant.
Here is my PhaseListener:
package com.myco.myproj;
|
| import java.util.Set;
|
| import javax.faces.context.FacesContext;
| import javax.faces.el.ValueBinding;
| import javax.faces.event.PhaseEvent;
| import javax.faces.event.PhaseId;
| import javax.servlet.http.HttpServletResponse;
|
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.security.Restrict;
| import org.jboss.seam.contexts.EntityBean;
| import org.jboss.seam.core.Manager;
| import org.jboss.seam.jsf.TransactionalSeamPhaseListener;
| import org.jboss.seam.log.Log;
|
| @Name("docPhaseListener")
| @Restrict("#{identity.loggedIn}")
| @SuppressWarnings("serial")
| public class DocPhaseListener extends TransactionalSeamPhaseListener {
| public final static int BUF_SIZE = 16384;
| public final static String DOC_VIEW_ID = "/document/";
|
| private static Log log = (Log) org.jboss.seam.log.Logging.getLog(DocPhaseListener.class);
|
| private MyObject getMyObject(FacesContext context) {
| MyObject myObject = null;
| log.info("Manager.instance().getCurrentConversationId()="+Manager.instance().getCurrentConversationId());
| ValueBinding vb = context.getApplication().createValueBinding("#{myObject}");
| if(vb == null) {
| log.info("vb is null!");
| } else {
| Object o = null;
| log.info("vb type="+vb.getType(context)+", vb value="+(o=vb.getValue(context)));
| if(o instanceof MyObject)
| myObject = (MyObject) o;
| else
| log.info("Not MyObject!");
| }
|
| return myObject;
| }
|
| public void afterPhase(PhaseEvent event) {
| super.afterPhase(event);
| FacesContext context = event.getFacesContext();
| String viewId = context.getViewRoot().getViewId();
| int index = viewId.indexOf(DOC_VIEW_ID);
| if (PhaseId.RESTORE_VIEW.equals(event.getPhaseId()) && index != -1 && viewId.endsWith(".xhtml")) {
| MyObject myObject = getMyObject(context);
| if(myObject != null)
| Util.handleDocumentRequest(context, myObject);
| else {
| // TODO: Handle bad requests better
| ((HttpServletResponse)context.getExternalContext().getResponse()).setContentType("application/octet-stream");
| context.responseComplete();
| }
| }
| }
| }
|
Since I'm extending TransactionalSeamPhaseListener (it seems necessary to get into the conversation the first time), and you can't have more than one SeamPhaseListener, I had to replace the existing one with mine, so my faces-config.xml looks like this:
<lifecycle>
| <!--phase-listener>org.jboss.seam.jsf.TransactionalSeamPhaseListener</phase-listener-->
| <phase-listener>com.medorder.mazama.DocumentPhaseListener</phase-listener>
| </lifecycle>
|
My UI is part of a rich:dataTable, and the column looks like this:
<h:column>
| <f:facet name="header">Download</f:facet>
| <h:outputLink value="document/download.seam?cid=#{conversation.id}&clr=true">
| <f:verbatim>Download</f:verbatim>
| </h:outputLink>
| </h:column>
|
Eventually, this URL will be called from an embedded Flash object, so I really need to use a PhaseListener. Can anyone tell me what I'm doing wrong to end the conversation?
I have also tried just implementing PhaseListener, and pulling the object from the SessionMap directly using the key "org.jboss.seam.CONVERSATION#xx$myObject", but I get the same kind of problem. The second time I access the EntityBean that is returned, the instance it points to is null.
Also, can someone confirm my suspicion that @Name and @Restrict are pointless to use on a PhaseListener? I don't think any injection has worked on it, and I'm pretty sure that it is not possible to use those on something that pretty much by definition lives outside the life-cycle.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061067#4061067
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061067
18Â years, 9Â months