Apache Servicemix - Premature end of file - cxf

I've ApacheServicemix 7.0.1 and blueprint with defined conduit (CXF). When I try to deploy it to servicemix I'm receiving Unable to find namespace handler for http://schemas.xmlsoap.org/wsdl/ followed by org.xml.sax.SAXParseException: Premature end of file. I found something similar to my problem (org.xml.sax.SAXParseException: Premature end of file for *VALID* XML) but described suggestions didn't help.
My developement environment:
System: Linux version 5.17.5-76051705-generic, architecture amd64
Server: Apache ServiceMix 7.0.1, Karaf version: 4.0.9, OSGI Framework: org.apache.felix.framework-5.6.2
JVM : Java HotSpot(TM) 64-Bit Server VM version 25.171-b11, version: 1.8.0_171, vendor: Oracle Corporation
Stacktrace:
2022-06-02 17:10:15,720 | DEBUG | Thread-16 | integration-contacts | 249 - pl.integration.contacts.integration-contacts - 1.0.0.SNAPSHOT | BundleEvent STARTING - pl.integration.contacts.integration-contacts
2022-06-02 17:10:15,720 | DEBUG | Thread-16 | ContextLoaderListener | 219 - org.springframework.osgi.extender - 1.2.1 | Processing bundle event [STARTING] for bundle [pl.integration.contacts.integration-contacts]
2022-06-02 17:10:15,720 | DEBUG | Thread-16 | ContextLoaderListener | 219 - org.springframework.osgi.extender - 1.2.1 | Processing bundle event [STARTING] for bundle [pl.integration.contacts.integration-contacts]
2022-06-02 17:10:15,720 | DEBUG | Thread-16 | BlueprintExtender | 30 - org.apache.aries.blueprint.core - 1.7.1 | Scanning bundle pl.integration.contacts.integration-contacts/1.0.0.SNAPSHOT for blueprint application
2022-06-02 17:10:15,720 | DEBUG | Thread-16 | BlueprintExtender | 30 - org.apache.aries.blueprint.core - 1.7.1 | Found blueprint application in bundle pl.integration.contacts.integration-contacts/1.0.0.SNAPSHOT with paths: [bundle://249.21:0/OSGI-INF/blueprint/contacts-orange-blueprint.xml]
2022-06-02 17:10:15,720 | DEBUG | Thread-16 | BlueprintExtender | 30 - org.apache.aries.blueprint.core - 1.7.1 | Starting creation of blueprint bundle pl.integration.contacts.integration-contacts/1.0.0.SNAPSHOT synchronously
2022-06-02 17:10:15,720 | DEBUG | Thread-16 | BlueprintContainerImpl | 30 - org.apache.aries.blueprint.core - 1.7.1 | Running blueprint container for bundle pl.integration.contacts.integration-contacts/1.0.0.SNAPSHOT in state Unknown
2022-06-02 17:10:15,720 | DEBUG | Thread-16 | BlueprintContainerImpl | 30 - org.apache.aries.blueprint.core - 1.7.1 | Xml-validation directive: null
2022-06-02 17:10:15,720 | DEBUG | Thread-16 | BlueprintEventDispatcher | 30 - org.apache.aries.blueprint.core - 1.7.1 | Sending blueprint container event BlueprintEvent[type=CREATING] for bundle pl.integration.contacts.integration-contacts/1.0.0.SNAPSHOT
2022-06-02 17:10:15,720 | DEBUG | nt Dispatcher: 1 | BlueprintStateService | 102 - org.apache.karaf.bundle.blueprintstate - 4.0.9 | Blueprint app state changed to Starting for bundle 249
2022-06-02 17:10:15,721 | DEBUG | Thread-16 | BlueprintContainerImpl | 30 - org.apache.aries.blueprint.core - 1.7.1 | Running blueprint container for bundle pl.integration.contacts.integration-contacts/1.0.0.SNAPSHOT in state WaitForNamespaceHandlers
2022-06-02 17:10:21,360 | DEBUG | heckpoint Worker | MessageDatabase | 27 - org.apache.activemq.activemq-osgi - 5.14.5 | Checkpoint started.
2022-06-02 17:10:21,363 | WARN | Thread-16 | NamespaceHandlerRegistryImpl | 30 - org.apache.aries.blueprint.core - 1.7.1 | Unable to find namespace handler for http://schemas.xmlsoap.org/wsdl/
2022-06-02 17:10:21,363 | TRACE | Thread-16 | HttpURLConnection | - - | ProxySelector Request for http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd
2022-06-02 17:10:21,374 | TRACE | heckpoint Worker | MessageDatabase | 27 - org.apache.activemq.activemq-osgi - 5.14.5 | Last update: 1:1451590, full gc candidates set: [1]
2022-06-02 17:10:21,374 | TRACE | heckpoint Worker | MessageDatabase | 27 - org.apache.activemq.activemq-osgi - 5.14.5 | gc candidates after producerSequenceIdTrackerLocation:1:1334448, []
2022-06-02 17:10:21,374 | TRACE | heckpoint Worker | MessageDatabase | 27 - org.apache.activemq.activemq-osgi - 5.14.5 | gc candidates after ackMessageFileMapLocation:1:1451709, []
2022-06-02 17:10:21,375 | TRACE | heckpoint Worker | MessageDatabase | 27 - org.apache.activemq.activemq-osgi - 5.14.5 | gc candidates after in progress tx range:[null, null], []
2022-06-02 17:10:21,375 | TRACE | heckpoint Worker | MessageDatabase | 27 - org.apache.activemq.activemq-osgi - 5.14.5 | gc candidates: []
2022-06-02 17:10:21,375 | TRACE | heckpoint Worker | MessageDatabase | 27 - org.apache.activemq.activemq-osgi - 5.14.5 | ackMessageFileMap: {}
2022-06-02 17:10:21,375 | TRACE | heckpoint Worker | MessageDatabase | 27 - org.apache.activemq.activemq-osgi - 5.14.5 | Not yet time to check for compaction: 2 of 10 cycles
2022-06-02 17:10:21,375 | DEBUG | heckpoint Worker | MessageDatabase | 27 - org.apache.activemq.activemq-osgi - 5.14.5 | Checkpoint done.
2022-06-02 17:10:21,571 | TRACE | Thread-16 | HttpURLConnection | - - | Proxy used: DIRECT
2022-06-02 17:10:21,571 | DEBUG | Thread-16 | HttpURLConnection | - - | sun.net.www.MessageHeader#3ed116997 pairs: {GET /wsdl/2003-02-11.xsd HTTP/1.1: null}{Cache-Control: no-cache}{Pragma: no-cache}{User-Agent: Java/1.8.0_171}{Host: schemas.xmlsoap.org}{Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2}{Connection: keep-alive}
2022-06-02 17:10:21,588 | DEBUG | Thread-16 | HttpURLConnection | - - | sun.net.www.MessageHeader#35b2422c5 pairs: {null: HTTP/1.1 307 Temporary Redirect}{Location: https://schemas.xmlsoap.org/wsdl/2003-02-11.xsd}{X-Azure-Ref: 03dKYYgAAAACgQXgSZZMPSrZpmfYOYR4jV0FXMDFFREdFMDUxMABhMGQwYmQzZC1mZDZiLTQwNzMtOGQyZi1jMDZlYzMzZDE1Y2U=}{Date: Thu, 02 Jun 2022 15:10:21 GMT}{Content-Length: 0}
2022-06-02 17:10:23,639 | ERROR | Thread-16 | BlueprintContainerImpl | 30 - org.apache.aries.blueprint.core - 1.7.1 | Unable to start blueprint container for bundle pl.integration.contacts.integration-contacts/1.0.0.SNAPSHOT
org.xml.sax.SAXParseException: Premature end of file.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)[:]
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)[:]
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)[:]
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)[:]
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)[:]
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)[:]
at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(Unknown Source)[:]
at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(Unknown Source)[:]
at org.apache.xerces.impl.xs.opti.SchemaDOMParser.parse(Unknown Source)[:]
at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown Source)[:]
at org.apache.xerces.impl.xs.traversers.XSDHandler.resolveSchema(Unknown Source)[:]
at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)[:]
at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)[:]
at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)[:]
at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)[:]
at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)[:]
at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)[:]
at org.apache.xerces.jaxp.validation.XMLSchemaFactory.newSchema(Unknown Source)[:]

