You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by JacobS <ja...@gmail.com> on 2011/11/20 12:41:12 UTC
use Http transport in version 5.5.0 with osgi
is it possible to use the http transport in amq 5.5.0 in an osgi environment
?
because activemq-optional is not osgified I added it to the class-path of
the bundle starting the broker, and added the imports and exports to its
manifest, but I am getting exceptions telling me that the class
org.apache.activemq.transport.http.HttpTransportFactory could not be loaded.
--
View this message in context: http://activemq.2283324.n4.nabble.com/use-Http-transport-in-version-5-5-0-with-osgi-tp4088466p4088466.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: use Http transport in version 5.5.0 with osgi
Posted by JacobS <ja...@gmail.com>.
Thanks for your help, the http transport works now.
but my client gets disconnected after 60 seconds, any idea why ?
How can I configure it not to disconnect ?
--
View this message in context: http://activemq.2283324.n4.nabble.com/use-Http-transport-in-version-5-5-0-with-osgi-tp4088466p4089408.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: use Http transport in version 5.5.0 with osgi
Posted by Johan Edstrom <se...@gmail.com>.
Something like this worked for 5.4, I think 5.5 will be very similar.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>bundles</artifactId>
<groupId>edu.ucar.ral.wcsri.bundles</groupId>
<version>3.1-beta-1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>edu.ucar.ral.wcsri.bundles.activemq-optional-http</artifactId>
<packaging>bundle</packaging>
<name>WCSRI :: Bundles :: ${pkgArtifactId}</name>
<description>
This bundle wraps activemq-optional (HTTP) into WCSRI.
</description>
<properties>
<pkgGroupId>org.apache.activemq</pkgGroupId>
<pkgArtifactId>activemq-optional</pkgArtifactId>
<pkgVersion>${activemq-optional-http.version}</pkgVersion>
<wcsri.osgi.import.pkg>
!com.thoughtworks.xstream*,
!sun.misc*,
!sun.reflect*,
!org.mortbay.util.ajax,
javax.xml.stream*;version="[1.0,2)",
net.sf.cglib*;resolution:=optional;version="[2.1.3,3)",
nu.xom;resolution:=optional;version="[1.1,2)",
org.codehaus.jettison*;resolution:=optional;version="[1,2)",
org.dom4j*;resolution:=optional;version="[1.6.1,2)",
org.jdom*;resolution:=optional;version="[1,2)",
org.xmlpull*;version="[1.1.3,2)",
org.apache.activemq.transport.http,
org.apache.activemq.command,
*
</wcsri.osgi.import.pkg>
<wcsri.osgi.export>
org.apache.activemq.transport.http;version="${activemq-optional-http.version}",
org.apache.activemq.transport.https;version="${activemq-optional-http.version}",
org.apache.activemq.transport.discovery.http;version="${activemq-optional-http.version}",
org.apache.activemq.transport.xstream;version="${activemq-optional-http.version}",
'=META-INF.services.org.apache.activemq.transport',
'=META-INF.services.org.apache.activemq.wireformat',
'=META-INF.services.org.apache.activemq.transport.discoveryagent'
</wcsri.osgi.export>
<wcsri.osgi.private.pkg>
org.apache.activemq.transport.util;version="${activemq-optional-http.version}",
</wcsri.osgi.private.pkg>
<wcsri.osgi.dynamic.import>*</wcsri.osgi.dynamic.import>
<wcsri.osgi.embed.dependency>edu.ucar.ral.wcsri.bundles.jetty-bundle-7.0.1.v20091125,xstream</wcsri.osgi.embed.dependency>
<wcsri.osgi.include.resource>{maven-resources},{maven-dependencies}</wcsri.osgi.include.resource>
<wcsri.osgi.failok>true</wcsri.osgi.failok>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-optional</artifactId>
<version>${activemq-optional-http.version}</version>
</dependency>
<dependency>
<groupId>edu.ucar.ral.wcsri.bundles</groupId>
<artifactId>edu.ucar.ral.wcsri.bundles.jetty-bundle-7.0.1.v20091125</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>${xstream.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>${pkgGroupId}:${pkgArtifactId}</include>
</includes>
</artifactSet>
<filters>
<filter>
<artifact>org.apache.activemq:activemq-optional</artifact>
<includes>
<include>org/apache/activemq/transport/discovery/**</include>
<include>org/apache/activemq/transport/http/**</include>
<include>org/apache/activemq/transport/https/**</include>
<include>org/apache/activemq/transport/util/**</include>
<include>org/apache/activemq/transport/xstream/**</include>
<include>META-INF/services/org/apache/activemq/transport/**</include>
<include>META-INF/services/org/apache/activemq/wireformat/**</include>
<include>META-INF/services/org/apache/activemq/transport/discoveryagent/**</include>
</includes>
</filter>
<filter>
<artifact>com.thoughtworks.xstream:xstream</artifact>
<excludes>
<exclude>**</exclude>
</excludes>
</filter>
</filters>
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
<createDependencyReducedPom>true</createDependencyReducedPom>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
On Nov 20, 2011, at 9:07 AM, JacobS wrote:
> I managed to get the server to work, but I cant receive object messages in
> the client because of this exception:
>
> com.thoughtworks.xstream.converters.ConversionException: Cannot construct
> org.apache.activemq.util.ByteSequence as it does not have a no-args
> constructor : Cannot construct org.apache.activemq.util.ByteSequence as it
> does not have a no-args constructor
> ---- Debugging information ----
> message : Cannot construct org.apache.activemq.util.ByteSequence
> as it does not have a no-args constructor
> cause-exception :
> com.thoughtworks.xstream.converters.reflection.ObjectAccessException
> cause-message : Cannot construct org.apache.activemq.util.ByteSequence
> as it does not have a no-args constructor
> class : org.apache.activemq.command.MessageDispatch
> required-type : org.apache.activemq.util.ByteSequence
> path :
> /org.apache.activemq.command.MessageDispatch/message/content
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/use-Http-transport-in-version-5-5-0-with-osgi-tp4088466p4088887.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: use Http transport in version 5.5.0 with osgi
Posted by JacobS <ja...@gmail.com>.
I managed to get the server to work, but I cant receive object messages in
the client because of this exception:
com.thoughtworks.xstream.converters.ConversionException: Cannot construct
org.apache.activemq.util.ByteSequence as it does not have a no-args
constructor : Cannot construct org.apache.activemq.util.ByteSequence as it
does not have a no-args constructor
---- Debugging information ----
message : Cannot construct org.apache.activemq.util.ByteSequence
as it does not have a no-args constructor
cause-exception :
com.thoughtworks.xstream.converters.reflection.ObjectAccessException
cause-message : Cannot construct org.apache.activemq.util.ByteSequence
as it does not have a no-args constructor
class : org.apache.activemq.command.MessageDispatch
required-type : org.apache.activemq.util.ByteSequence
path :
/org.apache.activemq.command.MessageDispatch/message/content
--
View this message in context: http://activemq.2283324.n4.nabble.com/use-Http-transport-in-version-5-5-0-with-osgi-tp4088466p4088887.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: use Http transport in version 5.5.0 with osgi
Posted by JacobS <ja...@gmail.com>.
Thanks, a pom would really help
--
View this message in context: http://activemq.2283324.n4.nabble.com/use-Http-transport-in-version-5-5-0-with-osgi-tp4088466p4088593.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: use Http transport in version 5.5.0 with osgi
Posted by Johan Edstrom <se...@gmail.com>.
You'll have to shade it if I remember correctly, can send a pom later today.
On Nov 20, 2011, at 6:41, JacobS <ja...@gmail.com> wrote:
> is it possible to use the http transport in amq 5.5.0 in an osgi environment
> ?
> because activemq-optional is not osgified I added it to the class-path of
> the bundle starting the broker, and added the imports and exports to its
> manifest, but I am getting exceptions telling me that the class
> org.apache.activemq.transport.http.HttpTransportFactory could not be loaded.
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/use-Http-transport-in-version-5-5-0-with-osgi-tp4088466p4088466.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.