deploy a jee6 web application in glassfish v3.1.1 - java-ee-6

What things have to taken care for deploy a web appl ( war ) in glassfish v3.1.1 ( glassfish-3.1.1-web-windows.exe installer ) , the appl. is developed using netbeans 7.0.1. I am using postgresql database . Developement machine and Production machine is different and is not connected to each other. Any detailed step by step instruction ?

It all depends on what resources your application would need to run successfully on the application server.
e.g. If your application uses container managed persistence then you have to make sure that you create the required JDBC connection pool and resource on the server before you can deploy your application server. If you check the persistence.xml file you will see if your application uses some jta-datasource (the value provided there is actually the JNDI name of the JDBC resource created on the server). Here you might also have to supply the required JDBC driver to the server if it is not package within the application.
What you can do is install the same application server on your local machine and deploy the application there and see if it fails. If it fails then you can check the stacktrace to find out the reason for failure.

Related

How to deploy EAR into the WAS cluster and IBM HTTP server by Monitored Directory Deployment functionality

My goal is to automatically deploy EAR file in WebSphere Application server cluster by Monitored Directory Deployment. So my deployment target is cluster. WAS version is 9.0.0.10. Everything works fine if I drop EAR file in
monitored directory for example '/{monitored_directory_defined_in_WAS}/clusters/my_cluster_name/'. Application is deployed and started. But I also want to deploy that application into the IBM HTTP server(resides in the same WebSphere cell with cluster) in the same automatically process by Monitored Directory Deployment.
I tried to manually predefine deploymentTargets(cluster and ibm http server) in deployment.xml file, put it in the EAR file, and drop EAR in the '/{monitored_directory_defined_in_WAS}/clusters/my_cluster_name/', but WAS deploy EAR only in cluster. As a consequence I must manually via WAS console map all modules from EAR to ibm http server, but I do not want to do it manually.
My second idea/attempt was sto create separate monitored directory for the ibm http server '/{monitored_directory_defined_in_WAS}/servers/my_ibm_http_server_name/'.
First I drop EAR into the '/{monitored_directory_defined_in_WAS}/clusters/my_cluster_name/' and right after that I drop EAR in to the '/{monitored_directory_defined_in_WAS}/servers/my_ibm_http_server_name/'. Result is that the EAR modules are deployed only in to the web server, and that is not my goal.
Is that even possible by WAS Monitored Deployment Directory functionality?
Is it allowed to manually create the deployment.xml file and add it to the EAR file?
First of all installing via monitored director is not recommended in the production environments, as it lacks control.
As you correctly suspected it is not possible to install it to the cluster and web server - check Installing enterprise application files by adding them to a monitored directory.
Because you can use only one server directory, drag and drop to map
applications to combinations of servers is limited. Scenarios
requiring use of more than one server, such as mapping to an
application server and a web server, are not supported by direct drag
and drop of an application file.
However, you still want to use it, you may deploy property file into monitored directory. That property file can fully customize your deployment e.g. configuring also module to map to web server.
Check Installing enterprise application files by adding properties files to a monitored directory for more details
UPDATE
If you have issues, I'd suggest the following approach - install your application 'classically' via admin console and map it to both web server and cluster. Then run wsadmin command to extract propertes:
AdminTask.extractConfigProperties('[-propertiesFileName myApp.props -configData Deployment=MyApplication -options [[SimpleOutputFormat true]]]')
Try to use format from that exported file for your properties
I had time to run it in my environment. I have app with 2 modules inside, one module is just mapped to the cluster, other is mapped to both cluster and web server. Here is relevant part of the property file:
taskName=MapModulesToServers
row1={ module=HelloTestUI #readonly
uri=HelloTestUI.war,WEB-INF/web.xml #readonly
server=WebSphere:cell=!{cellName},cluster=!{clusterName} }
row0={ module=HelloTestWeb #readonly
uri=HelloTestWeb.war,WEB-INF/web.xml #readonly
server=WebSphere:cell=!{cellName},cluster=!{clusterName}+WebSphere:cell=!{cellName},node=!{nodeName},server=!{serverName} }
I didnt try to use that property file to deploy the app via monitored directory, but as you can see the entry is created and mapping is done via + sign that connects cluster and web server.
If you dont see the mapping to your web server, make sure you saved the changes done in the console, and then connected via wsadmin, otherwise wsadmin will have not current data.

REST Spring Boot Web Service on Websphere 9