Related

Cassandra is not starting due to java.nio.file.FileAlreadyExistsException when loading jar trigger

I'm trying to use a Trigger in Cassandra 4.1, but initialization fails when loading the jar file
Trace:
cassandra_1 | INFO [OptionalTasks:1] 2022-11-17 22:35:17,483 CustomClassLoader.java:83 - Loading new jar /etc/cassandra/triggers/cassandra-logger-0.2.jar
cassandra_1 | ERROR [OptionalTasks:1] 2022-11-17 22:35:17,488 JVMStabilityInspector.java:68 - Exception in thread Thread[OptionalTasks:1,5,OptionalTasks]
cassandra_1 | org.apache.cassandra.io.FSWriteError: java.nio.file.FileAlreadyExistsException: /tmp/lib/cassandra-0.jar
(...)
cassandra_1 | Caused by: java.nio.file.FileAlreadyExistsException: /tmp/lib/cassandra-0.jar
cassandra_1 | at java.base/sun.nio.fs.UnixCopyFile.copy(Unknown Source)
cassandra_1 | at java.base/sun.nio.fs.UnixFileSystemProvider.copy(Unknown Source)
cassandra_1 | at java.base/java.nio.file.Files.copy(Unknown Source)
cassandra_1 | at org.apache.cassandra.triggers.CustomClassLoader.addClassPath(CustomClassLoader.java:86)
cassandra_1 | ... 22 common frames omitted
cassandra_1 | ERROR [OptionalTasks:1] 2022-11-17 22:35:17,493 DefaultFSErrorHandler.java:64 - Stopping transports as disk_failure_policy is stop
cassandra_1 | ERROR [OptionalTasks:1] 2022-11-17 22:35:17,494 StorageService.java:501 - Stopping native transport
cassandra_1 | INFO [OptionalTasks:1] 2022-11-17 22:35:17,505 Server.java:176 - Stop listening for CQL clients
cassandra_1 | ERROR [OptionalTasks:1] 2022-11-17 22:35:17,506 StorageService.java:506 - Stopping gossiper
cassandra_1 | WARN [OptionalTasks:1] 2022-11-17 22:35:17,507 StorageService.java:405 - Stopping gossip by operator request
cassandra_1 | INFO [OptionalTasks:1] 2022-11-17 22:35:17,507 Gossiper.java:2087 - Announcing shutdown
cassandra_1 | INFO [OptionalTasks:1] 2022-11-17 22:35:17,509 StorageService.java:2950 - Node /192.168.96.2:7000 state jump to shutdown
cassandra_1 | INFO [OptionalTasks:1] 2022-11-17 22:35:17,513 StorageService.java:2950 - Node /192.168.96.2:7000 state jump to shutdown
Jar file:
https://github.com/felipead/cassandra-logger/releases/download/v0.2/cassandra-logger-0.2.jar
docker-compose.yaml, and cassandra.yaml:
https://github.com/hofstede-matheus/MATB09-postgres-vs-cassandra
This error also happens with hms-cassandra-triggers-1.0.1.jar, so I think there is no problem with
cassandra-logger-0.2.jar
Tried with other .jar files and no success.
Thanks in advance
Using cassandra:3.0 image in the docker-compose.yaml solved this startup issue.
I think the triggers are not compatible with version 4.1 of Cassandra.
4.1.0 release of Apache Cassandra has changed the way to load the triggers jars using java.nio (java.nio.file.Files), in earlier releases ( 4.0 or 3.X ) uses Guava (com.google.common.io.Files).
Guava copy method, by default, overwrite a file if you have permissions but java.nio not.
To solve this problem it's as easy as modify the class org.apache.cassandra.triggers.CustomClassLoader on line 86 from:
copy(inputJar.toPath(), out.toPath());
to:
copy(inputJar.toPath(), out.toPath(),StandardCopyOption.REPLACE_EXISTING);

