JBoss 5.1.0 to Wildfly - java

We are developing a new project (spring, mvc, jdbc, rest) which we are considering to deploy it in JBoss Wildfly 8.1.0. Before we were using the JBoss 5.1.0 where we had datasource and other configurations easily created and configured along with the war file. As I am trying to learn the Wildfly I feel it has datasources and other things to be configured separately through cli or ui console.
Instead every developer in this project configuring the datasource manually on their system-server for development, is there a way to run a script to generate datasource or other way to have a single server configured with everything the project requires so that the developers can deploy their modules (war) and test it?
I see the Wildfly has two modes, domain mode and standalone mode. Is this domain and "5.1.0 domain" are different? Which is the right mode to run the server in production? I am testing my application for now in standalone mode. From the jboss doc, I see this domain is for managing the app if it is deployed in a cluster. (This project under development is non-clustered single node web-application.)
How to deploy more than one web-applications in a single Wildfly server? Do I need to create domains for every application?
How to configure app specific property files in Wildfly? (We had a prop directory created under the jbossserver/default/deploy/prop/application.properties)

You can use CLI to create datasource from command. With CLI commands you can create script also. You can find it on Google. It will be server specific and no need to create in your project.
If you don't want to run jboss in cluster mode then you can use
standalone.
You can deploy any number of web application. You need not to create
domain. Just create WAR files and deploy. You can copy WAR files in {JBOSS_HOME}\standalone\deployments folder.

Related

Java Spring MVC deploy .war on GlassFish

At first i want to say that i'm a beginner in java servers and never deploy an java .war app on server other than localhost in my intellij.
I have a simple only REST app Which work fine in localhost, i also created war file and deploy it by command "asadmin deploy --port 4849 war_name", but when i go into url http://stachurskipiotr4.usermd.net/cookbook-1.0-SNAPSHOT there is an server error.
I completely don't know what it is, i will be grateful for any help.
Access the domain port for that case. Default is 8080 if you haven't configured.
http://stachurskipiotr4.usermd.net:8080/cookbook-1.0-SNAPSHOT
Also, please use or log in your admin console to see the apps if it's deployed. You can also access it directly from there.
Glassfish already provides the Jackson libraries and the version conflicts with the one Spring depends on. Glassfish is an enterprise container, is there a specific need for the enterprise container? Try a regular servlet container like Tomcat instead. If you do want enterprise, maybe you shouldn't need using Spring
EDIT:
Removing jackson jars from your project won't help you; Spring code wants the version it wants. You can try to find out which version Glassfish provides and then see which version of Spring depends on that and use that version of Spring. This is a wrong thing to try as this will be just the tip of the iceberg. Do not try to deploy Spring code in an enterprise container, these are competing specs.
Your options are
1) figure out why is Tomcat not working. Tomcat is a battle-tested servlet container with thousands of production deployments.
2) Try a different servlet container such as Jetty.
3) Rewrite your code to the JEE specification and deploy to an enterprise container such as Glassfish or Wildfly (there are others).
4) Use Spring Boot to embed the container and package your app as an executable jar.
EDIT2:
If you chose Spring Boot, your artifact will be an executable jar, you do not deploy it into a container since the container is embedded. You start the jar via a java command. You remove the container from your deployment entirely. I don't know your deployment environment, but you do not use Glassfish at all at this point, you have to run the java command to start the server.
If Glassfish is a requirement, you have to rewrite your code

What is the correct way to deploy EAR on Weblogic with Docker

Docker is convenient to run fat jars, with embedded server. Just add the jar, expose the ports and run it.
But how docker fits with the traditional way of deploying EAR to weblogic server? Is docker still a viable tool for this kind of traditional packaging? Is there some well proven pattern, how to use docker for traditional style of java deployments with heavy emphasis on weblogic configuration? All the tutorials I find considers either executable jars or python scripts.
The WebLogic team seems to think so. The WebLogic team has developed several tools in this space:
WebLogic Deploy Tooling allows you to create WebLogic Server configurations using a metadata model in YAML - https://github.com/oracle/weblogic-deploy-tooling
WebLogic Image Tool helps you to create a Docker image using the WebLogic version and patches of your choosing, and will use the WebLogic Deploy Tooling to create a domain in the Docker image, also. https://github.com/oracle/weblogic-image-tool
WebLogic Kubernetes Operator can be used to run Docker containers with WebLogic domains in a Kubernetes environment. https://github.com/oracle/weblogic-kubernetes-operator

