[JBoss Messaging] - Adding properties to a received message
by joshiashutosh
Hi,
I am using Jboss Messaging for my project. One of my requirements is that I wish to add some properties to the message received from one queue and put it on another queue.
The problem is that properties of a received message are read-only and adding properties gives a MessageNotWriteableException.
The two ways I can think of, of dealing with this problem are:
1. Create a new message, copy all properties of the old message to the new message and then add new properties as follows:
ObjectMessage newMessage = null;
String name = null;
Object value = null;
try {
newMessage = producerSession.createObjectMessage();
Enumeration propNames = message.getPropertyNames();
while (propNames.hasMoreElements()) {
name = propNames.nextElement();
value = message.getObjectProperty(name);
newMessage.setObjectProperty(name, value);
}
}
catch (JMSException jmse) {
logger.warn("Unable to set message property " + name + " !");
}
message = null;
message = newMessage;
2. Save the message properties (say, in a hash), call clearProperties, put the properties back and add the new properties.
Is there a better way of adding properties? If not, which of the above methods is better?
Thanks,
--Ashutosh
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065312#4065312
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065312
18Â years, 11Â months
[JBossWS] - Integrating Security feature in web service call with JBoss
by avijitacclaris
My assignment includes integrating security feature in web servcie call.We use JBoss 4.0.3 SP1.
I have added a header in the SOAP request and in the server side we need to process the header for whic we have added a handler.
The stack trace is:
Fault - org.jboss.webservice.server.ServiceException: Cannot initialize webservice; nested exception is:
javax.xml.rpc.JAXRPCException: Cannot initialize handler chain
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/%7dServer.generalException
faultSubcode:
faultString: Cannot initialize webservice; nested exception is:
javax.xml.rpc.JAXRPCException: Cannot initialize handler chain
faultActor:
faultNode:
faultDetail:
Caused by: javax.xml.rpc.JAXRPCException: Cannot initialize handler chain
at org.jboss.webservice.handler.HandlerChainBaseImpl.addHandlersToChain(HandlerChainBaseImpl.java:99)
at org.jboss.webservice.handler.HandlerChainBaseImpl.(HandlerChainBaseImpl.java:71)
at org.jboss.webservice.handler.ServerHandlerChain.(ServerHandlerChain.java:34)
at org.jboss.webservice.server.InvokerProvider.initHandlerChain(InvokerProvider.java:143)
at org.jboss.webservice.server.InvokerProvider.initServiceDesc(InvokerProvider.java:98)
... 30 more
Caused by: java.lang.ClassCastException: employee.WSSESecurityEnvironmentHandler
at org.jboss.webservice.handler.HandlerChainBaseImpl.addHandlersToChain(HandlerChainBaseImpl.java:88)
... 34 more
faultActor:
faultNode:
faultDetail:
Please give me a solution.Thanks in advance.
Avijit
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065311#4065311
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065311
18Â years, 11Â months
[JBoss Seam] - Threads and entityManager in Jboss Seam
by Phantom
Good day,
Please help me in my situation:
I have a startup servlet, which starts server-socket to listen for incoming row socket connections. Than that connections interations hadnled by custom code wich use entityManager registered in Seam.
When I run that application on my local host all works perfect. But after deploing this application on production server after connection such exception occur:
| 2007-07-18 13:20:13,597 ERROR [STDERR] javax.ejb.EJBException: java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: Driver is not mapped [select object(d) from Driver d where d.username = :username and d.password = :password]
| 2007-07-18 13:20:13,597 ERROR [STDERR] at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
| 2007-07-18 13:20:13,597 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
| 2007-07-18 13:20:13,597 ERROR [STDERR] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
| 2007-07-18 13:20:13,597 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 2007-07-18 13:20:13,598 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| 2007-07-18 13:20:13,598 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 2007-07-18 13:20:13,598 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
| 2007-07-18 13:20:13,598 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 2007-07-18 13:20:13,598 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| 2007-07-18 13:20:13,598 ERROR [STDERR] at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:102)
| 2007-07-18 13:20:13,598 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 2007-07-18 13:20:13,598 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
| 2007-07-18 13:20:13,598 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 2007-07-18 13:20:13,598 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| 2007-07-18 13:20:13,598 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 2007-07-18 13:20:13,598 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:211)
| 2007-07-18 13:20:13,598 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:79)
| 2007-07-18 13:20:13,598 ERROR [STDERR] at $Proxy156.authentificateDriver(Unknown Source)
| 2007-07-18 13:20:13,598 ERROR [STDERR] at ru.mobiletaxi.managesite.ejb.io.handlers.AuthorizeHandler.handle(AuthorizeHandler.java:32)
| 2007-07-18 13:20:13,598 ERROR [STDERR] at ru.mobiletaxi.managesite.ejb.io.ClientThread.handleMessage(ClientThread.java:107)
| 2007-07-18 13:20:13,598 ERROR [STDERR] at ru.mobiletaxi.managesite.ejb.io.ClientThread.access$300(ClientThread.java:25)
| 2007-07-18 13:20:13,598 ERROR [STDERR] at ru.mobiletaxi.managesite.ejb.io.ClientThread$1.run(ClientThread.java:67)
| 2007-07-18 13:20:13,599 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
| 2007-07-18 13:20:13,599 ERROR [STDERR] Caused by: java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: Driver is not mapped [select object(d) from Driver d where d.username = :username and d.password = :password]
| 2007-07-18 13:20:13,599 ERROR [STDERR] at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:634)
| 2007-07-18 13:20:13,599 ERROR [STDERR] at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:95)
| 2007-07-18 13:20:13,599 ERROR [STDERR] at org.jboss.seam.persistence.EntityManagerProxy.createQuery(EntityManagerProxy.java:72)
| 2007-07-18 13:20:13,599 ERROR [STDERR] at ru.mobiletaxi.managesite.ejb.io.IOInterfaceBean.authentificateDriver(IOInterfaceBean.java:36)
| 2007-07-18 13:20:13,599 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 2007-07-18 13:20:13,599 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 2007-07-18 13:20:13,599 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 2007-07-18 13:20:13,599 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
| 2007-07-18 13:20:13,599 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
| 2007-07-18 13:20:13,599 ERROR [STDERR] at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
| 2007-07-18 13:20:13,600 ERROR [STDERR] at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:37)
| 2007-07-18 13:20:13,600 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57)
| 2007-07-18 13:20:13,600 ERROR [STDERR] at org.jboss.seam.interceptors.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:47)
| 2007-07-18 13:20:13,600 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| 2007-07-18 13:20:13,600 ERROR [STDERR] at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
| 2007-07-18 13:20:13,600 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| 2007-07-18 13:20:13,600 ERROR [STDERR] at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:113)
| 2007-07-18 13:20:13,600 ERROR [STDERR] at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:53)
| 2007-07-18 13:20:13,600 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 2007-07-18 13:20:13,600 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 2007-07-18 13:20:13,600 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 2007-07-18 13:20:13,600 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
| 2007-07-18 13:20:13,600 ERROR [STDERR] at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
| 2007-07-18 13:20:13,600 ERROR [STDERR] at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
| 2007-07-18 13:20:13,600 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 2007-07-18 13:20:13,600 ERROR [STDERR] at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
| 2007-07-18 13:20:13,600 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 2007-07-18 13:20:13,600 ERROR [STDERR] at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:46)
| 2007-07-18 13:20:13,600 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 2007-07-18 13:20:13,601 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
| 2007-07-18 13:20:13,601 ERROR [STDERR] ... 21 more
| 2007-07-18 13:20:13,601 ERROR [STDERR] Caused by: org.hibernate.hql.ast.QuerySyntaxException: Driver is not mapped [select object(d) from Driver d where d.username = :username and d.password = :password]
| 2007-07-18 13:20:13,601 ERROR [STDERR] at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:158)
| 2007-07-18 13:20:13,601 ERROR [STDERR] at org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:87)
| 2007-07-18 13:20:13,601 ERROR [STDERR] at org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:70)
| 2007-07-18 13:20:13,601 ERROR [STDERR] at org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:265)
| 2007-07-18 13:20:13,601 ERROR [STDERR] at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3056)
| 2007-07-18 13:20:13,602 ERROR [STDERR] at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2945)
| 2007-07-18 13:20:13,602 ERROR [STDERR] at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:688)
| 2007-07-18 13:20:13,602 ERROR [STDERR] at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:544)
| 2007-07-18 13:20:13,602 ERROR [STDERR] at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
| 2007-07-18 13:20:13,602 ERROR [STDERR] at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
| 2007-07-18 13:20:13,602 ERROR [STDERR] at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228)
| 2007-07-18 13:20:13,602 ERROR [STDERR] at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
| 2007-07-18 13:20:13,602 ERROR [STDERR] at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
| 2007-07-18 13:20:13,602 ERROR [STDERR] at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
| 2007-07-18 13:20:13,602 ERROR [STDERR] at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
| 2007-07-18 13:20:13,602 ERROR [STDERR] at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
| 2007-07-18 13:20:13,602 ERROR [STDERR] at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
| 2007-07-18 13:20:13,602 ERROR [STDERR] at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
| 2007-07-18 13:20:13,603 ERROR [STDERR] at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
| 2007-07-18 13:20:13,603 ERROR [STDERR] at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:92)
| 2007-07-18 13:20:13,603 ERROR [STDERR] ... 49 more
|
|
I think that something wrong with virtualhosts configuration on our production server. Another environments (JBOSS server version, Seam version etc.) are the same.
Or may be you con roccomend another way to start services (which can create threads) within Jboss Seam?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065308#4065308
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065308
18Â years, 11Â months
[JBossCache] - Re: PojoCache with Compile Time Weaving on JBoss 4.2.0 ?
by mbroons
1) I removed jboss-web-cluster.sar from the distribution and it
worked fine.
2) I used the following jboss-aop.xml for aopc compilation and it worked fine.
<?xml version="1.0" encoding="UTF-8"?>
| <aop>
|
| <!-- If a POJO has JDK5 PojoCacheable annotation, it will be aspectized. -->
| <prepare expr="field(* @org.jboss.cache.aop.annotation.PojoCacheable->*)" />
|
| <!-- Make any POJO with a JDK5 PojoCacheable annotation as a Subject/Observerable -->
| <bind pointcut="set(* @org.jboss.cache.aop.annotation.PojoCacheable->*)">
| <interceptor class="org.jboss.aspects.patterns.observable.SubjectInterceptor"/>
| </bind>
|
| <introduction class="@org.jboss.cache.aop.annotation.PojoCacheable">
| <mixin>
| <interfaces>org.jboss.aspects.patterns.observable.Subject</interfaces>
| <class>org.jboss.aspects.patterns.observable.SubjectImpl</class>
| <construction>new org.jboss.aspects.patterns.observable.SubjectImpl(this)</construction>
| </mixin>
| </introduction>
|
| <!-- If a POJO has JDK5 InstanceOfPojoCacheable annotation, it will be aspectized. -->
| <prepare expr="field(* $instanceof{(a)org.jboss.cache.aop.annotation.InstanceOfPojoCacheable}->*)" />
|
| <!-- Make any POJO with a JDK5 InstanceOfPojoCacheable annotation as a Subject/Observerable -->
| <bind pointcut="set(* @org.jboss.cache.aop.annotation.InstanceOfPojoCacheable->*)">
| <interceptor class="org.jboss.aspects.patterns.observable.SubjectInterceptor"/>
| </bind>
|
| <introduction class="@org.jboss.cache.aop.annotation.InstanceOfPojoCacheable">
| <mixin>
| <interfaces>org.jboss.aspects.patterns.observable.Subject</interfaces>
| <class>org.jboss.aspects.patterns.observable.SubjectImpl</class>
| <construction>new org.jboss.aspects.patterns.observable.SubjectImpl(this)</construction>
| </mixin>
| </introduction>
|
| </aop>
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065306#4065306
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065306
18Â years, 11Â months