0

We have ".sar"(Service Archive file) used in jboss. Currently we are planning to migrate the code to Weblogic.

Is there a way to deploy .sar files into weblogic.

If not directly possible, is there a work around where we can deploy the services on web logic.

Sastrija
  • 3,284
  • 6
  • 47
  • 64

2 Answers2

1

In order to get the custom mbeans that are in the .sar you will need to repackage the contents as an .ear as a .sar is not standard Java EE deployment mechanism - that is a JBoss proprietary archive.

Here are some instructions on how to create, package and deploy your own service MBeans (JMX Beans) along with an example of how to use it.

https://blogs.oracle.com/WebLogicServer/entry/developing_custom_mbeans_to_ma

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
John Archer
  • 359
  • 1
  • 7
1

One thing you could do is to "substitute" or "emulate" the SAR Deployer, by creating, configuring and registering MBeans. That, AFAIK, could be done in two ways:

1) Using Standard Java EE components: that means on web tier you can use the init() method of a servlet (make sure that it is preloaded on startup) or, better, a ServletContextListener

2) Using WebLogic specific components. I'm talking about Startup classes. Simply register a startup class that creates, configures and registers your MBeans.

If you are using a web module, the first approach has the obvious advantage that you are using pure Java EE components. Although you are not using that, you can add a "dummy" web module only for doing that

Concerning what you have to do in those classes, you can choose a "from scratch" approach, by parsing the xml files that describe services and therefore manually create, configure and register MBeans or, if I remember well, the XMBeans from JBoss is something that can be reused outside JBoss but you need to check because I'm not sure

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
Andrea
  • 2,714
  • 3
  • 27
  • 38