How to hot deploy web application on remote weblogic server?

I'm working on a java spring web application. Every time I have a little change in application, there is no way for publish this change in weblogic except creating war file and deploy it to the server. I'm working on eclipse and I want to apply changes on live project in remote server(say 192.168.0.74 while I'm on 192.168.0.70). Is there any plugin or easy solution for this?
Thanks in advance.
For Eclipse development with WebLogic, install the Oracle Enterprise Pack for Eclipse to better integrate with WebLogic. You can then deploy to a remote server automatically.
http://www.oracle.com/technetwork/developer-tools/eclipse/downloads/index.html

Could OpenShift deploy war on a DIY Tomcat or should I switch to OpenStack

Well, I've been trying to deploy war files on tomcat 8 DIY that I installed, but I couldn't find any useful tutorials, they all give examples with an OpenShift Tomcat 6/7 with git clone containning src folder and pom.xml. But DIY git clone contain misc and diy folders only.
I was able to deploy ode.war Apache server and axis2 through the web browser => ManagerApp, but it doesn't work with webServices it gives me 404 error.
Besides I need to deploy a BPEL process which cannot be rendered in a war file, is there a way to deploy a folder on ode that i've just installed it contain the processes folder pretty much like webapp in tomcat
Or should I switch to OpenStack, is it more easyier especially that all of this is just for test. Thank's
You are really talking about two different technologies there, OpenShift is a PaaS, and OpenStack is a way to control large pools of compute, storage, and networking resources throughout a datacenter.
If you really want to write Web Applications using Java, try using one of the application servers like JBoss, JBoss EAP, or WildFly, instead of using a servlet container (Tomcat).

How to setup a project in Netbeans for EJB development using OpenEJB?

We want to evaluate OpenEJB for our application. We have already performed some tests and now we need to start a pilot project.
While I've seen how to use OpenEJB for testing purposes (mainly for JUnit tests), I have not seen how to set up an EJB 3.X project inside Netbeans for deployment in OpenEJB.
The way we did for testing purposes was to create a new Java EE project, select JBOSS as the Application Server and then manually copy the JARs to OpenEJB. However, we want to be able to debug the code in Netbeans. If I try to do that, NB launches JBOSS or other application servers. I couldn't figure out how to install OpenEJB as a server in Netbeans, I didn't find anything enlightening in Java forums and there were no answers from stackoverflow.
We know we can use an embedded version of OpenEJB, but that is not what we are looking for. So:
What is the suggested project structure for an EJB application for Netbeans + OpenEJB?
Is it possible to use Netbeans' Java EE knowledge (wizards, build system, client applications) with OpenEJB?
If we need to use OpenEJB just as libraries in the classpath, what is the correct approach to generate EJBs and client applications that can work with other EJB containers later (stay Java EE compatible)?
Unfortunately, the folks behind the OpenEJB project have not contributed a server integration plugin for OpenEJB to the NetBeans project... It looks like they haven't published one on the NetBean Plugin Portal, either.
That means that you will need to be creative with your development and debugging.
I guess you could...
register GlassFish Server 3
create an ejb project that targets that server.
code, code, code.
build the project archive (dot-jar file)
start the openejb server in debug mode
copy the jar file created in step 4 to the appropriate location.
Use the 'Attach debugger...' item of the Debug menu to attach to the openejb server that you started in step 5.
If starting openejb requires that you start multiple processes (one for Tomcat and one for the ejb container), you can attach NB to multiple processes at the same time.

Categories