Missing class properties transform pdfjs-dist

I have Installed npm install pdfjs-dist i want to load PDF on the browser on mobile phones. However I am getting the below error. How can i resolve this?
Failed to compile.
./node_modules/pdfjs-dist/build/pdf.js
SyntaxError: C:\node\node_modules\pdfjs-dist\build\pdf.js: Missing class properties transform.
3520 |
3521 | class PixelsPerInch {
> 3522 | static CSS = 96.0;
| ^^^^^^^^^^^^^^^^^^
3523 | static PDF = 72.0;
3524 | static PDF_TO_CSS_UNITS = this.CSS / this.PDF;
3525 | }

Proxying multiple create-react-app static folders with Nginx

I have a nginx hosted on a VM with an authentication service that expose a simple login page and some other services hosted onto a secondary VM (create-react-app builds served through serve -s build).
If the user tries to access a protected resource gets promped the login page.
The architecture is as follow:
+-------------------------------+
| Other VM |
| |
| +-----------------------+ |
| |serve -s build -l 8000 | |
+--------------------> localhost:8000 | |
| /resource1 | | | |
| | +-----------------------+ |
| | |
+----------+ | | |
| | | | +-----------------------+ |
/static? | Linux | | | |serve -s build -l 7000 | |
+---------->+ nginx +-----+--------------------> localhost:7000 | |
| Auth sys | /resource2 | | | |
| | | +-----------------------+ |
+----------+ | |
| ● |
| ● |
| ● |
| |
| |
+-------------------------------+
I have correctly configured nginx to reverse proxy all the resources.
resource1, resource2, resourcen and auth system access to a /static folder to take css, js, etc...
I have done a "workaround" to retrieve the correct static folder that is as follow:
location /static {
try_files $uri $uri/ =404;
if ($http_referer ~ ^http://linuxhostname/resource1) {
proxy_pass http://otherVMhostname:8000;
}
if ($http_referer ~ ^http://linuxhostname/resource2) {
proxy_pass http://otherVMhostname:7000;
}
}
Seemed to work fine until I faced this situation:
trying to access /resource1 without authentication:
The user is requesting /resource1 but the login page is prompted, nginx is proxying static files onto the other vm while they are on its file system, this results in a 404 error.
To mitigate this issue I thought to change the static folder name into something specific (e.g. for resource1, put static_r1) but I found that is not straightforward (see this link).
Do you have any ideas on how this can be approached nginx side or application side?
Thanks
After some experience and the updates made to the create-react-app I learned that you can use an environment variable when you build your package that is PUBLIC_URL=basepath.
This will make the index.html (the entrypoint of the React SPA) look for static files inside /basepath/static, hence by setting this variable the job is done.
The only thing you need to be aware of is the actual path on the websever, for example: if you use the nginx directive try_files $uri it will actually look inside $root_dir/basepath since the $uri will contain the base path.

