How to create broker as war file? - servlets

I am using ActiveMQ Artemis, and I want to create a broker in war file to later deploy it on a Jetty server. However, I don't know how to configure Artemis to generate a war file.

ActiveMQ Artemis doesn't have any ability to generate a war file.
If you want to embed an instance of ActiveMQ Artemis in your web application you need to create your own war file and then add your class that creates the embedded broker instance.
For what it's worth, the broker ships with 2 examples of how to embed a broker instance using simple POJO configuration and also XML configuration. Those are in the examples/features/standard/embedded & examples/features/standard/embedded-simple respectively.

Related

Configuration file for Cloudera Management Service

Is the a configuration file for Cloudera Management Service?
I'd like to have the service roles' configuration stored in repository. This way, service configuration can be shared between environments without the need to change the configuration via CM ui or rest API on each environment.
Cloudera deploys configs for those dynamically when service is started by agent, for example Service Monitor will end up in /run/cloudera-scm-agent/process/XXXXX-cloudera-mgmt-SERVICEMONITOR
Config itself is stored in database, in configs table.
So I would say that your only solution (sadly) is to manage config via api. Client libraries for that are pretty friendly though.

Can you deploy a message driven bean packaged as a EJB JAR on Weblogic?

Hi I am new to Weblogic and I am trying to figure out how to deploy a MDB properly. I have an EAR project that contains my Beans and config files, am I able to export that as a JAR and deploy that onto the Weblogic server?
EJB's can be deployed as JARs (see oracle docs section "Using Archived Files")
and the jar should contain the deployment descriptor xml / Annotations (e.g. #MessageDriven ) that configures the MDB.

EJB module - files

Can anyone explain me what are ibm-ejb-jar-bnd.xmi , ejb-jar.xml ,ibm-ejb-jar-ext.xmi and ibm_ejbext.properties. What are these files and what is configured in these files. What is the need of all these files in ejb project.
What does ibm-ejb-jar-bnd.xmi do and how it should be configured for message driven bean? Please let me know
ejb-jar.xml is the standard EJB deployment descriptor. It is where you declare which EJBs exist in your module.
ibm-ejb-jar-bnd.xmi is a file specific to WebSphere Application Server that contains binding information (where in JNDI should the EJB be bound, and where in JNDI should the EJB find the resources it uses). The ".xmi" file format is specific to EJB 2.1 and lower modules and has been replaced by the ibm-ejb-jar-bnd.xml file in EJB 3.0 and higher modules. The ".xmi" file format is in the XMI file format as generated by EMF and is barely documented (there is some basic information in the WAS_HOME/web directory of an installation, but you have to have some familiar with EMF to use it). Typically, the file is edited using RAD or modified during application deployment.
ibm-ejb-jar-ext.xmi is another file specific to WebSphere Application Server that contains various extensions to the specific (e.g., eager EJB initialization, stateful session timeouts, etc.). It is also only used for EJB 2.1 modules and lower and has been replaced by ibm-ejb-jar-ext.xml.
ibm_ejbext.properties is another file specific to WebSphere Application Server that is generated by EJB deploy and is not intended to be used by developers.
To manually configure ibm-ejb-jar-bnd.xmi, it's easiest to deploy the application, specify binding information, and then look at the result in PROFILE_HOME/config/cells/cell/applications/APP.ear/deployments/APP/META-INF/ibm-ejb-jar-bnd.xmi.

HttpAdapter to JavaServlet commnication

Initially we had the application server as a separate one. The communication to the Application Server from worklight servers using adapters. But currently we are moving the Application Server code to the Worklight's Server folder. We are able to call the java class (Simple java class not servlets) using HTTPAdapter. But it is difficult to communicate with the servlet (which is included in the server folder) using HTTPAdapter. Plese provide any solution?
If I understand correctly, you have put some servlet classes in your Worklight server folder. As they are Java classes they are now visible to your adapters. However servlets to be true servlets must be deployed to a JEE servlet engine, with appropriate configuration. You can deploy Servlets (in a WAR file of their own) as a separate JEE application on the same server as Worklight, but you cannot package them inside Worklight itself.
edited in response to your clarification:
You want to consolidate your servlet application, which is providing data accessed via the worklight adapter onto the same server instance as the worklight server. The Worklight Server is actually a JEE application deployed to one of the supported JEE servers, usually WebSphere Liberty which is supplied with Worklight, and the Worklight Server is in fact packaged as a WAR file. Your Data Provider servlet will also be packaged as a WAR file, all you need to do is deploy that WAR to the Liberty server you are currently using for worklight.
If you are doing this is development in Worklight Studio you can find the relevent folders by looking under "Worklight Development Server". You can drop the WAR into the apps folder and if necessary edit the server.xml to add any extra configuration:
WorklightServerConfig/servers/worklight/server.xml
See: http://www-01.ibm.com/support/knowledgecenter/SSCKBL_8.5.5/com.ibm.websphere.wlp.nd.doc/ae/twlp_dep_war.html
a second edit to try to explain again.
The Worklight Project represents your application, when you deploy to the Worklight Server a WAR file is created let's call this MyApp.WAR, that can be deployed to a WebSphere Application Server, inside Worklight Studio you are automatically given a WebSphere Liberty Profile. That Liberty Profile's configuration can be seen in the Project Worklight Development Server. Key Idea here you have one App Server that Liberty Profile, and you deploy the MyApp.WAR file to create what we usually call the Worklight server, it's the MyApp.WaR that is serving your Worklight console. That WAR file is derived from the contents of your project's server folder, this folder's name is a little misleading it's not the "server" itself it's your project-specific WAR information.
Now in addition you want to run a Servlet you already have packaged as a WAR file, let's call this Data.WAR. The key point is that you need to run Data.WAR on the Worklight Developmennt Server, the Liberty Profile. You are not including this DATA.WAR file into your project's server folder, that would effectively put DATA.war inside MyApp.WAR. Instead all you need to do is put Data.WAR in the Worklight Developmennt Server's apps folder and adjust the server.xml.
So: Step 1. Get Data.WAR running in the Development Server. Verify that from a browser you can call your expected servlet. Note the URL that works. Do not make any attempt to use your adapter until you have verified this.
Step 2. Adjust you adapter to call that URL.

How to separately deploy alfresco share application and alfresco repository on different tomcat server?

Currently, I am deploying both "share.war" and "alfresco.war" on same tomcat server.
So, how can I separately deploy "share.war" and "alfresco.war" on different tomcat servers?
I want to deploy "share.war" on tomcat server 1, deploy "alfresco.war" on tomcat server 2.
If you're looking for a way to embed Alfresco in your application, you should check this old but still mostly valid webinar.
If you want to have a quick start at running Alfresco outside any application container (i.e. directly bootstrapping the Spring context) the FirstFoundationClient sample in the Alfresco SDK is what you need.
This is really much more simple than it seems. Deploy the wars on separate tomcats, and then configure share-config-custom.xml inside /shared/alfresco/web-extension on the Share deployment to point to the Alfresco repository. It's that easy.
From a copy-paste of the official documentation :
You can run the Share application in a separate Tomcat instance from
the instance running the Alfresco WAR. This additional instance can be
installed on the same server as the original Tomcat instance, or it
can be installed on a separate server.
Install a new Tomcat instance on the same server at the original Tomcat instance.
Modify the /conf/server.xml file for the new Tomcat instance:
Change the port number (for example, to 8006) in this line:
<Server port="8005" shutdown="SHUTDOWN">
Change the port number (for example, to 8180) in this line:
<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
<Connector port="8080" ....
Move the share.war file from the original Tomcat /webapps directory to the new Tomcat /webapps directory.
(Optional) Configure the original Alfresco Tomcat deployment.
Start the original Tomcat.
You can use Alfresco supplied batch files.
If you are running the Share Tomcat instance on a separate machine, you must modify the override file in the Share Tomcat web-extension directory:
Open the share-config-custom.xml file.
Change any instance of the server and port to the correct name or IP address of the Alfresco server.
http://yourserver:8080
Save the file.
Start the new Share Tomcat instance.

Resources