Weblogic OSGI Bundles Hot Deployment - deployment

Can we do a hot deployment of OSGI bundles in weblogic. Currently i am copying the osgi bundles in osgi-lib folder. Instead of this can we deploy the following jars from weblogic console or WSLT.
In apache karaf we can deploy the bundles from command line. I am looking for something similar in weblogic.

You can always install the [Apache Felix Gogo shell] ... This has commands to install bundles and manage them. (See also OSGi enRoute Gogo page.)An alternative is Apache Felix FileInstall. This allows you to designate a folder and configuration + bundles are automatically synchronized with this folder.

Related

How can I load Java EE application dependency from WildFly modules

I am migrating my JBoss from 4.0.5 to WildFly 9.0.2 release, and my application has some dependency from JRE/lib/rt.jar, but when I deploy that application on WildFly, application gives error like ClassNotFoundException. If I add rt.jar as dependency in lib directory then application works.
So does anyone knows how to overcome from this problem.
Eg.
javax.xml.parsers.SAXParser.class which is available in rt.jar.

Tomcat integration in Eclipse with maven

I'm trying to integrate Maven to my web project. I want t run project with mvn tomcat7:run, but when I do it maven creates new tomcat configuration in MyProject/target/tomcat and when I'm trying to open it on localhost and there is 404 error. Can anybody describe me what I should do to configurate maven to use local preconfigured tomcat instance?
Maven creates a Tomcat configuration locally with mvn tomcat7:run because you are running the webapp out of the /target directory and the aim is to keep the running webapp isolated from any external configuration. For example if you required custom Tomcat configuration applying then Maven would need to modify the Tomcat conf beforehand. This might not be possible due to file system permission or could affect other webapps. So Maven copies the config locally, applies any custom configuration and starts Tomcat via the tomcat7-maven-plugin.
One option is to look at the maven-cargo-plugin which can deploy a .war built with Maven into an existing running Tomcat installation. With the correct configuration, instead or using mvn tomcat7:run you would use mvn cargo:redeploy to remove a running webapp and replace it with your freshly built webapp.
As an alternative Eclipse can be configured to start a Tomcat instance in which to run the webapp in. If you change the Eclipse project type to a Dynamic Web Project and then add a Tomcat instance to Eclipse by doing:
Window → Preferences → Server → Runtime Environments
Add → Apache Tomcat v7.0
and point it do the Tomcat you downloaded. Eclipse will use this external Tomcat as a template to create an internal Tomcat configuration for your webapp. Lastly, the webapp needs to be configured to deploy the correct resources and libraries into Tomcat. By right clicking on the project root → Properties → Deployment Assembly, alter the list to match your resource locations. A standard set-up might look something like
/src/main/java | /WEB-INF/classes
/src/main/resources | /WEB-INF/classes
/src/main/webapp | /
Maven Dependencies | /WEB-INF/lib

Configuring Glassfish to use Equinox

Can anyone explain or point me to a good resource on configuring Glassfish 3.1.1 to use the Equinox 3.7 OSGI runtime, and creating/running some simple OSGI bundle for it? Trying to work my way up to deploying an RAP application on glassfish as OSGI bundle but haven't really been able to get off the ground.
Pretty simple:
Just copy equinox jar (org.eclipse.osgi_$version.jar) to glassfish/osgi/equinox/.
Set an environment variable: GlassFish_Platform=Equinox
Start GlassFish.
Now deploy your OSGi bundles by just copying them to glassfish/domains/domain1/autodeploy/bundles/
For more information, see GlassFish/OSGi guide at
http://glassfish.java.net/public/GF-OSGi-Features.pdf

Servicemix 4.4 & hot deploy

I'm newbie with servicemix 4.x. I've tried servicemix 4.4 and servicemix-fuse 4.4 with both of them I have the same problem. I've tried to deploy samples to the deploy dir and nothing happens. Servicemix runs, I check the log (tail -f servicemix.log) and there's no message about deploying. I've tried to find some docs about hot deploy under 4.4 but I couldn't find anything.
As I can remember hotdeploy worked out of the box with servicemix 3.x, I just copied zips to hotdeploy dir.
Thanks,
Hubi
I believe ServiceMix 4.4 will hot deploy (<servicemix home>/deploy) files of two types: OSGi bundles and JBI service assemblies. That is, jar files (and exploded jar files) that contain the extra OSGi or JBI meta-information, OSGI blueprint xml files, and Spring xml files, which it assumes are OSGi. ServiceMix 4.4 will not deploy vanilla jar files as its not clear how you would want it to load them - would you want it to wrap it as an OSGi bundle, guessing at imports and exports...
Its not clear from your question what samples you are having problems with. A quick look at most of the ServiceMix samples seems that most of them are OSGi bundles (Maven packaging == bundle), which all should hot deploy when copied to the deploy directory.
If you know your jar files are, say OSGi bundles, then I'd check the <servicemix home>/etc/org.apache.felix.fileinstall-deploy.cfg file's felix.fileinstall.dir property to ensure that its configured to pick up from the directory you think. I'd also check that the File Installer and Deployer services are installed in running. Those typically are within the first 30 services installed, and don't show up on an osgi:list, so you can try
karaf#root> osgi:ls | grep Deployer
If you do not see them, check for modifications to the etc/startup.properties file - someone may have removed those services...
Hope that helps,
Scott
FuseSource
I'm using apache-servicemix-4.4.1-fuse-01-11 and hotdeploy works for me for JBI as well as OSGI based packages (zip for JBI and jar for OSGI).
Try to find your installed packages by running on the karaf console:
osgi:list | grep 'YourBundleName'
if its there all should be ok, you can install and uninstall bundles using other two commands:
osgi:install yourbundlename
osgi:uninstall yourbundlename
Once you have your bundle installed you can see the log output by issuing the following command (works only on Fuse ESB from what I know):
log:tail

JBoss / Eclipse RCP Integration

I've run into a problem with RCP and JBoss. I'm attempting to seperate the JBoss client libraries (i.e. the .jar files in the 'client' directory of the jboss distribution) from the ejbmodule. The dependency hierarchy goes:
company.client (ejbmodule containing ServiceRemote bean)
org.jboss.client (jboss client libraries)
The problem is that when the org.jboss.client attempts to load ServiceRemote from the server, it tries to do a lookup on ServiceRemote, it can't see it, and throws a ClassNotFoundException
Are there any resources/best practices out there of how to do jboss integration in RCP?
Found the answer - you can use the Eclipse Buddy system to allow low-level plugins to lookup classes which they couldn't normally see. More info here:
http://www.eclipsezone.com/articles/eclipse-vms/