how to register plugins to java registery - apache-servicemix

How we can register any kind of plugin or java libs to java registry. I want to execute my application in Apache service mix and facing issue of unsupported image type. I have been using TwelveMonkeys libs but still facing same issue. As per Twelvemonkeys guidelines it is said that this TwelveMonkeys plugins are discovered automatically at run time, but its not the case when deploying project into service mix.
Any help would be great and thankful..

Related

Cannot kotlinc-native compile restful service with Spring

Quick Question: Is it possible to convert a Kotlin + Spring restful web service to a linux native application?
It works properly when run on the JVM, but I get compilation errors when I try to build it using kotlinc-native for linux.
I cannot find any definitive statement about whether I am trying to do something that is unsupported. Am I trying to swim upstream, here?
Thank you for your comments and help!
Mike
Here are some details...
Ubuntu 18.04
Latest versions of stable dependencies
You can not link a jvm library with kotlin-native. You must have a C library to be able to link it or convert the java code to kotlin.
If what you need is a embedded server executable you could check the ktor project.
The project have some client native examples and a embedded native http2-push.

Apache Karaf auto-adding library to jre.properties during build?

I have a library that relies on exporting a sun.reflect package from JRE.properties. During testing I have been manually adding this. What can I do to ensure this is automatically added within Apache Karaf?
Changes to the etc/jre.properties requires a container restart. If you are deploying this Karaf instance inside a Linux container (aka Docker), you would simply include this change as part of the linux container image build.
However, if you are deploying into a Virtual Machine environment, you'd want to make this part of your organization's custom build of Karaf. I suggest using a Maven project with the Assembly plugin to apply all your organization's changes-- ldap, security, ssl certs, etc/jre.properties... etc. It would then create a new .tar.gz or .zip file that and you would deploy your app into the modified Karaf instance.
There is an example in the HYTE Runtime build here:
HYTE Runtime
Technically, you could leverage the feature deployment mechanism to deploy an updated file, but this won't cause the Karaf instance to restart.

How can I deploy a Camel Route on JBoss Fuse?

I've developed a camel route in a Fuse Project using blueprint, now I would like to deploy the route in the Fuse Server.
I'm not sure if this is a problem but the blueprint.xml returns me this error
White spaces are required between publicId and systemId at line 1
I've tried deploying the project following some guides online: tried to use drag and drop function in jboss dev studio dragging the project folder into server window but nothing happened.
Also tried use maven building and deploying as a maven project via osgi:install but it returns me this error :
Error executing command: Error installing bundles: Unable to start bundle file:/home/pajarittu/jboss_workspace/prova_sub/target/camel-subscribe-1.0.0-SNAPSHOT.jar: Unresolved constraint in bundle camel-subscribe [293]: Unable to resolve 293.0: missing requirement [293.0] osgi.wiring.package; (osgi.wiring.package=org.json)`
Do you know how to solve this problems or different ways to deploy the service? thanks in advance for the the answers.
First of all I recommend looking at this blog post:
http://lhein.blogspot.de/2014/07/improved-server-adapters-for-jboss-fuse.html
I described there how the deployment works now in tooling.
Then you should also make sure that if you choose Fuse 6.1 you can't use Java 8 to run it. I think the last error you posted exactly is caused by this. (I could be wrong though ;) )
Finally Claus is right. If you want to run Camel on Fuse runtime you should make sure you installed all the needed features / camel components in order to sucessfully run your routes.
Hope that helps,
Lars
You can take a look at an example which used camel , REST and camel route is deployed on JBOSS fuse 6.1
https://github.com/TheMaheshBiradar/fuse-middlware-services
.

Using Google App Engine modules for multi-thread backend update of a Cloud endpoints project

I'm building "read-only" webservice (Google Cloud Endpoints as backend for an Android App) so I created a project using maven:
mvn archetype:generate -Dappengine-version=1.9.10 -Dfilter=com.google.appengine.archetypes:
and selecting archetype hello-endpoints-archetype to have some sample code to work on.
This works well and my app is correctly calling the service as expected (and the service is correctly supplying the data in return).
Now I have to implement an "update" service to periodically (4 to 6 times a dya) update the data supplied to the app. So I added a servlet to my project to be called by cron. Trouble is: one of the library used during this update uses multi-threads which cause an AccessControlException to be thrown because apparently multi-thread is only allowed in backend modules...
But after having read dozens of pages on google app engine, I still don't know how to "break" my application into modules so that particular servlet would be run as a backend module while the already existing servlet keep working as they do. So far, all I got was that I should use an EAR application composed of several WAR modules, but I don't even know if my current application is an EAR or not...
I'm using Eclipse Luna, maven 3.2.1 (embeded with Eclipse), google app engine 1.9.10, writing in Java
Could anyone please help me by explaining the directory structure and/or configuration files I have to look at, modify and/or add?
Thanks for any help provided!
You can find an example of multi-modules project here.
However, note that even in backend modules the threading is limited to 50 threads, as stated here.

java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException

I am using aspectJ in my project and added dependencies in my POM file. When i am running my application on Websphere Application Server Liberty Profile, in the library folder aspectj.jar is not getting added/created. I am very new to using spring and never used server's to run a application. When i am trying to run the application on the server i am getting the following exception:
Caused by: java.lang.ClassNotFoundException: org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException
Can anyone please team whats going on wrong with the application ?
Thanks!
You'll need to make sure that aspectj is available to your application at runtime. The two basic approaches for this are to package it up with your application zip, or to make it available as a shared library in the server. The first approach has the advantage that you don't need to do any extra config, and no matter where you run your application, the dependency will be there. However, it has the disadvantage of bloating your application. If you end up running multiple applications on the server, it could also cause the apps to use more memory than they would if they were just using a shared copy.
For the first approach, if your dependency has the default scope in the pom, maven should automatically copy it to WEB-INF/lib (assuming your application is a war).
For the second approach, you can configure it in Liberty as a global library (available to all applications) by copying it to a wlp/usr/shared/config/lib/global folder in your Liberty install.

Resources