MDB synchronize onMessage()?
Can we somehow synchronize the onMessage() method of MDB so that when a message is being processed, other messages are not processed?
I have a application which is receiving similar message from 2 different application, but from a seperate Q(listener). So, I want my MDB not to process message 2 from application2 if it is processing message 1 from application 1. How can I achieve this?
Appreciate your help.
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar id="ejb-jar_ID" version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
<display-name>
IRDriverProxyEJB</display-name>
<enterprise-beans>
<message-driven id="IRMatchDriverEJB">
<ejb-name>IRMatchDriverEJB</ejb-name>
<ejb-class>com.stpaultravelers.dedtrk.irmatchdriver.ejb.IRMatchDriverEJB</ejb-class>
<transaction-type>Bean</transaction-type>
<message-destination-type>javax.jms.Queue</message-destination-type>
<activation-config>
<activation-config-property>
<activation-config-property-name>acknowledgeMode</activation-config-property-name>
<activation-config-property-value>Auto-acknowledge</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>destinationType</activation-config-property-name>
<activation-config-property-value>javax.jms.Queue</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>subscriptionDurability</activation-config-property-name>
<activation-config-property-value>Durable</activation-config-property-value>
</activation-config-property>
</activation-config>
<resource-ref id="ResourceRef_1116595548618">
<res-ref-name>jdbc/DB2CON5</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-ref id="ResourceRef_1153729932478">
<description>
</description>
<res-ref-name>jms/QCF/IRMatchDriver</res-ref-name>
<res-type>javax.jms.QueueConnectionFactory</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-ref id="ResourceRef_1153730347156">
<description>
</description>
<res-ref-name>jms/Q/IRMatchDriverRequest</res-ref-name>
<res-type>javax.jms.Queue</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-ref id="ResourceRef_1153730494385">
<description>
</description>
<res-ref-name>jms/Q/IRMatchDriverResponse</res-ref-name>
<res-type>javax.jms.Queue</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-ref id="ResourceRef_1153730494386">
<description>
</description>
<res-ref-name>jms/Q/IRMatchDriverErrorRequest</res-ref-name>
<res-type>javax.jms.Queue</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-ref id="ResourceRef_1153730494387">
<description>
</description>
<res-ref-name>jms/Q/IRMatchDriverErrorResponse</res-ref-name>
<res-type>javax.jms.Queue</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
</message-driven>
</enterprise-beans>
</ejb-jar>
Thats the application deployment descriptor. Nothin much in server specific DD.
Similar Messages
-
Why do I see only one MDB?
Hi,
I'm having a weird issue running my MDB on SAS9.01: I have a stateless EJB JMS producer and an MDB which is both a consumer and a producer.
The test logic is this:
1. the ejb sends a single message
2. the mdb's onMessage method is triggered and does the following:
if the methos has not been called over 5 times (to prevent infinite loops, you'll see why in a sec):
a. sends another message to the queue
b. sleeps for 5 secs
I would have expected that mdb instances would deal with the messages simultaneously, but this is not the case. The messages are handled in a SERIALIZED manner by 2 MDB instances (confirmed by printing out the mdb's toString() result).
why? how can I make sure that messages are consumed more aggressively?
thanks.problem solved: needed to wrap the message-sending operation in its own transaction, so it completes before the mdb sleeps. This probably means I'll have to work harder to manage the state of my entity beans, but I don't see any other way..
-
I have implemented a transformation server as a JMS client. This is not
written as a EJB bean, partly because I'm not very familiar with EJB beans.
I'm being told MDB is the way to go (I'm a bit reluctant in front of the
additional work) for the usual reasons : transaction-control (not really an
issue right now for me but may become one), ease of deployment and
centralized monitoring. Fair enough.
My standalone JMS client creates a lot of variables at initialization (such
as a precompiled XSLT stylesheet to substantially improve the speed of each
transformation).
Where should this be created if I were to convert my standalone JMS client
into an MDB ? In ejbCreate() ?
I'm also a bit worried about a few aspects :
1) Performance, the size of requests may vary tremendously and I currently
use a synchronous receive on my input queue, is this more efficient (I pull
messages when I'm ready) than using beans and onMessage() ? In other words,
will the container try to push message notifications to MDB bean instances
that are not ready ?
2) My standalone JMS consumer is also a producer to several destinations
(including temporary queues, permanent queues and topics), is there any
limitation to the use of JMS destinations in an MDB (what about selectors ?)
vs a standalone java JMS application?
3) My standalone JMS consumer creates a few threads per request. Any gotchas
in a MDB vs a standalone Java JMS application ? Are MDB passivated at any
time ?
Many thanks for any answer,
Rosalie
RosalieRosalie Mignon wrote:
I have implemented a transformation server as a JMS client. This is not
written as a EJB bean, partly because I'm not very familiar with EJB beans.
I'm being told MDB is the way to go (I'm a bit reluctant in front of the
additional work) for the usual reasons : transaction-control (not really an
issue right now for me but may become one), ease of deployment and
centralized monitoring. Fair enough.There's a number of MDB advantages over writing your own JMS consumers.
I would recommend MDBs for JMS consumers running within WLS. If you
have a JMS consumer that is a separate (say client) process, then
vanilla JMS is still the way to go.
The MDB container takes care of things like reconnecting you to JMS if
it fails. It supports foreign JMS providers so your MDBs will work with
"foreign" messaging systems like MQ-Series.
>
My standalone JMS client creates a lot of variables at initialization (such
as a precompiled XSLT stylesheet to substantially improve the speed of each
transformation).
Where should this be created if I were to convert my standalone JMS client
into an MDB ? In ejbCreate() ?Yes, ejbCreate would be fine.
>
I'm also a bit worried about a few aspects :
1) Performance, the size of requests may vary tremendously and I currently
use a synchronous receive on my input queue, is this more efficient (I pull
messages when I'm ready) than using beans and onMessage() ? In other words,
will the container try to push message notifications to MDB bean instances
that are not ready ?I'm not sure I understand. You will have a pool of MDB instances all
receiving from the queue. When an instance is available and there is a
message pending, the EJB/JMS containers will call your MDB's onMessage
implementation.
>
2) My standalone JMS consumer is also a producer to several destinations
(including temporary queues, permanent queues and topics), is there any
limitation to the use of JMS destinations in an MDB (what about selectors ?)
vs a standalone java JMS application?Not that I can think of.
>
3) My standalone JMS consumer creates a few threads per request. Any gotchas
in a MDB vs a standalone Java JMS application ? You are not really allowed to create threads from an EJB. Why do you
need to create threads? In general, we wouldn't recommend that
server-side applications create new threads on each request.
Are MDB passivated at any
time ?
No
Many thanks for any answer,Your domain name is an unusual one for the J2EE world. If you can tell
us, I'd be interested to know what you're doing.
-- Rob
>
Rosalie
Rosalie -
Creating new instances of MDBs at runtime
I am creating an application with a single input point (messages on a JMS Queue). The application needs to be multi-threaded, but would like to process the messages sequentially based on the message type.
For example, a message of type A and a message type B can be processed simultaneously, but only 1 message of type A can be processed at a time. So if the application is processing a message of type A, and it receives another type A message, it must complete the first message before processing the second message.
What I would like to do is have a single MDB (called the dispatcher MDB) that listens on the input point (JMS Queue). The dispatcher MDB calls onMessage() which will look at the message type and the forward to another JMS Queue based on the type. For example, if message type is A, send to Queue A, else if message type B, send to Queue B and so on. Each queue would have a MDB instance servicing the messages. In order to process the messages sequentially on each queue, the pool size for each MDB would be 1.
My problem is that I don't know how many message types there are, this is decided at runtime.
How can I create the Queues and register MDB at runtime?
After some research, I have found the ability to create the Queues using JMX. But, I cannot seem to find details on how to create a register an MDB and tell it to listen on a particular Queue. Has anyone had any experience doing such a thing?OK, i have some code similar to below, where I want to
create a new instance of the class BookRecord which
takes parameters from Book b, which is an instance if
the class Book.
//This is code from the Libraray class
public void addBookRecord(Book b, String author,
String title)
bookHolder = new BookRecord(b, author, title);
}Now this creates a new BookRecord object that has an
author and title which refer to the Book b. Now when i
invoke the method again, choosing the same object for
b as i did last time it creates a second BookRecord
object, when I just want it to overwrite the values of
the previous BookRecord object. how can i do this
simply?
Thanks in advanceWell I am not quite sure if I understood.
But refering to what you wrote I would say:
//This is code from the Libraray class
public void addBookRecord(Book b, String author, String title)
if(bookHolder.getBook() != b)
// Not the same book object
bookHolder = new BookRecord(b, author, title);
else
// same book object
bookHolder.setAuthor(author);
book.setTitle(tile);
As I said may be totally not what you are looking for.
Regards
Tarik -
MDB is not fired when message in Topic
Hi,
Weblogic 7.0.2.0
remote Weblogic 7.0.2.0
I have a MDB that is listening to a remote topic.
The deployment is ok, and when I monitor the MDB in the weblogic console
the connection Alive is true, so is connecting and listening to the
remote Topic.
The problem I am having is that when the remote Topic receives a message
the MDB's onMessage method is not called.
I would appreciate any help on this.
Publius
It is pretty likely there is some basic misconfiguration. As I wrote
earlier, if there are no problems in the log file, please post
your config.xml and MDB descriptor xml files and I (or someone)
will take a look.
Tom
Ruowei Wu wrote:
> The log file is fine until the message is published, which means the onMessage()
> in MDB doesn't receive anything, but publish doesn't have any exception.
>
>
> Tom Barnes <[email protected]> wrote:
>
>>The same advice applies. The first place to look is in your log files.
>>
>>Ruowei Wu wrote:
>>
>>>we have exactly same problem, message post is fine, but MDB doesn't
>>
>>receive anything,
>>
>>>looks like mdb container doesn't deliver.
>>>
>>>
>>>Tom Barnes <[email protected]> wrote:
>>>
>>>
>>>>Check for warnings and error messages in your log, as an MDB can
>>>>still deploy successfully even if it fails to create its JMS connection.
>>>>The MDB container will just keep retrying to connect.
>>>>
>>>>If this doesn't help, please post your MDB descriptor files and
>>>>I'll take a look.
>>>>
>>>>Tom, BEA
>>>>
>>>>Publius Ismanescu wrote:
>>>>
>>>>
>>>>>Hi,
>>>>>
>>>>>
>>>>>Weblogic 7.0.2.0
>>>>>remote Weblogic 7.0.2.0
>>>>>
>>>>>
>>>>>I have a MDB that is listening to a remote topic.
>>>>>The deployment is ok, and when I monitor the MDB in the weblogic console
>>>>
>>>>>the connection Alive is true, so is connecting and listening to the
>>>>
>>>>>remote Topic.
>>>>>
>>>>>The problem I am having is that when the remote Topic receives a message
>>>>
>>>>>the MDB's onMessage method is not called.
>>>>>
>>>>>I would appreciate any help on this.
>>>>>
>>>>>Publius
>>>>>
>>>>
>
-
Throttling MDB performance running against MQSeries queue
I have an unusual requirement for an application. We have a non-transactional MQSeries queue that is bound as a foreign JMS destination in client mode (thanks to the folks on the forum who helped me configure that!).
The problem is that the cluster that we are running our application on has limited capacity and I need to make sure that the MDB that will be listening to the queue does not surpass a certain TPS limit (say, 1 TPS). This article explains how to throttle performance using a separate execute thread -- http://e-docs.bea.com/wls/docs81/perform/AppTuning.html#1105201
However, this requires you to set the MDB's "dispatch-policy' attribute to the lower priority queue in ejb-jar.xml. However, the documentation on this attribute -- http://edocs.beasys.com/wls/docs81/ejb/DDreference-ejb-jar.html#1113605 -- indicates that this attribute is only honoured if the source queue is transactional in nature.
What to do? A transactional queue is a hard sell to our infrastructure folks. Can I use the extended transactional client and have this work?
FYI - using the max-beans-in-free-pool does not do a sufficiently good job of limiting performance.
Any other ideas?another possibility might be the following scenario:
create a local jms-destination, maybe with a jdbc-store.
then use the weblogic bridge to transfer messages into the local jms-queue.
at this point you can configure flow-control for the connection factory
to limit transferred messages.
the problem in this case is, that unprocessed messages have to be stored
on the application server or in the database.
but maybe this can help you.
--Klaas
gbrail schrieb:
> As the doc describes, your MDB's "onMessage" method is invoked by a thread created by MQ. That means we have no control over it, or how fast it runs. I don't know of any "throttling" features in MQ either that would help.
>
> The only (ugly!) suggestion I can think of is that you should set "max-beans-in-free-pool" to 1 and periodically "sleep" in your onMessage method so that you don't get messages too fast!
>
> (And even if you were able to use a separate execute queue, or a transactional queue, you still could potentially get messages more than once per second, so you might still need to sleep anyway.) -
Using WLS 7.0 and JBuilder 7
I've created a MDB in JBuilder 7 and auto deployed it into an already
running instance of WLS 7.0. The MDB simply has a System.out in the
onMessage() method.
From within the WLS 7.0 Console i've configured the following settings ...
- JMS Connection Factory
- JMS Store
- JMS Server w/ JMS Topic
All the JNDI names are correct and the bean deploys normally.
I've also created a client which simply sends a message to the topic.
Problem:
WLS recieves the messages but they are never sent to the MDB and onMessage()
is never called. Is there a setting that I am missing. This example works
fine in WLS 6.1 but I can't seem to get it to work in 7.0.
After some time I get the following error:
<Jul 19, 2002 11:32:26 AM PDT> <Error> <Management> <140001> <Error getting
attribute on MBean
mydomain:Application=myMDBModule,EJBComponent=myMDBModule,EJBDescriptor=EJBD
escriptor-1,Location=myserver,MessageDrivenDescriptor=MessageDrivenDescripto
r-1,Name=Pool-1,Type=Pool,WeblogicEJBJar=WeblogicEJBJar-3,WeblogicEnterprise
Bean=WeblogicEnterpriseBean-1. Method: null. Exception:
javax.management.AttributeNotFoundException: .
javax.management.AttributeNotFoundException:
at
weblogic.management.internal.DynamicMBeanImpl.getXAttributeInfo(DynamicMBean
Impl.java:1966)
at
weblogic.management.internal.DynamicMBeanImpl.getAttribute(DynamicMBeanImpl.
java:549)
at
com.sun.management.jmx.MBeanServerImpl.getAttribute(MBeanServerImpl.java:118
1)
at
com.sun.management.jmx.MBeanServerImpl.getAttribute(MBeanServerImpl.java:115
1)
at
weblogic.management.internal.RemoteMBeanServerImpl.getAttribute(RemoteMBeanS
erverImpl.java:838)
at
weblogic.management.internal.MBeanProxy.getOneAttribute(MBeanProxy.java:285)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:188)
at $Proxy120.getAttribute(Unknown Source)
at
weblogic.management.console.utils.MBeans.getDisplayName(MBeans.java:1023)
at
weblogic.management.console.utils.MBeans.getDisplayName(MBeans.java:846)
at
weblogic.management.console.tags.nav.NavDeleteMenuTag.doStartTag(NavDeleteMe
nuTag.java:56)
at
weblogic.management.console.webapp._ejb._weblogic.__nav._jspService(__nav.ja
va:1796)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
tStubImpl.java:945)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:332)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:242)
at
weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImp
l.java:539)
at
weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImp
l.java:368)
at weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:119)
at
weblogic.management.console.webapp._ejb.__nav._jspService(__nav.java:189)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
tStubImpl.java:945)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:332)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:242)
at
weblogic.servlet.internal.RequestDispatcherImpl$ForwardAction.run(RequestDis
patcherImpl.java:341)
at
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
r.java:721)
at
weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImp
l.java:251)
at weblogic.servlet.jsp.PageContextImpl.forward(PageContextImpl.java:115)
at
weblogic.management.console.actions.ForwardAction.perform(ForwardAction.java
:35)
at
weblogic.management.console.actions.internal.ActionServlet.doAction(ActionSe
rvlet.java:171)
at
weblogic.management.console.actions.internal.ActionServlet.doGet(ActionServl
et.java:91)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
tStubImpl.java:945)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:332)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:242)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
ebAppServletContext.java:5363)
at
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
r.java:721)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:3043)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2466)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
>
Any help would be great! Thank you!
-rjmDon't know off hand. It seems tranage that you get the MDB error in the log
file, yet the stack trace is in a JSP. You might try posting to web
services or EJB.
_sjz.
"Renato J. Mascardo" <[email protected]> wrote in message
news:[email protected]...
>
Using WLS 7.0 and JBuilder 7
I've created a MDB in JBuilder 7 and auto deployed it into an already
running instance of WLS 7.0. The MDB simply has a System.out in the
onMessage() method.
From within the WLS 7.0 Console i've configured the following settings ...
- JMS Connection Factory
- JMS Store
- JMS Server w/ JMS Topic
All the JNDI names are correct and the bean deploys normally.
I've also created a client which simply sends a message to the topic.
Problem:
WLS recieves the messages but they are never sent to the MDB andonMessage()
is never called. Is there a setting that I am missing. This exampleworks
fine in WLS 6.1 but I can't seem to get it to work in 7.0.
After some time I get the following error:
<Jul 19, 2002 11:32:26 AM PDT> <Error> <Management> <140001> <Errorgetting
attribute on MBean
mydomain:Application=myMDBModule,EJBComponent=myMDBModule,EJBDescriptor=EJBD
>
escriptor-1,Location=myserver,MessageDrivenDescriptor=MessageDrivenDescripto
>
r-1,Name=Pool-1,Type=Pool,WeblogicEJBJar=WeblogicEJBJar-3,WeblogicEnterprise
Bean=WeblogicEnterpriseBean-1. Method: null. Exception:
javax.management.AttributeNotFoundException: .
javax.management.AttributeNotFoundException:
at
weblogic.management.internal.DynamicMBeanImpl.getXAttributeInfo(DynamicMBean
Impl.java:1966)
at
weblogic.management.internal.DynamicMBeanImpl.getAttribute(DynamicMBeanImpl.
java:549)
at
com.sun.management.jmx.MBeanServerImpl.getAttribute(MBeanServerImpl.java:118
1)
at
com.sun.management.jmx.MBeanServerImpl.getAttribute(MBeanServerImpl.java:115
1)
at
weblogic.management.internal.RemoteMBeanServerImpl.getAttribute(RemoteMBeanS
erverImpl.java:838)
at
weblogic.management.internal.MBeanProxy.getOneAttribute(MBeanProxy.java:285)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:188)
at $Proxy120.getAttribute(Unknown Source)
at
weblogic.management.console.utils.MBeans.getDisplayName(MBeans.java:1023)
at
weblogic.management.console.utils.MBeans.getDisplayName(MBeans.java:846)
at
weblogic.management.console.tags.nav.NavDeleteMenuTag.doStartTag(NavDeleteMe
nuTag.java:56)
at
weblogic.management.console.webapp._ejb._weblogic.__nav._jspService(__nav.ja
va:1796)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
tStubImpl.java:945)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:332)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:242)
at
weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImp
l.java:539)
at
weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImp
l.java:368)
atweblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:119)
at
weblogic.management.console.webapp._ejb.__nav._jspService(__nav.java:189)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
tStubImpl.java:945)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:332)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:242)
at
weblogic.servlet.internal.RequestDispatcherImpl$ForwardAction.run(RequestDis
patcherImpl.java:341)
at
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
r.java:721)
at
weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImp
l.java:251)
atweblogic.servlet.jsp.PageContextImpl.forward(PageContextImpl.java:115)
at
weblogic.management.console.actions.ForwardAction.perform(ForwardAction.java
:35)
at
weblogic.management.console.actions.internal.ActionServlet.doAction(ActionSe
rvlet.java:171)
at
weblogic.management.console.actions.internal.ActionServlet.doGet(ActionServl
et.java:91)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
tStubImpl.java:945)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:332)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:242)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
ebAppServletContext.java:5363)
at
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
r.java:721)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:3043)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2466)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
>
Any help would be great! Thank you!
-rjm -
Urgent: WLS 8.1 MDB
Hi,
I have a servlet posting Object message to JMS Q. The MDB 's onMessage is executed,but
it results in the below. I am using WLS 8.1 exploded directory structure. How
do I mahe MDB locate the classes that are compiled into WEB-INF/classes directory
weblogic.jms.common.JMSException: Error deserializing object
at weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.java:144)
at com.hp.fd2.ReaderBean.onMessage(ReaderBean.java:88)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:382)
at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
Caused by: java.lang.ClassNotFoundException: com.hp.fd2.TestObjectPostPrg
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:198)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:223)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:217)
at weblogic.jms.common.ObjectMessageImpl$ObjectInputStream2.resolveClass(ObjectMessageImpl.java:305)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1513)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.java:13
Don't know. Post to the ejb news group, which is
better suited to handling ejb related questions. In
the case below, JMS is simply using the EJB's class-loader.
Note that for URGENT requests, newsgroups are not
recommended. These groups are not maintained by
customer support, and response times vary. Use customer
support, and specify your priority (system down, etc.).
Tom
JC wrote:
> Hi,
> Any pointers will be appreciated...Thanks
>
>
> "JC" <[email protected]> wrote:
>
>>Hi,
>>I have a servlet posting Object message to JMS Q. The MDB 's onMessage
>>is executed,but
>>it results in the below. I am using WLS 8.1 exploded directory structure.
>>How
>>do I mahe MDB locate the classes that are compiled into WEB-INF/classes
>>directory
>>?
>>weblogic.jms.common.JMSException: Error deserializing object
>> at weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.java:144)
>> at com.hp.fd2.ReaderBean.onMessage(ReaderBean.java:88)
>> at weblogic.ejb20.internal.MDListener.execute(MDListener.java:382)
>> at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
>> at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
>> at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
>> at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
>> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
>> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
>>Caused by: java.lang.ClassNotFoundException: com.hp.fd2.TestObjectPostPrg
>> at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:198)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
>> at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:223)
>> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forName(Class.java:217)
>> at weblogic.jms.common.ObjectMessageImpl$ObjectInputStream2.resolveClass(ObjectMessageImpl.java:305)
>> at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1513)
>> at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
>> at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
>> at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
>> at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
>> at weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.java:13
>
>
-
Is it possible to access a session object from a MDB?
Yes....it should be possible. There shouldn't be any reason why your MDB couldn't instantiate an InitialContext and perform the appropriate lookup. Granted, all of this will have to happen in the MDB's onMessage() method.
Regards,
J. -
Ok,
I am bit confused with how exactly MDBs work with Transactions.
For example,
suppose we have a simple standalone java message producer which sends a message to a Queue. A MDB's onMessage() picks it up.
Let's say the MDB makes some updates to the database and then invokes a method on a stateless session bean which also updates a database.
By default the transaction attribute of the MDB and stateless session bean would be REQUIRED.
If the stateless session bean database update fails, I presume the MDB's database updates also get rolled back.
But, does the message get rolled back? If not when would the message be rolled back?
Does it make any difference if the MDB is a topic or a queue? Does it make any difference if the message producer is a standalone client or
a stateless session bean with it's own transactional behaviour?
Any help appreciated.
Thanks.The general principle is: if you have a MDB which consumes a message in a transaction, and that transaction is rolled back, then the message is "rolled back". This means that it is put back on the queue or topic. It will then be delivered to the MDB again.
If your MDB calls a session bean then the two can share the same global transaction as you suggest.
Note however that the transaction which consumes the message is completely separate from any transaction which placed the message on the queue in the first place. JMS completely decouples the two steps. Once the message is added to the queue the producer is irrelevant.
Nigel -
JMS Queue problems causing EJB to rollback....
We recently purchased WLS 6.1 and we have been using the product for the last few
months. I am having a problem which I have detailed below. I have provided as much
information as possible. If you need additional information, please let me know.
Server A Config:
Pentium III, 1000Mhz
Windows 2000, SP2
WLS WebLogic Server 6.1 SP2 12/18/2001 11:13:46 #154529
Server B Config:
SunBlade 100
Solaris 5.8
WebLogic Server 6.1 SP2 12/18/2001 11:13:46 #154529
Server A contains a session EJB called GoalManager. This EJB has a method named cancel().
The transactional attribute for all methods supported by this bean is REQUIRED. GoalManager
uses a transactional data source deployed on Server A named "goal". There is nothing
special about this data source aside from the fact that I have enabled two phase
commit for it because a previous error was indicating that this was a required setting
for the pool. A JMS server exists on Server B. A queue named "emailQueue" is set
up as a destination on this JMS server. I also have a MDB on Server B that listens
for messages on this queue. When a message is received, the MDB's onMessage() method
extracts some properties from the message and sends an email to the specified recipient
in the message. I have confirmed that this queue and MDB are working properly because
I ran a small test program from the command prompt which creates a message and sends
it to the queue on Server B. The MDB gets the message and sends the email to the
correct recipient, so I am sure there are no misconfigurations on the server.
The problem is as follows: The cancel() method in the GoalManager EJB on Server A
performs some database work. If no exceptions are raised, the last task in the method
attempts to access the queue on Server B and send a message to the queue. Here is
the code that I am using to access the queue:
QueueConnectionFactory queueFactory = (QueueConnectionFactory)context.lookup( "javax.jms.QueueConnectionFactory");
QueueConnection queueConnection = queueFactory.createQueueConnection();
Queue queue = (Queue)context.lookup( "emailQueue");
QueueSession queueSession = queueConnection.createQueueSession( false, Session.AUTO_ACKNOWLEDGE);
QueueSender queueSender = queueSession.createSender( queue);
The cancel() method executes without error, but when the EJB container on Server
A attempts to commit the transaction at the end of the cancel() method, I am receiving
the following error on Server A's log:
<Error> <EJB> <Exception during commit of transaction Name=[EJB com.frx.emp.go.ejb.session.goal.GoalManagerBean.cancelGoal(com.frx.emp.entity.Employee,com.frx.emp.go.entity.Goal)],
Xid=0:7c2dda32cf39a36e(6911242),
Status=Rolled back. [Reason=javax.transaction.xa.XAException],
numRepliesOwedMe=0,
numRepliesOwedOthers=0,
seconds since begin=2,
seconds left=10,
ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=rolledback,assigned=server1),
ServerResourceInfo[JMS_EMailServer_NotDurable]=(state=rolledback,assigned=server1),
SCInfo[FRX+server1]=(state=rolledback),
SCInfo[frxnet+wlsvr1]=(state=rolledback),
properties=({weblogic.transaction.name=[EJB com.frx.emp.go.ejb.session.goal.GoalManagerBean.cancelGoal(com.frx.emp.entity.Employee,com.frx.emp.go.entity.Goal)],
weblogic.jdbc=t3://172.16.200.9:9005}),
OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=server1+172.16.200.9:9005+FRX+,
Resources={})],
CoordinatorURL=server1+172.16.200.9:9005+FRX+): javax.transaction.xa.XAException
at weblogic.jms.backend.BEXAResource.prepare(BEXAResource.java:853)
at weblogic.transaction.internal.ServerResourceInfo.prepare(ServerResourceInfo.java:1124)
at weblogic.transaction.internal.ServerResourceInfo.prepare(ServerResourceInfo.java:370)
at weblogic.transaction.internal.ServerSCInfo.startPrepare(ServerSCInfo.java:186)
at weblogic.transaction.internal.ServerTransactionImpl.localPrepare(ServerTransactionImpl.java:1822)
at weblogic.transaction.internal.ServerTransactionImpl.globalPrepare(ServerTransactionImpl.java:1607)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:218)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:190)
at weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:231)
at com.frx.emp.go.ejb.session.goal.GoalManagerBean_e3dvd2_EOImpl.cancelGoal(GoalManagerBean_e3dvd2_EOImpl.java:459)
at com.frx.emp.go.web.handler.UpdateGoalHandler.handleRequest(UpdateGoalHandler.java:55)
at com.frx.emp.web.mvc.HandlerMappedController.service(HandlerMappedController.java:115)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2495)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2204)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
--------------- nested within: ------------------
weblogic.transaction.RollbackException: Could not prepare resource 'JMS_EMailServer_NotDurable
- with nested exception:
[javax.transaction.xa.XAException]
at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1475)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:263)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:190)
at weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:231)
at com.frx.emp.go.ejb.session.goal.GoalManagerBean_e3dvd2_EOImpl.cancelGoal(GoalManagerBean_e3dvd2_EOImpl.java:459)
at com.frx.emp.go.web.handler.UpdateGoalHandler.handleRequest(UpdateGoalHandler.java:55)
at com.frx.emp.web.mvc.HandlerMappedController.service(HandlerMappedController.java:115)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2495)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2204)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
Just a quick note, I tried to change the following line to specify a "transacted"
JMS session by passing "true" to the statement below. When I tested this, the cancel()
method raised no exceptions, but the MDB on Server B is never invoked and the email
is never sent. Strange.
QueueSession queueSession = queueConnection.createQueueSession( true, Session.AUTO_ACKNOWLEDGE);
If you need more info, let me know. I thank you for your help.
Correct. According to the trace you have it set at 10 seconds, while the default is 30 seconds.
Tom
SAF wrote:
> Thanks for the reply.
>
> Increase the trx time? You mean JTA, right?
>
> I already opened a case with BEA, so I'm waiting to get a response from them.
>
> Thanks again,
>
> Raffi
>
> Tom Barnes <[email protected]> wrote:
> >Hi,
> >
> >I looked at the BEXAResource.java source code which the stack trace points
> >at. It seems that from the
> >JMS server's resource manager's point of view, it never heard of the transaction
> >before, indicating
> >that the transaction may have already rolled back. I think this could
> >happen if the transaction
> >times out before commit() is called, but I'm not sure what is wrong in your
> >case -- as according
> >to the trace you provided, your tx is 2 seconds old and your tx-timout is
> >10 seconds.
> >
> >In any case, it looks like the culprit may be in the transaction code and
> >not the JMS code...
> >
> >I suggest:
> > A) increasing your tx timeout (what the heck give it a try)
> > B) could it somehow be a clock synchronization problem? are multiple
> >servers involved?
> > C) posting to the transaction newsgroup
> > D) contacting customer support
> >
> >Tom
> >
> >SAF wrote:
> >
> >> We recently purchased WLS 6.1 and we have been using the product for the
> >last few
> >> months. I am having a problem which I have detailed below. I have provided
> >as much
> >> information as possible. If you need additional information, please let
> >me know.
> >>
> >> Server A Config:
> >> Pentium III, 1000Mhz
> >> Windows 2000, SP2
> >> WLS WebLogic Server 6.1 SP2 12/18/2001 11:13:46 #154529
> >>
> >> Server B Config:
> >> SunBlade 100
> >> Solaris 5.8
> >> WebLogic Server 6.1 SP2 12/18/2001 11:13:46 #154529
> >>
> >> Server A contains a session EJB called GoalManager. This EJB has a method
> >named cancel().
> >> The transactional attribute for all methods supported by this bean is
> >REQUIRED. GoalManager
> >> uses a transactional data source deployed on Server A named "goal". There
> >is nothing
> >> special about this data source aside from the fact that I have enabled
> >two phase
> >> commit for it because a previous error was indicating that this was a
> >required setting
> >> for the pool. A JMS server exists on Server B. A queue named "emailQueue"
> >is set
> >> up as a destination on this JMS server. I also have a MDB on Server B
> >that listens
> >> for messages on this queue. When a message is received, the MDB's onMessage()
> >method
> >> extracts some properties from the message and sends an email to the specified
> >recipient
> >> in the message. I have confirmed that this queue and MDB are working properly
> >because
> >> I ran a small test program from the command prompt which creates a message
> >and sends
> >> it to the queue on Server B. The MDB gets the message and sends the email
> >to the
> >> correct recipient, so I am sure there are no misconfigurations on the
> >server.
> >>
> >> The problem is as follows: The cancel() method in the GoalManager EJB
> >on Server A
> >> performs some database work. If no exceptions are raised, the last task
> >in the method
> >> attempts to access the queue on Server B and send a message to the queue.
> >Here is
> >> the code that I am using to access the queue:
> >>
> >> QueueConnectionFactory queueFactory = (QueueConnectionFactory)context.lookup(
> >"javax.jms.QueueConnectionFactory");
> >> QueueConnection queueConnection = queueFactory.createQueueConnection();
> >> Queue queue = (Queue)context.lookup( "emailQueue");
> >> QueueSession queueSession = queueConnection.createQueueSession( false,
> >Session.AUTO_ACKNOWLEDGE);
> >> QueueSender queueSender = queueSession.createSender( queue);
> >>
> >> The cancel() method executes without error, but when the EJB container
> >on Server
> >> A attempts to commit the transaction at the end of the cancel() method,
> >I am receiving
> >> the following error on Server A's log:
> >>
> >> <Error> <EJB> <Exception during commit of transaction Name=[EJB com.frx.emp.go.ejb.session.goal.GoalManagerBean.cancelGoal(com.frx.emp.entity.Employee,com.frx.emp.go.entity.Goal)],
> >> Xid=0:7c2dda32cf39a36e(6911242),
> >> Status=Rolled back. [Reason=javax.transaction.xa.XAException],
> >> numRepliesOwedMe=0,
> >> numRepliesOwedOthers=0,
> >> seconds since begin=2,
> >> seconds left=10,
> >> ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=rolledback,assigned=server1),
> >> ServerResourceInfo[JMS_EMailServer_NotDurable]=(state=rolledback,assigned=server1),
> >> SCInfo[FRX+server1]=(state=rolledback),
> >> SCInfo[frxnet+wlsvr1]=(state=rolledback),
> >> properties=({weblogic.transaction.name=[EJB com.frx.emp.go.ejb.session.goal.GoalManagerBean.cancelGoal(com.frx.emp.entity.Employee,com.frx.emp.go.entity.Goal)],
> >>
> >> weblogic.jdbc=t3://172.16.200.9:9005}),
> >> OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=server1+172.16.200.9:9005+FRX+,
> >> Resources={})],
> >> CoordinatorURL=server1+172.16.200.9:9005+FRX+): javax.transaction.xa.XAException
> >> at weblogic.jms.backend.BEXAResource.prepare(BEXAResource.java:853)
> >> at weblogic.transaction.internal.ServerResourceInfo.prepare(ServerResourceInfo.java:1124)
> >> at weblogic.transaction.internal.ServerResourceInfo.prepare(ServerResourceInfo.java:370)
> >> at weblogic.transaction.internal.ServerSCInfo.startPrepare(ServerSCInfo.java:186)
> >> at weblogic.transaction.internal.ServerTransactionImpl.localPrepare(ServerTransactionImpl.java:1822)
> >> at weblogic.transaction.internal.ServerTransactionImpl.globalPrepare(ServerTransactionImpl.java:1607)
> >> at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:218)
> >> at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:190)
> >> at weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:231)
> >> at com.frx.emp.go.ejb.session.goal.GoalManagerBean_e3dvd2_EOImpl.cancelGoal(GoalManagerBean_e3dvd2_EOImpl.java:459)
> >> at com.frx.emp.go.web.handler.UpdateGoalHandler.handleRequest(UpdateGoalHandler.java:55)
> >> at com.frx.emp.web.mvc.HandlerMappedController.service(HandlerMappedController.java:115)
> >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >> at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
> >> at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
> >> at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2495)
> >> at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2204)
> >> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
> >> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
> >> --------------- nested within: ------------------
> >> weblogic.transaction.RollbackException: Could not prepare resource 'JMS_EMailServer_NotDurable
> >> - with nested exception:
> >> [javax.transaction.xa.XAException]
> >> at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1475)
> >> at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:263)
> >> at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:190)
> >> at weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:231)
> >> at com.frx.emp.go.ejb.session.goal.GoalManagerBean_e3dvd2_EOImpl.cancelGoal(GoalManagerBean_e3dvd2_EOImpl.java:459)
> >> at com.frx.emp.go.web.handler.UpdateGoalHandler.handleRequest(UpdateGoalHandler.java:55)
> >> at com.frx.emp.web.mvc.HandlerMappedController.service(HandlerMappedController.java:115)
> >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >> at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
> >> at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
> >> at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2495)
> >> at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2204)
> >> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
> >> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
> >>
> >> Just a quick note, I tried to change the following line to specify a "transacted"
> >> JMS session by passing "true" to the statement below. When I tested this,
> >the cancel()
> >> method raised no exceptions, but the MDB on Server B is never invoked
> >and the email
> >> is never sent. Strange.
> >>
> >> QueueSession queueSession = queueConnection.createQueueSession( true,
> >Session.AUTO_ACKNOWLEDGE);
> >>
> >> If you need more info, let me know. I thank you for your help.
> >
-
Startup Classes and JMS - Suggestions Please!
I'm in serious need of having several resources initialized before beans
start handling requests.
I tried implementing a Weblogic Startup Class, and it works fine - as long
as it's the first thing
to run! -- the problem is, when my Message Driven Beans deploy, if there are
messages waiting
for them in their durable subscriptions, they immediately start
processing... then about 30 seconds
later Weblogic (6.0sp1) gets around to starting my startup class. If I put
code in each MDB that
kicks off the initialization when they are invoked I still run into
problems, because my initialization
takes a LONG time (more than 2 minutes) - so I end up with lots of
transaction rollbacks... which
are very annoying and clutter up the log files, and scare customers of the
product.
Is there anyway to make a startup class/servlet/something that runs and
completes before any
other processing occurs?
Thanks,
JamesYes, Startup servlet has the same problem - it doesn't 'startup' until after
jms messages are already being delivered. :( aside from this, there are
class loader issues -servlet space and ejb space are not the same...
Thanks though,
James
"minjiang" <[email protected]> wrote in message
news:[email protected]...
Hi, did you ever try startup servlet? not startup class?
mj
James House wrote:
The only problem with creating a base class to extend is the fact that
Java only supports single inheritance, -- and I'm already inheriting...
>>
I've been involved with many projects that use WLServer, and in
almost every one of them, there has been a need for a startup class
that fires before the server starts handling requests.... strange that
I'd be the only one to need this, when the need has recurred so often.
James
"Raja Mukherjee" <[email protected]> wrote in message
news:[email protected]...
James,
If you have common initialization tasks to be shared by multiple MDBs,
I
would create an abstract class (a.k.a BeanAdapter class) where you canhave
all your initialization logics and have your MDB extend from it.
I am not convinced that the Startup class needs to run first. In fact,
I
have the same view that Startup class should run last. My only wishlist
for
startup class was that I should be able to specify order, which isaddressed
in 6.1.
I am also getting the feeling from different posts that MDB deploymentwould
have a re-try logic in 6.1, which I am beginning to look into. Check
(or
post) in JMS news group.
.raja
"James House" <[email protected]> wrote in message
news:[email protected]...
Thanks for the help... I like the pattern you pointed me to better
than
anything else... ... but in all cases (your method, Gene's, and whatI'm
currently doing) I still have to put some code in every MDB that
I deploy... : (
Put in a good word for me there at BEA and convince the appropriate
developer that startup classes should run first!
James
"Raja Mukherjee" <[email protected]> wrote in message
news:[email protected]...
James,
There are several ways to solve your problem. I normally use
setMessageDrivenContext to do all my initialization. There are two
types
of
initialization that I have performed here, first, reading theconfiguration
file and then load some utility classes in specific order. The
problem
with
the second was that you will have to use synchronized block
w/HotSpot
2.0
to
keep the order, which is ok. I don't use static block to do the
initialization, instead use an init() metod. Hopefully you got the
idea.
Recently, Gene Chuang created a pattern which esentially does the
same
and
I
liked the pattern because it was a nicer way of doing what I
needed to
do.
I
have changed all my examples to customer to use the new pattern.
You
can
find it in
http://theserverside.com/patterns/thread.jsp?thread_id=7270.
The
only think I do not use of this pattern is
initializeEveryContextSwap()
method. I am not convinced yet that I would need it (of course
that
might
change over the time).
Hope this helps, and thanks Gene.
.raja
"James House" <[email protected]> wrote in message
news:[email protected]...
Ok... here's some more detail:
The application is largely JMS based, and most of my Session
EJBs
are
invoked only my Message Driven Beans.
I have a large set of properties that need to be read from a
config
file,
and stored somewhere "globally". I also have a number of
utilities
that
need to get "warmed up" before I start doing any real processing(before
I start receiving messages from the JMS Topics). These
utilities
take
a
long time to warm up (a long time being about 45-60 seconds) -
because
they are loading hundereds of classes, and creating variousconnections
to external resources.
Currently I'm creating a Singleton object that reads the
configuration
file
name from an environment property, and it then parses the file,
and
starts
configuring all of these utilities. Since the "Startup Class"
didn't
work
(weblogic invokes it after I'm already receiving messages), I
put
code
at
the beginning of all of my MDB's onMessage() methods that calls
the
singleton's "getInstance()" method - which synchronizes on alock
object,
and does all of it's work.
I don't like this solution because:
1- I have to put code in EVERY message-driven bean that I
create -
if
I
forget one, everything is broken.
2- I have to increase the transaction time out of the entire
server
to
be over 60 seconds since the beans hang that long while theconfiguration
is
happening.
It seems very obvious that a "Startup Class" should be invoked
after
the
server has come completely up, but before it starts listening
for
requests -- isn't the whole point of a "startup class" to getthings
ready
that need to be done as soon as the server comes up? but alas,
the
person
who designed this at BEA apparently didn't agree with me on this
point!
Any suggestion on better solutions would be greatly appreciated.
James
"Raja Mukherjee" <[email protected]> wrote in message
news:[email protected]...
You can do it this way, but I would not recommend it, unless
that's
the
only
way to attack the problem at hand. But that's just me.
I have seen this problem with multiple clients and in most
cases
there
is
a
better way to handle it. If James give us a little more
information
on
what
type of configuration is he talking about and some background
of
his
application, we as a group can think and may be able to come
up
with
some
idea.
.raja
"Joel Nylund" <[email protected]> wrote in message
news:[email protected]...
you could wrap the starting of weblogic in your own class
and do
initialization
there. You have to be careful because of the way weblogic
classloaders
work, but
you may be able to do what you want. Weblogic is just a java
class,
so
you
can
start your class, then once your done initializing, just
call
weblogic.Server.main
-Joel
James House wrote:
I'm in serious need of having several resources
initialized
before
beans
start handling requests.
I tried implementing a Weblogic Startup Class, and it
works
fine -
as
long
as it's the first thing
to run! -- the problem is, when my Message Driven Beans
deploy,
if
there
are
messages waiting
for them in their durable subscriptions, they immediately
start
processing... then about 30 seconds
later Weblogic (6.0sp1) gets around to starting my startupclass.
If
I
put
code in each MDB that
kicks off the initialization when they are invoked I still
run
into
problems, because my initialization
takes a LONG time (more than 2 minutes) - so I end up with
lots
of
transaction rollbacks... which
are very annoying and clutter up the log files, and scarecustomers
of
the
product.
Is there anyway to make a startup class/servlet/something
that
runs
and
completes before any
other processing occurs?
Thanks,
James -
Error while trying to insert data on a database through a mediator
I have build a simple project on 11g TP$, which consists of a mediator, a file adapter, that reads an xml file and a DB adapter that inserts data on a database.
The mediator connects the file adapter to the DB adapter and through a routing rule it inserts data on a table of the database.
When I try to run this project the input file is consumed by the file adapter, but after that I get the following error
SEVERE: Part {body} return null from the message :in
Dec 5, 2008 2:24:55 PM oracle.tip.mediator.service.transformation.XSLTransformer getPartDocument
SEVERE: payload map source message :{opaque=oracle.xml.parser.v2.XMLElement@19b0076}
Dec 5, 2008 2:24:55 PM oracle.tip.mediator.service.transformation.MediatorTransformationHandler transform
SEVERE: Transformation failed
oracle.tip.mediator.infra.exception.MediatorException: Error occured while transforming payload!
Please review the XSL or source payload.Contact Oracle Support if error not fixable
at oracle.tip.mediator.service.transformation.XSLTransformer.getPartDocument(XSLTransformer.java:191)
at oracle.tip.mediator.service.transformation.XSLTransformer.transform(XSLTransformer.java:102)
at oracle.tip.mediator.service.transformation.MediatorTransformationHandler.transform(MediatorTransformationHandler.java:103)
at oracle.tip.mediator.service.transformation.MediatorTransformationHandler.transform(MediatorTransformationHandler.java:196)
at oracle.tip.mediator.service.DataActionHandler.getNextPayload(DataActionHandler.java:145)
at oracle.tip.mediator.service.BaseActionHandler.requestProcess(BaseActionHandler.java:74)
at oracle.tip.mediator.service.BaseActionHandler.requestProcess(BaseActionHandler.java:53)
at oracle.tip.mediator.service.OneWayActionHandler.oneWayRequestProcess(OneWayActionHandler.java:67)
at oracle.tip.mediator.service.OneWayActionHandler.process(OneWayActionHandler.java:34)
at oracle.tip.mediator.service.ActionProcessor.onMessage(ActionProcessor.java:61)
at oracle.tip.mediator.dispatch.MessageDispatcher.executeCase(MessageDispatcher.java:103)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCase(InitialMessageDispatcher.java:465)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCases(InitialMessageDispatcher.java:361)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCases(InitialMessageDispatcher.java:254)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.dispatch(InitialMessageDispatcher.java:149)
at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.process(MediatorServiceEngine.java:533)
at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.post(MediatorServiceEngine.java:634)
at oracle.integration.platform.blocks.mesh.AsynchronousMessageHandler.doPost(AsynchronousMessageHandler.java:138)
at oracle.integration.platform.blocks.mesh.MessageRouter.post(MessageRouter.java:152)
at oracle.integration.platform.blocks.mesh.MeshImpl.post(MeshImpl.java:159)
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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at oracle.integration.platform.metrics.PhaseEventAspect.invoke(PhaseEventAspect.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy70.post(Unknown Source)
at oracle.integration.platform.blocks.adapter.fw.jca.mdb.AdapterServiceMDB.onMessage(AdapterServiceMDB.java:574)
at oracle.integration.platform.blocks.adapter.fw.jca.messageinflow.MessageEndpointImpl.onMessage(MessageEndpointImpl.java:295)
at oracle.tip.adapter.file.inbound.ProcessWork.publishMessage(ProcessWork.java:2127)
at oracle.tip.adapter.file.inbound.ProcessWork.doTranslation(ProcessWork.java:1719)
at oracle.tip.adapter.file.inbound.ProcessWork.translateAndPublish(ProcessWork.java:677)
at oracle.tip.adapter.file.inbound.ProcessWork.run(ProcessWork.java:320)
at oracle.integration.platform.blocks.adapter.fw.jca.work.WorkerJob.go(WorkerJob.java:51)
at oracle.integration.platform.blocks.adapter.fw.common.ThreadPool.run(ThreadPool.java:283)
at java.lang.Thread.run(Thread.java:595)
Dec 5, 2008 2:24:55 PM oracle.tip.mediator.serviceEngine.MediatorServiceEngine process
SEVERE: Updating fault processing DMS metrics
Dec 5, 2008 2:24:55 PM oracle.tip.mediator.serviceEngine.MediatorServiceEngine process
SEVERE: Got an exception: Error occured while transforming payload!
Please review the XSL or source payload.Contact Oracle Support if error not fixable
oracle.tip.mediator.infra.exception.MediatorException: Error occured while transforming payload!
Please review the XSL or source payload.Contact Oracle Support if error not fixable
at oracle.tip.mediator.service.transformation.XSLTransformer.getPartDocument(XSLTransformer.java:191)
at oracle.tip.mediator.service.transformation.XSLTransformer.transform(XSLTransformer.java:102)
at oracle.tip.mediator.service.transformation.MediatorTransformationHandler.transform(MediatorTransformationHandler.java:103)
at oracle.tip.mediator.service.transformation.MediatorTransformationHandler.transform(MediatorTransformationHandler.java:196)
at oracle.tip.mediator.service.DataActionHandler.getNextPayload(DataActionHandler.java:145)
at oracle.tip.mediator.service.BaseActionHandler.requestProcess(BaseActionHandler.java:74)
at oracle.tip.mediator.service.BaseActionHandler.requestProcess(BaseActionHandler.java:53)
at oracle.tip.mediator.service.OneWayActionHandler.oneWayRequestProcess(OneWayActionHandler.java:67)
at oracle.tip.mediator.service.OneWayActionHandler.process(OneWayActionHandler.java:34)
at oracle.tip.mediator.service.ActionProcessor.onMessage(ActionProcessor.java:61)
at oracle.tip.mediator.dispatch.MessageDispatcher.executeCase(MessageDispatcher.java:103)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCase(InitialMessageDispatcher.java:465)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCases(InitialMessageDispatcher.java:361)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCases(InitialMessageDispatcher.java:254)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.dispatch(InitialMessageDispatcher.java:149)
at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.process(MediatorServiceEngine.java:533)
at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.post(MediatorServiceEngine.java:634)
at oracle.integration.platform.blocks.mesh.AsynchronousMessageHandler.doPost(AsynchronousMessageHandler.java:138)
at oracle.integration.platform.blocks.mesh.MessageRouter.post(MessageRouter.java:152)
at oracle.integration.platform.blocks.mesh.MeshImpl.post(MeshImpl.java:159)
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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at oracle.integration.platform.metrics.PhaseEventAspect.invoke(PhaseEventAspect.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy70.post(Unknown Source)
at oracle.integration.platform.blocks.adapter.fw.jca.mdb.AdapterServiceMDB.onMessage(AdapterServiceMDB.java:574)
at oracle.integration.platform.blocks.adapter.fw.jca.messageinflow.MessageEndpointImpl.onMessage(MessageEndpointImpl.java:295)
at oracle.tip.adapter.file.inbound.ProcessWork.publishMessage(ProcessWork.java:2127)
at oracle.tip.adapter.file.inbound.ProcessWork.doTranslation(ProcessWork.java:1719)
at oracle.tip.adapter.file.inbound.ProcessWork.translateAndPublish(ProcessWork.java:677)
at oracle.tip.adapter.file.inbound.ProcessWork.run(ProcessWork.java:320)
at oracle.integration.platform.blocks.adapter.fw.jca.work.WorkerJob.go(WorkerJob.java:51)
at oracle.integration.platform.blocks.adapter.fw.common.ThreadPool.run(ThreadPool.java:283)
at java.lang.Thread.run(Thread.java:595)
Dec 5, 2008 2:24:55 PM oracle.integration.platform.blocks.adapter.fw.log.LogManagerImpl log
SEVERE: JCABinding=> Read ReadAdapter Service Read was unable to perform delivery of inbound message to the composite due to: oracle.tip.mediator.infra.exception.MediatorException: Error occured while transforming payload!
Please review the XSL or source payload.Contact Oracle Support if error not fixable
Dec 5, 2008 2:24:55 PM oracle.integration.platform.blocks.adapter.fw.log.LogManagerImpl log
SEVERE: JCABinding=> Read
oracle.fabric.common.FabricInvocationException: oracle.tip.mediator.infra.exception.MediatorException: Error occured while transforming payload!
Please review the XSL or source payload.Contact Oracle Support if error not fixable
at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.process(MediatorServiceEngine.java:599)
at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.post(MediatorServiceEngine.java:634)
at oracle.integration.platform.blocks.mesh.AsynchronousMessageHandler.doPost(AsynchronousMessageHandler.java:138)
at oracle.integration.platform.blocks.mesh.MessageRouter.post(MessageRouter.java:152)
at oracle.integration.platform.blocks.mesh.MeshImpl.post(MeshImpl.java:159)
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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at oracle.integration.platform.metrics.PhaseEventAspect.invoke(PhaseEventAspect.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy70.post(Unknown Source)
at oracle.integration.platform.blocks.adapter.fw.jca.mdb.AdapterServiceMDB.onMessage(AdapterServiceMDB.java:574)
at oracle.integration.platform.blocks.adapter.fw.jca.messageinflow.MessageEndpointImpl.onMessage(MessageEndpointImpl.java:295)
at oracle.tip.adapter.file.inbound.ProcessWork.publishMessage(ProcessWork.java:2127)
at oracle.tip.adapter.file.inbound.ProcessWork.doTranslation(ProcessWork.java:1719)
at oracle.tip.adapter.file.inbound.ProcessWork.translateAndPublish(ProcessWork.java:677)
at oracle.tip.adapter.file.inbound.ProcessWork.run(ProcessWork.java:320)
at oracle.integration.platform.blocks.adapter.fw.jca.work.WorkerJob.go(WorkerJob.java:51)
at oracle.integration.platform.blocks.adapter.fw.common.ThreadPool.run(ThreadPool.java:283)
at java.lang.Thread.run(Thread.java:595)
Caused by: oracle.tip.mediator.infra.exception.MediatorException: Error occured while transforming payload!
Please review the XSL or source payload.Contact Oracle Support if error not fixable
at oracle.tip.mediator.service.transformation.XSLTransformer.getPartDocument(XSLTransformer.java:191)
at oracle.tip.mediator.service.transformation.XSLTransformer.transform(XSLTransformer.java:102)
at oracle.tip.mediator.service.transformation.MediatorTransformationHandler.transform(MediatorTransformationHandler.java:103)
at oracle.tip.mediator.service.transformation.MediatorTransformationHandler.transform(MediatorTransformationHandler.java:196)
at oracle.tip.mediator.service.DataActionHandler.getNextPayload(DataActionHandler.java:145)
at oracle.tip.mediator.service.BaseActionHandler.requestProcess(BaseActionHandler.java:74)
at oracle.tip.mediator.service.BaseActionHandler.requestProcess(BaseActionHandler.java:53)
at oracle.tip.mediator.service.OneWayActionHandler.oneWayRequestProcess(OneWayActionHandler.java:67)
at oracle.tip.mediator.service.OneWayActionHandler.process(OneWayActionHandler.java:34)
at oracle.tip.mediator.service.ActionProcessor.onMessage(ActionProcessor.java:61)
at oracle.tip.mediator.dispatch.MessageDispatcher.executeCase(MessageDispatcher.java:103)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCase(InitialMessageDispatcher.java:465)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCases(InitialMessageDispatcher.java:361)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCases(InitialMessageDispatcher.java:254)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.dispatch(InitialMessageDispatcher.java:149)
at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.process(MediatorServiceEngine.java:533)
... 24 more
Dec 5, 2008 2:24:55 PM oracle.integration.platform.blocks.adapter.fw.log.LogManagerImpl log
WARNING: JCABinding=> Read ReadonReject: The resource adapter 'File Adapter' requested handling of a malformed inbound message. However, the following Service property has not been defined: 'rejectedMessageHandlers'. Please define it and redeploy the module. Will use the default Rejection Directory file://jca\Read\rejectedMessages for now.
Dec 5, 2008 2:24:55 PM oracle.integration.platform.blocks.adapter.fw.log.LogManagerImpl log
WARNING: JCABinding=> Read ReadonReject: Sending invalid inbound message to Exception Handler:
Dec 5, 2008 2:24:55 PM oracle.tip.mediator.common.error.ErrorMessageEnqueuer$EnqueuerThread run
SEVERE: Failed to enqueue error message
javax.jms.TransactionInProgressException: Cannot call commit on a XA capable JMS session.
at oracle.j2ee.ra.jms.generic.RAUtils.make(RAUtils.java:595)
at oracle.j2ee.ra.jms.generic.RAUtils.toTransactionInProgressException(RAUtils.java:846)
at oracle.j2ee.ra.jms.generic.RAUtils.toTransactionInProgressException(RAUtils.java:840)
at oracle.j2ee.ra.jms.generic.SessionWrapper.commit(SessionWrapper.java:197)
at oracle.tip.mediator.common.error.ErrorMessageEnqueuer$EnqueuerThread.run(ErrorMessageEnqueuer.java:187)
at java.lang.Thread.run(Thread.java:595)
I have checked the .xsd file and my xml several times and it seems that they are correct. Moreover, the .xsl file is also correct.
Does anyone have any idea of what may produce this problem?
ThanksI was finally able to get my project working. Heidi - You were right, there was a problem with the XSL generated by the XSL map editor.
I am trying to locate if this issue has already been reported, but I am highlighting it here, in case someone else faces the same.
The XSL generated was as follows:
<xsl:stylesheet version="1.0"
xmlns:dvm="[http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue]"
xmlns:bpws="[http://schemas.xmlsoap.org/ws/2003/03/business-process/]"
xmlns:ns1="[http://xmlns.oracle.com/pcbpel/adapter/db/ReadEmps/Read/DB/]"
xmlns:plt="[http://schemas.xmlsoap.org/ws/2003/05/partner-link/]"
xmlns:ns0="[http://www.w3.org/2001/XMLSchema]"
xmlns:hwf="[http://xmlns.oracle.com/bpel/workflow/xpath]"
xmlns:xp20="[http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20]"
xmlns:xref="[http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions]"
xmlns:tns="[http://xmlns.oracle.com/pcbpel/adapter/file/ReadEmps/Read/Read/]"
xmlns:xsl="[http://www.w3.org/1999/XSL/Transform]"
xmlns:ora="[http://schemas.oracle.com/xpath/extension]"
xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance]"
xmlns:imp1="[www.TargetNameSpace.com/EmpTrack|http://www.targetnamespace.com/EmpTrack]*"*
xmlns:top="[http://xmlns.oracle.com/pcbpel/adapter/db/top/DB]"
xmlns:ids="[http://xmlns.oracle.com/bpel/services/IdentityService/xpath]"
xmlns:orcl="[http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc]"
xmlns:mhdr="[http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.GetRequestHeaderExtnFunction]"
exclude-result-prefixes="xsl plt ns0 tns imp1 ns1 top dvm bpws hwf xp20 xref ora ids orcl mhdr">
<xsl:template match="/">
<top:EmployeeTrackingCollection>
<xsl:for-each select*="/imp1:ROWSET/imp1:ROW*">
<top:EmployeeTracking>
<top:locationId>
<xsl:value-of select="*imp1:LOCATION_ID*"/>
</top:locationId>
<top:employeeId>
<xsl:value-of select="*imp1:EMPLOYEE_ID*"/>
</top:employeeId>
<top:employeeX>
<xsl:value-of select="*imp1:EMPLOYEE_X*"/>
</top:employeeX>
<top:employeeY>
<xsl:value-of select="*imp1:EMPLOYEE_Y"*/>
</top:employeeY>
</top:EmployeeTracking>
</xsl:for-each>
</top:EmployeeTrackingCollection>
</xsl:template>
</xsl:stylesheet>
The Xpath included the "imp1:" tag to reference the namespace. I tested this XSL and it didn't work. However, on removing the namespace "imp1:" from the Xpath, the XSL works fine and I am able to insert into the database. "No suitable driver" still appears in the log, but all rows from the XML are inserted into the database.
Heidi - do you think this is a bug? -
EJB 3.0 Core Spec (Transaction and BMT)
On Page 342 Core EJB Specs:
If the client request is associated with a transaction T1, and the instance is not associated with a transaction, the container suspends the client�s transaction association and invokes the method with an unspecified transaction context. The container resumes the client�s transaction association (T1) when the method (together with any associated interceptor methods) completes. This case can never happen for a message-driven bean or for the invocation of a web service endpoint method of a stateless session bean.
Doubt:
Message driven beans can have Transaction attribute specified as Not Supported or Required. In the case of Not Supported - the above can happen?.
Also, why is not applicable for invocation of a web service endpoint method of a stateless session bean and applicable for a stateless session bean call?
Please guide,
ShivaniHi Shivani,
In the JMS programming model, transactions do not propagate from the message
producer to the message consumer so there is not any possibility for a transaction to propagate
into the JMS MDB's onMessage method. However, the text could actually use some qualification
since MDBs are capable of consuming other types of inbound messages through the Connector 1.5
contracts. In those cases it is possible for a transaction to propagate into the MDB.
Regarding WebServices, Java EE 5 does not require support for transaction propagation on
web service invocations. When this text was written such propagation was prohibited. That
restriction was loosened in Java EE 5 so this also needs some rewording.
--ken -
How to configure sun application server 8.2 for Oracle RAC 10g
Hello,
We have numerous boxes running the sun platform application server 8.2 and 2 boxes running enterprise version 8.2 all connecting to a 4 node Oracle RAC 10 G release 2 database. We have the system up and working. The application servers are connecting just fine to the database and the apps don't have any problems querying, inserting, etc. However, when we try to do failover testing of situations when a node or nodes of the Oracle RAC database goes down the application server does not gain new valid connections. Our configuration is this, OracleDataSource for the data source, table validation turned on with a valid table, ONS configuration set in properties, connectionCache enabled, and fastconnectionfailover enabled as well in the properties. We have that long oracle rac url with load balancing turned on set fot the database URL. We have the checkbox checked to fail all connections on any failure. ONS is configured properly within the database because we have a java application that runs outside of the application server that uses all the same settings described above (only set manually in our code for the OracleDataSource). This application works seemlessly when DB nodes are shutdown. We can shutdown all but one node and it's still humming along without skipping a beat. Start up one of the others, kill the last node, it still hums along nicely without skipping a beat. We'd really like to get the applications running in the application server to work the same way. Any help would be greatly appreciated. We've tried all the combinations that we can think of with configuration settings in the application server and it never works. Am tempted to rip out the database connection pool from inside the application server and configure it manually in the code but we are using entity beans and this is the much easier approach, if it will work. It's down to the point of does sun application server actually work with oracle RAC for connection failovers.Hi,
We are also facing similar execption. Here is the error, we are getting, when a node is failed on RAC.
[#|2007-11-11T12:43:53.685+0000|WARNING|sun-appserver-ee8.1_02|javax.enterprise.system.core.transaction|_ThreadID=38;|JTS5041: The resource manager is doing work outside a global transaction
oracle.jdbc.xa.OracleXAException
at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1270)
at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:318)
at com.sun.gjc.spi.XAResourceImpl.start(XAResourceImpl.java:184)
at com.sun.jts.jta.TransactionState.startAssociation(TransactionState.java:258)
at com.sun.jts.jta.TransactionImpl.enlistResource(TransactionImpl.java:181)
at com.sun.enterprise.distributedtx.J2EETransaction.enlistResource(J2EETransaction.java:397)
at com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.enlistResource(J2EETransactionManagerImpl.java:312)
at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.enlistResource(J2EETransactionManagerOpt.java:114)
at com.sun.enterprise.resource.ResourceManagerImpl.registerResource(ResourceManagerImpl.java:113)
at com.sun.enterprise.resource.ResourceManagerImpl.enlistResource(ResourceManagerImpl.java:71)
at com.sun.enterprise.resource.PoolManagerImpl.getResource(PoolManagerImpl.java:176)
at com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:268)
at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:193)
at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:122)
at com.sun.gjc.spi.DataSource.getConnection(DataSource.java:70)
at com.syntegra.nasp.etp.dax.DBManager.getConnection(DBManager.java:192)
at com.syntegra.nasp.etp.dax.DBManager.createDBCommand(DBManager.java:241)
at com.syntegra.nasp.etp.dax.DBManager.createDBCommand(DBManager.java:251)
at com.syntegra.nasp.etp.dax.sp.SPS_PRESCRIPTION_GUID_PROC.getCommand(SPS_PRESCRIPTION_GUID_PROC.java:31)
at com.syntegra.nasp.etp.dax.sp.SPS_PRESCRIPTION_GUID_PROC.execute(SPS_PRESCRIPTION_GUID_PROC.java:23)
at com.syntegra.nasp.etp.dax.PrescriptionBaseDataMapper.loadPresciptionByGUID(PrescriptionBaseDataMapper.java:203)
at com.syntegra.nasp.etp.model.PrescriptionBase.findByPrescriptionGUID(PrescriptionBase.java:176)
at com.syntegra.nasp.etp.messages.PatientPrescriptionReleaseRequest.execute(PatientPrescriptionReleaseRequest.java:120)
at com.syntegra.nasp.etp.service.ETPSLBean.processMessage(ETPSLBean.java:159)
at sun.reflect.GeneratedMethodAccessor97.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:147)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:128)
at $Proxy6.processMessage(Unknown Source)
at com.syntegra.nasp.etp.listener.RequestListener.onRequest(RequestListener.java:204)
at com.syntegra.spine.csf.consumer.mdb.CSFListenerRegisteringConsumer.onRequest(CSFListenerRegisteringConsumer.java:54)
at com.syntegra.spine.csf.consumer.mdb.CSFConsumerBase.invokeListener(CSFConsumerBase.java:267)
at com.syntegra.spine.csf.consumer.mdb.CSFConsumerBase.processMessage(CSFConsumerBase.java:180)
at com.syntegra.spine.csf.consumer.mdb.CSFConsumerBase.onMessage(CSFConsumerBase.java:102)
at sun.reflect.GeneratedMethodAccessor96.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sun.enterprise.security.SecurityUtil$2.run(SecurityUtil.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.enterprise.security.application.EJBSecurityManager.doAsPrivileged(EJBSecurityManager.java:955)
at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:158)
at com.sun.ejb.containers.MessageBeanContainer.deliverMessage(MessageBeanContainer.java:956)
at com.sun.ejb.containers.MessageBeanListenerImpl.deliverMessage(MessageBeanListenerImpl.java:42)
at com.sun.enterprise.connectors.inflow.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:130)
at $Proxy9.onMessage(Unknown Source)
at com.sun.genericra.inbound.DeliveryHelper.deliverMessage(DeliveryHelper.java:183)
at com.sun.genericra.inbound.DeliveryHelper.deliver(DeliveryHelper.
Regards
Selvan.
Maybe you are looking for
-
Flash Player Autoupdate Not Working On Any Of My Computers
Hi there, have several computers on different networks. All Windows 7 (32bit), some installed from scratch, some with a image based solution, all on current Patch Level. Can't Autoupdate get to work on any of them... All have Version 11.2.202.235 Ins
-
How do I update my adobe flash on my iPad.
How do I update my adobe flash on my ipad
-
Soundcard settings for old DOS games??? I have an Audig
I have a Soundblaster Audigy 2 card in my computer, and I want to play some old DOS games. I'm wondering what settings I need to use with it to play these games. I remember how it was back then with the games, but now that things have changed, I am c
-
I have to paste/special/text when copying from Firefox and pasting in Word or Excel
When copying data from a table on IE, I just have to paste (ctrl-v), and the data is pasted into appropriate separate cells. In Firefox, I have to "paste special" and click "text" to separate the fields. Otherwise, all the data is pasted into a singl
-
Hi! I want to build a flow definition in closing cockpit with two customer reports. So I registered the 2 reports for cc and created the flow definition with two reports with variant. When I schedule the task I always get status cancelled. If I debug