Running Grails With Connection To DB

I would like to know what mistake I've made that, after I set my connection details, the log panel started to trace this in my grails app:
I a using NB 6.9 RC2 with Grails 2.4.3 and PostGreSQL 9.4
24/04/2016 07:31:11 org.codehaus.groovy.runtime.m12n.MetaInfExtensionModule newModule
ADVERTENCIA: Module [groovy-all] - Unable to load extension class [org.codehaus.groovy.runtime.NioGroovyMethods]
24/04/2016 07:31:12 org.codehaus.groovy.runtime.m12n.MetaInfExtensionModule newModule
ADVERTENCIA: Module [groovy-all] - Unable to load extension class [org.codehaus.groovy.runtime.NioGroovyMethods]
|Loading Grails 2.4.3
|Configuring classpath
.
|Environment set to development
.................................
|Packaging Grails application
....................................
|Running Grails application
24/04/2016 07:31:29 org.codehaus.groovy.runtime.m12n.MetaInfExtensionModule newModule
ADVERTENCIA: Module [groovy-all] - Unable to load extension class [org.codehaus.groovy.runtime.NioGroovyMethods]
Error |
2016-04-24 07:31:51,632 [localhost-startStop-1] ERROR spring.BeanBuilder - WARNING: Your cache provider is set to 'net.sf.ehcache.hibernate.EhCacheRegionFactory' in DataSource.groovy, however the class for this provider cannot be found.
Using Grails' default cache region factory: 'org.hibernate.cache.ehcache.EhCacheRegionFactory'
Error |
2016-04-24 07:31:54,554 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener - Error initializing the application: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource': Cannot resolve reference to bean 'dataSourceLazy' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceLazy': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy]: Constructor threw exception; nested exception is java.lang.UnsupportedClassVersionError: org/postgresql/Driver : Unsupported major.minor version 51.0
Message: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource': Cannot resolve reference to bean 'dataSourceLazy' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceLazy': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy]: Constructor threw exception; nested exception is java.lang.UnsupportedClassVersionError: org/postgresql/Driver : Unsupported major.minor version 51.0
Line | Method
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 | run in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 662 | run . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource': Cannot resolve reference to bean 'dataSourceLazy' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceLazy': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy]: Constructor threw exception; nested exception is java.lang.UnsupportedClassVersionError: org/postgresql/Driver : Unsupported major.minor version 51.0
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 | run in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 662 | run . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource': Cannot resolve reference to bean 'dataSourceLazy' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceLazy': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy]: Constructor threw exception; nested exception is java.lang.UnsupportedClassVersionError: org/postgresql/Driver : Unsupported major.minor version 51.0
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 | run in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 662 | run . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'dataSource': Cannot resolve reference to bean 'dataSourceLazy' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceLazy': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy]: Constructor threw exception; nested exception is java.lang.UnsupportedClassVersionError: org/postgresql/Driver : Unsupported major.minor version 51.0
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 | run in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 662 | run . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'dataSourceLazy': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy]: Constructor threw exception; nested exception is java.lang.UnsupportedClassVersionError: org/postgresql/Driver : Unsupported major.minor version 51.0
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 | run in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 662 | run . . in java.lang.Thread
Caused by BeanInstantiationException: Could not instantiate bean class [org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy]: Constructor threw exception; nested exception is java.lang.UnsupportedClassVersionError: org/postgresql/Driver : Unsupported major.minor version 51.0
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 | run in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 662 | run . . in java.lang.Thread
Caused by UnsupportedClassVersionError: org/postgresql/Driver : Unsupported major.minor version 51.0
->> 632 | defineClassCond in java.lang.ClassLoader
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 616 | defineClass in ''
| 141 | defineClass in java.security.SecureClassLoader
| 283 | defineClass in java.net.URLClassLoader
| 58 | access$000 in ''
| 197 | run in java.net.URLClassLoader$1
| 190 | findClass in java.net.URLClassLoader
| 307 | loadClass in java.lang.ClassLoader
| 247 | forName in java.lang.Class
| 303 | innerRun in java.util.concurrent.FutureTask$Sync
| 138 | run . . in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run . . in ''
^ 662 | run in java.lang.Thread
Error |
Forked Grails VM exited with error
Thankx

