Is it possible to deploy container-less java application in Openshift PaaS? Everybody knows that java server application can be created using embedded jetty which bypasses the need of any java application server like jboss/weblogic, hence saving a lot more resources in terms of memory in a resource constraint environment like cloud. As Openshift started supporting vert.x, I am curious is it possible to deploy container-less java application there?
The intended application logic is more or less like this : http://www.jamesward.com/2012/08/13/containerless-spring-mvc
I know openshift does not offer cartridges like this, but I am eager to know is it possible by creating a diy cartridge?
You should be able to use the DIY cartridge and use action hooks to start your application any way that you want to.
Related
Encountered a requirement in our team when trying to migrate a WebSphere application into Tomcat and deploy onto Pivotal Cloud Foundry to have same application to connect to two different databases which have entirely same schema with different data, essentially having same application code deployed in different paths and be able to connect to the databases based on the URL being called for accessing the application.
Currently, we handle this situation in Websphere by using the deployment script to deploying the application into two servers and give the different database details in JNDI and access the application using the server names.
We use Jenkins to deploy the application onto PCF.
Tried to use maven to deploy on to different context paths which did not help and have ended up in the loop, Have anyone encountered a situation like this, Any thoughts would be appreciated.
I think there are a number of ways you could handle this.
Modify your application so it's aware and let's you pick. Perhaps have a query parameter to select or /dev/blah goes to one DB and /test/blah goes to another.
Push the same application twice, but bind different databases and routes to each app.
Attempt to run two instances of the same app code inside Tomcat in one app on CF.
Of those, #1 is fine but would probably require code changes. #2 would be my choice as it's very quick to do, #3 would be a lot of work because you'd be fighting against the Java buildpack, which is not recommended.
To accomplish #2, you would do the following:
Push your app code as app-A.
Bind the database service.
Map a route with a context path like my-cool-app.example.com/app-a.
Start your app.
Repeat the same for app-B, but use a different database and route/path (i.e. my-cool-app.example.com/app-b)`.
If you are deploying a WAR file, you will need to tell the Java buildpack to deploy your app on a context path (it should match the route context path you set).
cf set-env my-application JBP_CONFIG_TOMCAT '{tomcat: { context_path: /app-a }}'
https://github.com/cloudfoundry/java-buildpack/blob/master/docs/container-tomcat.md#common-configurations
If you're using Spring Boot and a JAR deployment, you'd need to set server.contextPath=/app-a.
Hope that helps!
Currently, I use WAS for deploying the java builds on a remote server. I need to remove whole big WAS server since I dont host any application as it is just for deployment using wsadmin.
I just want to retain the WAS libraries which may require for deployment remove everything else.
Is it possible to deploy with WAS but using only needed libraries?
If yes, what could be the procedure to do that?
Thanks
One such solution is described in Using the latest Jython with a WebSphere Application Server wsadmin thin client.
Another one is WDR.
I need portable container for running web services as server. JSON as a response. The server application must be able to start up using .bat script under Windows. Machine running the server must have only Java Runtime Enviroment installed, no other stuff required.
Axis2 on top of Tomcat do not seem like simple portable web server. What are the other alternatives?
UPDATE:
How come no one offered?
com.sun.net.httpserver.HttpServer;
and
com.sun.jersey.api.container.httpserver.HttpServerFactory;
Jetty is a good option.
Another very lightweight option is fluent-http.
I'm not that familiar with Axis2, but as far as I know you can use embedded tomcat to achieve this with whichever frameworks you please.
Take a look at the tomcat maven plugin which I believe will even generate your application as a jar containing embedded tomcat in the latest version.
I want to develop a standalone java application, with web browser as front end. This application will run locally and won't be making any remote server calls. I'm essentially using java, as web-browser cannot perform file operations.
I want this application to be portable: no need of installation. Just copying a folder should be enough. I want to know how it can be done, how will javascript communicate with java code.
In continuation of #Quentin's answer.
Yes, you need web server.
There are 2 principal architectures:
Create stand alone application with embedded web server
Create ordinary web application and run it on proprietary web server.
IMHO I think that the second approach is better, however it strongly depend on your application functionality.
You can take jetty or grizzly as a web container. Both can run as in embedded or stand alone modes. You are welcome to share other details of your application with the community if you need concrete advises concerning to the design of your application.
The application would need to implement an HTTP server. Then all communication would be done over HTTP.
Write a small web application as you need and Deploy it using Jetty. Jetty is a pure Java-based HTTP server and Java Servlet container. You can use it by embedded mode also.
Deployment is so easy if you use Jetty-Runner
java -jar jetty-runner.jar my.war
You don't need a local web server. Take JavaFX (embedded webkit) and implement a URL protocol handler for say "myprotocol". Then you can access it from the browser using something myprotocol://xxx.yyy.zzz
I want to check deploying procedure of my struts2 web application developed using eclipse juno on local tomcat server. I want to deploy it to a remote host like 000webhost. Can you provide me any information how to do that?
well, I run my application by typing
http://localhost:8080/Struts2starter/
on browser I want to run it by typing
http://myapp.com/Struts2starter
like something on browser. I wanted to know how to do it.
I don't believe you can deploy a Java application in 000webhost. For example, you can deploy on Google App Engine. Here is an example of how to do that: http://www.mkyong.com/google-app-engine/google-app-engine-struts-2-example/
It depends on server in question. Most servers provide some kind of remote deployment using manager applications / rmi connectors / whaever else exitic means , and eclipse can work with most of them. But of course it needs to be configured on both sides in order to work. Be more specific about your server config, and you will surely get proper answer