Hi 
            I was facing some problem integrating Active 4.1 or 4.2 with
JBoss but then i saw couple of posts in here and got them resolved. It had
something to do with Spring2 and some older Spring1 jar . I found the
workaround and got ahead from that road block . Now i am facing a different
problem where when i try to connect and send message to this JBoss from a c#
client which is using activemq-dotnet.dll version 4.0.2 it is not able to
connect to the broker it  gives some openwire exception : end of stream
exception ". I believe it was unable to create a Session  or something.
            Is there any way to get rid of this problem .Do you think
changing the dll to a higher version is going to resolve this problem ? If
yes can you please post the link from where i can get the latest dll from .
           Since i hit this roadblock i thought that making ActiveMQ 4.0( to
which my c# client works fine ) to use a sqlserver dataSource to store the
messages so that the messages are retrieved back when JBoss is restarted and
so the queue is made a persistent one .

<bean id="sqlserver-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
      <property name="driverClassName"
value="net.sourceforge.jtds.jdbc.Driver"/>
      <property name="url"
value="jdbc:jtds:sqlserver://host/database;tds=8.0;lastupdatecount=true"/>
      <property name="username" value="username"/>
      <property name="password" value="password"/>
      <property name="poolPreparedStatements" value="true"/>
  </bean>

I am facing some problem on this line also. This is the exception that i get
when i tried to do this

Caused by: java.sql.SQLException: commit() should not be called while in
auto-commit mode.
        at
net.sourceforge.jtds.jdbc.ConnectionJDBC2.commit(ConnectionJDBC2.java:1878)
        at
org.apache.commons.dbcp.DelegatingConnection.commit(DelegatingConnection.java:238)
        at
org.apache.commons.dbcp.DelegatingConnection.commit(DelegatingConnection.java:238)
        at
org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.commit(PoolingDataSource.java:199)
        at
org.apache.activemq.store.jdbc.TransactionContext.close(TransactionContext.java:119)

Waiting for a response to get rid of my problems 
thanks in advance




Karthik.Gopalakrishnan wrote:
> 
> I was not able to configure ActiveMQ4.2 to integrate it with JBoss . I
> followed the same set of steps to integrate ActiveMQ with JBoss and i get
> an exception "IllegalStateException : could not find Implementation for
> 2.0".I faced the same problem with ActiveMQ4.1 also .Is there something
> missing in the instructions in 
> http://devzone.logicblaze.com/site/integrating-apache-activemq-with-jboss.html.
> Or is it because i took the wrong release and worked on that(If that is
> the case can you give me the exact release/link  i should be taking to
> start all that again ).If i am doing the wrong set of steps please
> elaborate on what exactly has to be followed to achieve the goal.
> 
> 
> tabshift wrote:
>> 
>> Maybe you should check if the messages are really lost by using the
>> program "browse". You find it in the bin-directory.
>> Since 4.2-Snapshot browse is implemented in activemq-admin.
>> I suggest that your messages are still there but Hermes gives you some
>> strange information.
>> 
>> 
>> 
>> 
>> Karthik.Gopalakrishnan wrote:
>>> 
>>> Hi 
>>> 
>>>                  I am new to activemq and now i am facing a weird
>>> problem with ActiveMQ(integrated with JBoss). I have a c# client which
>>> sends persistent messages to a queue that is created using the file
>>> activemq-jms-ds.xml the contents of which  is as follows
>>> 
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> 
>>> <!DOCTYPE connection-factories
>>>     PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
>>>     "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd";>
>>> 
>>> <connection-factories>
>>> 
>>>    <tx-connection-factory>
>>>       <jndi-name>activemq/QueueConnectionFactory</jndi-name>
>>>       <xa-transaction/>
>>>       <track-connection-by-tx/>
>>>       <rar-name>activemq-ra.rar</rar-name>
>>>      
>>> <connection-definition>javax.jms.QueueConnectionFactory</connection-definition>
>>>      
>>> <security-domain-and-application>JmsXARealm</security-domain-and-application>
>>>    </tx-connection-factory>
>>> 
>>>    <mbean code="org.jboss.resource.deployment.AdminObject"
>>> name="activemq.queue:name=queue1">
>>>       <attribute name="JNDIName">queue/queue1</attribute>
>>>       <depends
>>> optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-ra.rar'</depends>
>>>       <attribute name="Type">javax.jms.Queue</attribute>
>>>       <attribute name="Properties">
>>>             PhysicalName=queue.queue1
>>>       </attribute>
>>>    </mbean>
>>> </connection-factories>
>>> 
>>> This file is dropped in the folder location :
>>> jboss/server/default/deploy to be picked up by jboss.
>>> 
>>> when i use hermes to check if the message is actually posted to the
>>> queue i am able to see the messages being arrived there.But when i
>>> shutdown JBoss once and start it again the messages are no more present
>>> in that queue.I understood that by default queues are persistent.Is
>>> there something else i should be doing to make the queue really
>>> persistent,  in the sense i dont want the messages to be lost when JBoss
>>> is restarted.
>>> 
>>> 
>>> 
>>> I am also including the contents of the files ra.xml and
>>> broker-config.xml incase it might be changed :
>>> 
>>> ra.xml
>>> ------------------------------
>>> 
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <!--
>>>     Copyright 2005-2006 The Apache Software Foundation
>>>    
>>>     Licensed under the Apache License, Version 2.0 (the "License");
>>>     you may not use this file except in compliance with the License.
>>>     You may obtain a copy of the License at
>>>    
>>>     http://www.apache.org/licenses/LICENSE-2.0
>>>    
>>>     Unless required by applicable law or agreed to in writing, software
>>>     distributed under the License is distributed on an "AS IS" BASIS,
>>>     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>>> implied.
>>>     See the License for the specific language governing permissions and
>>>     limitations under the License.
>>> -->
>>> 
>>> <connector 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/connector_1_5.xsd";
>>>     version="1.5">
>>>     <description>ActiveMQ  inbound and outbound JMS
>>> ResourceAdapter</description>
>>>     <display-name>ActiveMQ JMS Resource Adapter</display-name>
>>>     <vendor-name>activemq.org</vendor-name>
>>>     <eis-type>JMS 1.1</eis-type>
>>>     <resourceadapter-version>1.0</resourceadapter-version>
>>>     <license>
>>>         <description>
>>>         
>>>             Copyright 2005-2006 The Apache Software Foundation
>>>            
>>>             Licensed under the Apache License, Version 2.0 (the
>>> "License");
>>>             you may not use this file except in compliance with the
>>> License.
>>>             You may obtain a copy of the License at
>>>            
>>>             http://www.apache.org/licenses/LICENSE-2.0
>>>            
>>>             Unless required by applicable law or agreed to in writing,
>>> software
>>>             distributed under the License is distributed on an "AS IS"
>>> BASIS,
>>>             WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
>>> or implied.
>>>             See the License for the specific language governing
>>> permissions and
>>>             limitations under the License.
>>> 
>>>         </description>
>>>         <license-required>true</license-required>
>>>     </license>
>>>     <resourceadapter>
>>>        
>>> <resourceadapter-class>org.apache.activemq.ra.ActiveMQResourceAdapter</resourceadapter-class>
>>>         <config-property>
>>>             <description>
>>>               The URL to the ActiveMQ server that you want this
>>> connection to connect to.  If using
>>>               an embedded broker, this value should be 'vm://localhost'.
>>>             </description>
>>>             <config-property-name>ServerUrl</config-property-name>
>>>            
>>> <config-property-type>java.lang.String</config-property-type>
>>> <!--                   
>>> <config-property-value>tcp://localhost:61616</config-property-value>-->
>>>         <config-property-value>vm://localhost</config-property-value> 
>>>         </config-property>
>>>         <config-property>
>>>             <description>The default user name that will be used to
>>> establish connections to the ActiveMQ server.</description>
>>>             <config-property-name>UserName</config-property-name>
>>>            
>>> <config-property-type>java.lang.String</config-property-type>
>>>             <config-property-value>defaultUser</config-property-value>
>>>         </config-property>
>>>         <config-property>
>>>             <description>The default password that will be used to log
>>> the default user into the ActiveMQ server.</description>
>>>             <config-property-name>Password</config-property-name>
>>>            
>>> <config-property-type>java.lang.String</config-property-type>
>>>            
>>> <config-property-value>defaultPassword</config-property-value>
>>>         </config-property>
>>>         <config-property>
>>>             <description>The client id that will be set on the
>>> connection that is established to the ActiveMQ server.</description>
>>>             <config-property-name>Clientid</config-property-name>
>>>            
>>> <config-property-type>java.lang.String</config-property-type>
>>>         </config-property>
>>>         <config-property>
>>>             <description>Boolean to configure if outbound connections
>>> should reuse the inbound connection's session for sending
>>> messages.</description>
>>>            
>>> <config-property-name>UseInboundSession</config-property-name>
>>>            
>>> <config-property-type>java.lang.Boolean</config-property-type>
>>>             <config-property-value>false</config-property-value>
>>>         </config-property>
>>> 
>>>                       <!-- NOTE disable the following property if you do 
>>> not wish to
>>> deploy an embedded broker -->
>>>         <config-property>
>>>             <description>
>>>               Sets the XML configuration file used to configure the
>>> embedded ActiveMQ broker via 
>>>               Spring if using embedded mode.
>>>               
>>>               BrokerXmlConfig is the filename which is assumed to be on
>>> the classpath unless 
>>>               a URL is specified. So a value of foo/bar.xml would be
>>> assumed to be on the 
>>>               classpath whereas file:dir/file.xml would use the file
>>> system. 
>>>               Any valid URL string is supported.              
>>>             </description>
>>>             <config-property-name>BrokerXmlConfig</config-property-name>
>>>            
>>> <config-property-type>java.lang.String</config-property-type>
>>>            
>>> <config-property-value>xbean:broker-config.xml</config-property-value>
>>>         </config-property>
>>> 
>>>         <outbound-resourceadapter>
>>>             <connection-definition>
>>>                
>>> <managedconnectionfactory-class>org.apache.activemq.ra.ActiveMQManagedConnectionFactory</managedconnectionfactory-class>
>>>                
>>> <connectionfactory-interface>javax.jms.ConnectionFactory</connectionfactory-interface>
>>>                
>>> <connectionfactory-impl-class>org.apache.activemq.ra.ActiveMQConnectionFactory</connectionfactory-impl-class>
>>>                
>>> <connection-interface>javax.jms.Connection</connection-interface>
>>>                
>>> <connection-impl-class>org.apache.activemq.ra.ManagedConnectionProxy</connection-impl-class>
>>>             </connection-definition>
>>>             <connection-definition>
>>>                
>>> <managedconnectionfactory-class>org.apache.activemq.ra.ActiveMQManagedConnectionFactory</managedconnectionfactory-class>
>>>                
>>> <connectionfactory-interface>javax.jms.QueueConnectionFactory</connectionfactory-interface>
>>>                
>>> <connectionfactory-impl-class>org.apache.activemq.ra.ActiveMQConnectionFactory</connectionfactory-impl-class>
>>>                
>>> <connection-interface>javax.jms.QueueConnection</connection-interface>
>>>                
>>> <connection-impl-class>org.apache.activemq.ra.ManagedConnectionProxy</connection-impl-class>
>>>             </connection-definition>
>>>             <connection-definition>
>>>                
>>> <managedconnectionfactory-class>org.apache.activemq.ra.ActiveMQManagedConnectionFactory</managedconnectionfactory-class>
>>>                
>>> <connectionfactory-interface>javax.jms.TopicConnectionFactory</connectionfactory-interface>
>>>                
>>> <connectionfactory-impl-class>org.apache.activemq.ra.ActiveMQConnectionFactory</connectionfactory-impl-class>
>>>                
>>> <connection-interface>javax.jms.TopicConnection</connection-interface>
>>>                
>>> <connection-impl-class>org.apache.activemq.ra.ManagedConnectionProxy</connection-impl-class>
>>>             </connection-definition>
>>>             <transaction-support>XATransaction</transaction-support>
>>>             <authentication-mechanism>
>>>                
>>> <authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
>>>                
>>> <credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
>>>             </authentication-mechanism>
>>>             <reauthentication-support>false</reauthentication-support>
>>>         </outbound-resourceadapter>
>>>         <inbound-resourceadapter>
>>>             <messageadapter>
>>>                 <messagelistener>
>>>                    
>>> <messagelistener-type>javax.jms.MessageListener</messagelistener-type>
>>>                     <activationspec>
>>>                        
>>> <activationspec-class>org.apache.activemq.ra.ActiveMQActivationSpec</activationspec-class>
>>>                         
>>>                         <required-config-property>
>>>                            
>>> <config-property-name>destination</config-property-name>
>>>                         </required-config-property>
>>>                         <required-config-property>
>>>                            
>>> <config-property-name>destinationType</config-property-name>
>>>                         </required-config-property>
>>>                         
>>>                     </activationspec>
>>>                 </messagelistener>
>>>             </messageadapter>
>>>         </inbound-resourceadapter>
>>>         <adminobject>
>>>            
>>> <adminobject-interface>javax.jms.Queue</adminobject-interface>
>>>            
>>> <adminobject-class>org.apache.activemq.command.ActiveMQQueue</adminobject-class>
>>>             <config-property>
>>>                
>>> <config-property-name>PhysicalName</config-property-name>
>>>                
>>> <config-property-type>java.lang.String</config-property-type>
>>>             </config-property>
>>>         </adminobject>
>>>         <adminobject>
>>>            
>>> <adminobject-interface>javax.jms.Topic</adminobject-interface>
>>>            
>>> <adminobject-class>org.apache.activemq.command.ActiveMQTopic</adminobject-class>
>>>             <config-property>
>>>                
>>> <config-property-name>PhysicalName</config-property-name>
>>>                
>>> <config-property-type>java.lang.String</config-property-type>
>>>             </config-property>
>>>         </adminobject>
>>>     </resourceadapter>
>>> </connector>
>>> 
>>> 
>>> broker-config.xml
>>> ------------------------------
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <!--
>>>     Copyright 2005-2006 The Apache Software Foundation
>>>    
>>>     Licensed under the Apache License, Version 2.0 (the "License");
>>>     you may not use this file except in compliance with the License.
>>>     You may obtain a copy of the License at
>>>    
>>>     http://www.apache.org/licenses/LICENSE-2.0
>>>    
>>>     Unless required by applicable law or agreed to in writing, software
>>>     distributed under the License is distributed on an "AS IS" BASIS,
>>>     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>>> implied.
>>>     See the License for the specific language governing permissions and
>>>     limitations under the License.
>>> -->
>>> <!-- START SNIPPET: xbean -->
>>> <beans xmlns="http://activemq.org/config/1.0";>
>>> 
>>>   <broker useJmx="true" brokerName="bruce.broker1">
>>> 
>>>     <!-- In ActiveMQ 4, you can setup destination policies. note: this xml
>>> format may still change a bit -->
>>>     <destinationPolicy>
>>>       <policyMap><policyEntries>
>>> 
>>>           <policyEntry topic="FOO.>">
>>>             <dispatchPolicy>
>>>               <strictOrderDispatchPolicy />
>>>             </dispatchPolicy>
>>>             <subscriptionRecoveryPolicy>
>>>               <lastImageSubscriptionRecoveryPolicy />
>>>             </subscriptionRecoveryPolicy>
>>>           </policyEntry>
>>> 
>>>       </policyEntries></policyMap>
>>>     </destinationPolicy>
>>> 
>>> 
>>>     <persistenceAdapter>
>>>       <journaledJDBC journalLogFiles="5"
>>> dataDirectory="../activemq-data"/>
>>>       <!-- To use a different datasource, use th following syntax : -->
>>>       <!--
>>>       <journaledJDBC journalLogFiles="5" dataDirectory="../data"
>>> dataSource="#postgres-ds"/>
>>>        -->
>>>     </persistenceAdapter>
>>> 
>>>     <transportConnectors>
>>>       <!-- prefixing a connector with discovery: causes the connector to
>>> be advertiesed over rendezvous -->
>>>       <transportConnector name="bruce.broker1"
>>> uri="tcp://localhost:61616" discoveryUri="multicast://default"/>      
>>>     </transportConnectors>
>>> 
>>>     <networkConnectors>
>>>       <!-- by default just auto discover the other brokers -->
>>>       <networkConnector uri="multicast://default"/>
>>>       <!--
>>>       <networkConnector
>>> uri="static://(tcp://host1:61616,tcp://host2:61616)"/>
>>>       -->
>>>     </networkConnectors>
>>> 
>>>   </broker>
>>> 
>>> 
>>> </beans>
>>> 
>>> 
>>> 
>>> Thanks in advance
>>> 
>>> 
>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problems-with-Persistent-Messages-tf3445893s2354.html#a9633050
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to