What does this mean commit():Illegal for a non-transacted Session:sessionId - glassfish

I am using a glassfish server and using the JMS functionality of that glassfish server.
Keep on getting this error message :
MQJMSRA_DS4001: commit():Illegal for a non-transacted Session:sessionId
What is the reason I am getting this error message ?

The reason you get that error is that your Session is not transacted . This means than commit/ rollback methods are meaningless. Try setting the session as transacted when you create it (E.g. connection.createSession(true, Session.AUTO_ACKNOWLEDGE)).
If you don't want your session to be transacted you should remove Commit / rollbacks from code, or cheching a global variable before executing.

You can use TransactionAwareConnectionFactoryProxy .
Instead of using the raw vendor-provided ConnectionFactory, the configuration wraps ConnectionFactory in a decorator that handles the transaction synchronization. This happens in the jms-context.xml as follows :-
<bean id="connectionFactory" class="org.springframework.jms.connection.TransactionAwareConnectionFactoryProxy">
<property name="targetConnectionFactory" ref="myCamelConnectionFactory"/>
</bean>
<jee:jndi-lookup id="myconnectionFactory" jndi-name="SoDConflictConnFactory"/>
This will remove the Warning message :-MQJMSRA_DS4001

Related

View hsqldb content of petclinic application from intellij 14

i have cloned petclinic project and imported it in intellij 14.
My question is, when i am using the application on localhost how can i see the content of the hsqldb database which is used by default in the petclinic application ?
My first attempt was to :
go in the database view from intellij
create an in memory new database with url equal to : jdbc:hsqldb:mem:petclinic
When i test the connection it is ok, even if the application server is not started, which is weard i think
When i start the application ./mvnw tomcat7:run in the database view i only get schemas : PUBLIC.PUBLIC with no table at all.
My question is so how to configure the database connection within intellj to see the content of the hsqldb used in the petclinic application ?
Thanks you.
To add clarification :
If you have a look at the petclinic code [link] https://github.com/spring-projects/spring-petclinic you will see that hsqldb is already configured and launched at the start of the application. And that the configuration is
jdbc.driverClassName=org.hsqldb.jdbcDriver
jdbc.url=jdbc:hsqldb:mem:petclinic
jdbc.username=sa
jdbc.password=
I guess i would need to reuse the same hsqldb than the one started by petclinic code, but i don't know how to achieve this from intellij once the application is started locally. Appreciate your help.
The URL for the localhost server is typically jdbc:hsqldb:hsql://localhost/ or it may have petclinic appended at the end.
But you need to run an HSQLDB server before you start Tomcat and use the above URL to connect, instead of the jdbc:hsqldb:mem:petclinic URL.
Well to answer my own question, this is what to do :
Instantiate a spring bean just after the creation of the datasource bean and then launch the swing tool hsql database manager adding those simple lines of code :
<bean depends-on="dataSource" class="org.springframework.beans.factory.config.MethodInvokingBean">
<property name="targetClass" value="org.hsqldb.util.DatabaseManagerSwing" />
<property name="targetMethod" value="main" />
<property name="arguments">
<list>
<value>--url</value>
<value>jdbc:hsqldb:mem:petclinic</value>
<value>--user</value>
<value>sa</value>
<value>--password</value>
<value></value>
</list>
</property>
</bean>
Then select the PUBLIC schema you will see all the tables :=)

activemq broker redeliveryPlugin configuration not working for topic

I have the following configuration in by conf/activemq.xml file
<plugins>
<redeliveryPlugin fallbackToDeadLetter="true" sendToDlqIfMaxRetriesExceeded="true">
<redeliveryPolicyMap>
<redeliveryPolicyMap>
<defaultEntry>
<redeliveryPolicy maximumRedeliveries="20" useExponentialBackOff="true" initialRedeliveryDelay="60000" redeliveryDelay="60000" maximumRedeliveryDelay="600000"/>
</defaultEntry>
</redeliveryPolicyMap>
</redeliveryPolicyMap>
</redeliveryPlugin>
</plugins>
I am using activemq-5.11 with Spring/JMS/Camel/JTA (Atomikos).
Because, I am using JTA/XA transactions, the redelivery policy at the activeMQ connection factory is not working for topics.
So I am trying to set the redelivery Policy on the server.
However, it seems to be continuously resending the topic message.
PS. I have only one subscriber (durable).
I was able to resolve the issue.
In my case, the issue was that I was using the redelivery policy at the client side also. And somehow, that was messing it up.
Since I am using JTA, I wanted no retying at the client side and wanted the message to be retired from the ActiveMQ broker server. And Once I removed all error handling and redelivery policy from the Camel configuration, it worked like as it should.
Hope this helps someone in the future.