I want to create a Spring Boot REST Web Service and deploy and publish it in Traditional Websphere 9 Application Server. Is it possible ?
What all challenges I might encounter? Can someone please provide me few pointers for reference?
Yes this can be done. It is not a good design, but yes it can be done. Back in the day when I was working for a big bank, they deployed java spring-boot microservices in IBM websphere(Not liberty).
How to do it?
1) Package your deployable as war. You can do this by editing your pom to package as WAR.
2) You can either add connection string config in your springboot starter class or get a JNDI created in the websphere instance. We observed that performance of the API's improved when the app used websphere JNDI as opposed to app created connection bean.
3) If you use IBM MQ, the best course of action is get a non-ssl and ssl based channel created at MQ and a JNDI for the MQ connection as well.
4) If you plan to create MQ connection beans within the app, like we did, ensure the JKS file has all the valid set of signers of your org.
Problems we faced
1) Our app used a lot of third party rule engine like drools, so ensure the websphere server.xml is configured to servlet version 3.1 or higher
2) Webshpere admin console is helpful, but don't just blindly believe if it says green to your container, always check your app logs for errors.
3) Common pain points are establishing a successful connection with IBM MQ host. Get a MQ server admin to troubleshoot all MQRC errors.
4) If you plan to use Oracle as backend, ensure the DBA has created a wallet for you to enable both SSL and Non SSL connections. Some organisations are picky with non-sssl db connections. It is easier to handle all this if you leverage webspehere JNDI for DB connections.
Let me know if this helped.
Both WebSphere Traditional and WebSphere Liberty support Spring boot.
Are you looking for something like this?
http://www.adeveloperdiary.com/java/spring-boot/deploy-spring-boot-application-ibm-liberty-8-5/

Axis2 application Weblogic managed server

Have created Webservice and deployed in weblogic admin sever its working as expected. But customer wants this to be deployed in weblogic managed server and in the deployment there is no error. But not able to access service. Anyone assists on what should be done to make this working in managed server.
You can use the WebLogic admin console to deploy and target your application to the managed server. If the application is already deployed, just update the targetng mode to include the managed server.

IBM Worklight 6.1 - Project fails to initialize because the project database schema is from version N/A

I got the following error message when I try to deploy my .war file to the application server:
Error 500: javax.servlet.ServletException: Worklight Console
initialization failed.Logged Exception: java.lang.RuntimeException:
FWLSE0206E: The project /rmbp failed to initialize, because the
project database schema for data source
jdbc:db2://192.168.1.80:50001/APPCNTR is from version N/A, which is
not supported by the server from version 6.1.0.00.20131126-0630. Use
the Worklight ant tasks to upgrade the project database schema.
[project rmbp]
I already doing some research and ask IBM's about our issue as wellas reviewed the following similar question: IBM Worklight 6.1 - Unable to initialize the project due to DB2 error
It looks like you try to install a Worklight runtime to the APPCNTR database. This database is used for Application Center and is not related to the Worklight runtime database that is called WRKLGHT.
How do you install your Worklight war file : with the server configuration tool, the deployment ant scripts (that can be found in the configuration-samples directory of the Worklight installation) or manually ?
See http://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/index.jsp?topic=/com.ibm.worklight.deploy.doc/devref/r_ant_tasks_configure_dbs.html that explains how to configure the Worklight runtime database and deploy a Worklight runtime war file.
Have you create a jdbc connection in your Websphere Application Server?
It will be needed by the application inside the WAR file to connect to the database.
If you have done it, you can check inside your WAR file and look for web.xml file in WEB-INF/ folder. In my case I found a jdbc hardcoded inside the file, for example:
<resource-ref>
<description>Worklight Server Database</description>
<res-ref-name>jdbc/WorklightDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
<description>Reports Database</description>
<res-ref-name>jdbc/WorklightReportsDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
You can rename those hardcoded file into the same name of the jdbc that you created in you WAS.
For the database issue, you can follow this link to use ant for DB creation.
http://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/index.jsp?topic=/com.ibm.worklight.deploy.doc/devref/r_ant_tasks_configure_dbs.html
If you follow the 1st ant script for DB2 creation which will have two different databases, you need to create the new user for this line if you haven't done so.
Because as you can see, in the xml script, user and password will be needed to create the WRKLGHT database. For example:
<db2 database="WRKLGHT" server="proddb.example.com"
user="wl6admin" password="wl6pass">
If you use non-default port for your DB2 connection, you can add on your port number parameter after the server parameter.
For example:
port="50001"
For user creation, u can follow this link:
http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=%2Fcom.ibm.db2.luw.qb.server.doc%2Fdoc%2Ft0006742.html
The error message looks pretty clear to me. You seem to have upgraded your Worklight installation, but did not upgrade the database scheme used for Application Center.
You need to consult with the IBM Worklight Information Center.
Upgrading to Worklight Server V6.1.0 in a production environment
You do not mention how did you upgrade your installation to v6.1.0, nor what did you do. So take a look at the following topic as well regarding database upgrade, since as mentioned it looks like your DB2 database scheme for the APPCNTR database did not take place:
Manually upgrading the Worklight Server V6.1.0 databases

JBoss deployment failures after server reboots due to missing ojdbc6.jar

On our development server there are half dozen or so successfully deployed apps.
Every Sunday night, the server (not sure if it is JBoss or the actual server) is restarted. As JBoss tries to redeploy all the apps, one fails and then all are rolled back.
I think what is happening is that one application depends on ojdb6.jar, which is also deployed as an app, but the application is trying to be deployed before JBoss tries to deploy the oracle driver.
I followed this article http://middlewaremagic.com/jboss/?p=350 for installing the driver and followed the "Install as a deployment"
Should I have the server guys as the driver as a module?
Or does the error lye within how my application depends on the db driver?