ActiveMQ OpenWire C API problem

I run ActiveMQ 5.5.0 broker on Ubuntu, downloaded and compiled APR 1.4.5 and C API related libactivmq and libopenwire.
The test c supplied in Examples at:
http://svn.apache.org/repos/asf/activemq/sandbox/openwire-c/src/examples/
does not work, the issue is with the WireFormat magic code, see debug lines from the log:
2011-07-07 15:35:30,324 | DEBUG | Sending: WireFormatInfo { version=7, properties={CacheSize=1024, CacheEnabled=true, SizePrefixDisabled=false, MaxInactivityDurationInitalDelay=10000, TcpNoDelayEnabled=true, MaxInactivityDuration=30000, TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]} | org.apache.activemq.transport.WireFormatNegotiator | ActiveMQ Task-2
2011-07-07 15:35:30,327 | DEBUG | Using min of local: WireFormatInfo { version=7, properties={CacheSize=1024, CacheEnabled=true, SizePrefixDisabled=false, MaxInactivityDurationInitalDelay=10000, TcpNoDelayEnabled=true, MaxInactivityDuration=30000, TightEncodingEnabled=true, StackTraceEnabled=true}, magic=[A,c,t,i,v,e,M,Q]} and remote: WireFormatInfo { version=1297154048, properties={}, magic=[^A,^#,A,c,t,i,v,e]} | org.apache.activemq.transport.InactivityMonitor | ActiveMQ Transport: tcp:///127.0.0.1:51606
2011-07-07 15:35:30,327 | DEBUG | Received WireFormat: WireFormatInfo { version=1297154048, properties={}, magic=[^A,^#,A,c,t,i,v,e]} | org.apache.activemq.transport.WireFormatNegotiator | ActiveMQ Transport: tcp:///127.0.0.1:51606
2011-07-07 15:35:30,333 | DEBUG | tcp:///127.0.0.1:51606 before negotiation: OpenWireFormat{version=7, cacheEnabled=false, stackTraceEnabled=false, tightEncodingEnabled=false, sizePrefixDisabled=false} | org.apache.activemq.transport.WireFormatNegotiator | ActiveMQ Transport: tcp:///127.0.0.1:51606
2011-07-07 15:35:30,337 | DEBUG | Transport failed: java.io.IOException: Remote wire format magic is invalid | org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ Transport: tcp:///127.0.0.1:51606
I debugged the client side and captured values sent to the broker, 15 bytes, I will list them below:
1: '\001'
2: '\001'
3: '\000'
4: 'A'
5: 'c'
6: 't'
7: 'i'
8: 'v'
9: 'e'
10:'M'
11:'Q'
12:'\000'
13:'\000'
14:'\000'
15:'\002'
here last four bytes is version, which is set to 2
Somehow this message is shifted/misinterpreted by broker, so the magic token and version are wrong.
One more piece of information: I compiled libopenwire using both supplied versions ow_commands_v1.[ch] and ow_commands_v2.[ch], so I tried to link the test with both, the result is the same with either version. Does anyone know the reason for two versions? which one should I use?
Note: this message has been posted several days ago on apache forum, but no response. I hope on this site message will get more traffic.
The OpenWire C API is not maintained by anyone so its not surprising that its broken. There is a C wrapper for ActiveMQ-CPP in the ActiveMQ svn repo you could try using instead, if you are really married to using C.

Resources