Mule DevKit Connectors, Connection Management and reconnect policies

Should a custom Mule connector written using the DevKit be compatible by default with reconnection policies. e.g., I wrote a connector using connection management following http://www.mulesoft.org/documentation/display/current/Implementing+Connection+Management
When I set up an error condition and my #Connect method throws a ConnectionException my flow stops and the connector doesn't try to reconnect despite having a global config element:
<configuration>
<reconnect-forever frequency="2000"/>
</configuration>
I know this config is working because it has the expected effect on a JDBC transport but not on my custom connector.
Am I missing something fundamental? Should custom connectors work at all with reconnect-forever policies?
I'm using Mule 3.4 CE and DevKit 3.4
Thanks for any help or pointers in the right direction.
In DevKit, in order for your operations to trigger the reconnection mechanism you need to mark the processor with the #ReconnectOn annotation, and specify the exception that will trigger the reconnection.
#Processor
#ReconnectOn(exceptions = {TypeAException.class, TypeBException.class})
public boolean fooProcessor(String param)
throws TypeAException, TypeBException, TypeCException;
In this example the exception of TypeCException will not trigger the reconnection, the others will.
If your #ValidateConnection method returns true, the #Connect won't be called again.

JBAS015052: Did not receive a response to the deployment operation within the allowed timeout period

I am migrating an application from JBOSS 4 to JBOSSAS 7. I followed the guide for migration, converted all the ejbs to ejb3 fixed the JNDI names. After I deploy the ear I see message that the EJBs are bound. After that it goes in a wait state and then just times out with this message:
JBAS015052: Did not receive a response to the deployment operation within the allowed timeout period [1200 seconds]. Check the server configuration file and the server logs to find more about the status of the deployment.
I turned on the logging to DEBUG, which gives me a few exceptions about Transaction and NIO etc (which after spending a lot of time in JBOSS message groups and this one, I found were harmless).
I don't know how to debug this. I got the stack dump of the process but all I see is that the deployment scanner was waiting on something. Not sure what :
"DeploymentScanner-threads - 2" prio=5 tid=0000000003d77400 nid=0xb6447000 in Object.wait() [00000000b6446000]
java.lang.Thread.State: WAITING (on object monitor)
Anyone know how to debug this ? I am pretty damm fraustrated at this point. I mean if it doesn't throw an error, how am I supposed to debug this ?
It is an old post but, if some of you have a similar problem, you can try increasing the deployment-timeout in your standalone.xml,
Find This block
<subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1">
<deployment-scanner path="deployments"
relative-to="jboss.server.base.dir"
scan-interval="5000" />
</subsystem>
Then add the attribute deployment-timeout (in seconds) to a value (like 20 minutes)
<subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1">
<deployment-scanner path="deployments" relative-to="jboss.server.base.dir"
scan-interval="5000" deployment-timeout="1200"/>
</subsystem>
look this for reference
JBAS015052: Did not receive a response to the deployment operation within the allowed timeout period [60 seconds]
It is a usual problem in overloaded environments.

OSB WLS Initialisation issue

facing some strange behavior in OSB, i have configured WLS with MQ in client mode, i am doing some minor test to check the connection, i have created a proxy service to read the message from Q1 and a Business Service(BS) to route it to Q2. The issue is the proxy is able to read the message but the BS is throwing this:
JMSPool BEA-169807 There was an error while making the initial connection to the JMS resource named ALSB_JMS_SessionPool_491704821 from within an EJB or a servlet. The server will attempt the connection again later. The error was javax.jms.JMSException: [JMSPool:169803]JNDI lookup of the JMS connection factory AKBConnFact failed: javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.fscontext.RefFSContextFactory [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.fscontext.RefFSContextFactory
Note: The classpath or the domain/lib folder contains the RefFSContextFactory class
Any ideas gang..? TIA
The answer is this is a bug in OSB which needs to be reported.
As a workaround you need to individually set the jars in the weblogic classpath in your domain/server/bin folder. just go through the link below for more details:
http://forums.oracle.com/forums/thread.jspa?threadID=2135523&start=0&tstart=0