Is it possible to deploy JSF application on Bluemix? - jsf

I have installed IBM Bluemix tools on Eclipse and created a 'Hello World' JSF and EAR project. While creating I have chosen a Bluemix runtime environment. Now I try to deploy EAR from Eclipse, it successfully deployed and started but when I try to open it I get the following error:
Not Found The application or context root for this request has not been found: [Ljava.lang.Object;#bdb04149
What have I missed? Is there comprehensive tutorial to deploy Java EE web applications on Bluemix available anywhere?

You can deploy complete EAR files on Bluemix yes. Using the eclipse tools also makes it much easier. This link has steps on how you can do this https://www.ng.bluemix.net/docs/#manageapps/eclipsetools.html
Further down the page (you can use the menu on the left too) there are steps on how to push an EAR. It might be with pushing a complete Liberty profile to get finer control on the application behavior. This link has further details on pushing Liberty apps and the profile itself https://www.ng.bluemix.net/docs/#starters/liberty/index.html#liberty

If you deployed an EAR (containing your JSF app) you need to add the web module name to the URL, for example, if your project is called testJSF, your URL will look like this:
http://testApp.mybluemix.net/testJSF/
And of course, if your web page is not called index.xxx you need to add the web page name as well, for example:
http://testApp.mybluemix.net/testJSF/textPage.xhtml
or
http://testApp.mybluemix.net/testJSF/textPage.faces

Related

How to deploy dependencies with XPages Runtime in Bluemix

I uploaded my project to Bluemix using IBM Domino Designer, the XPages runtime started fine. During testing, I hit the URL and I received a message
"The application /gittest.nsf requires org.openntf.xsp.debugtoolbar.library. This library cannot be found."
I use a UpdateSite on premises and this application also uses jars in the lib\ext folder on the Domino server.
How do I deploy external jars with the XPages runtime?
How do I deploy my servers updatesite?
When I build locally, I have a c:\sharedlib folder where I have Spring Boot, Hibernate, a Service jar with DAO. In my designer, the project is configured to use the external jars. On the server, I have these jars in the lib\ext folder.
I also use some openNTF projects in UpdateSites (like the error sampled here).
Please advise!
You need to put all the osgi plugins in a folder named 'shared-plugins' this directory should be at the same level as the Manifest.yaml file in your project's deployments folder.
More details see the blog of Oliver Busse
http://oliverbusse.notesx.net/hp.nsf/blogpost.xsp?documentId=FD2

How to find out right URL to JSF page? Opening in IntelliJ IDEA causes 404

I'm very new on Java Web dev. On intellij Idea 14, I started a new project with plain Java, JSF support (no JavaEE, will add Spring later). Tomcat 7.0.59 as server. When I hit run on the IDE, firefox opens up and hits on 'http://localhost:8080/index.xhtml', it should display the hello world in index.xhtml that the IDE makes on new project, but the page just displays 'HTTP 404'.
I think the problem is path on the browser, how can I find the correct path and configure it on IDE deploy settings?, how can I debug on tomcat?, where can I start looking?
http://localhost:8080/index.xhtml is an incomplete address. Where is the context root? It should be the name of your project/webapplication, where you would have
"http://localhost:8080/{application-name}/index.xhtml".
Unless you've set your application to be the default tomcat application (which I highly doubt), you should have the name of your project in there in the URL
%CATALINA_HOME% is Tomcat install directory. Use %CATALINA_HOME%\logs to read Tomcat log for debugging.
When you create a new Java web project, It also means you are diving to Java EE (Enterprise Edition).
Create new JSF web application by IntelliJ IDEA:
Offical tutorial for you: http://docs.oracle.com/javaee/7/tutorial/partwebtier.htm#BNADP .
You should use GlassFish 4 application server for simplicity at first one.
move the lib directory into WEB-INF

dyploying javafx on web

I want to build set of tools for my team and they will be as part of JavaFX application for which GUI will be build with help of SCENE BUILDER. I have seen everything that was available but I need an example how to embed this type of application on the server from which it can be invoked somehow. Please help with examples and links. I'd like to make it look as this one. http://download.oracle.com/otndocs/products/javafx/2.2/samples/Ensemble/index.html
Thank you.
Place a copy of the jar, jnlp and html file output by the NetBeans JavaFX project build or JavaFX packaging tools deploy command into a directory of your webserver, then access the html file in your browser.
For example, let's say you called your application MyPowerApp and netbeans output MyPowerApp.html and you wanted to deploy that to a local Tomcat server:
Download and install a copy of Tomcat
Copy the jar, jnlp and html file into tomcat's webapps/ROOT directory.
Start tomcat.
Access your application via http://localhost:8080/MyPowerApp.html
The applet will start automatically and you can click on the link to launch the application via WebStart.
To update the application just rebuild it in NetBeans, copy it over into the tomcat webapps/ROOT directory and refresh your browser link (no need to restart Tomcat).
In practice you will want to modify the html rather than use the generated html to embed either the applet or WebStart link somewhere on your website (you won't need both execution modes in a single page like the Netbeans generated sample).
You may need to sign your application if it refers to needs permissions outside of the jnlp application sandbox.
To get the application to fill a browser window like Ensemble, it's height and width need to be set to 100% and the HTML page template modified to not have any page margins (view source on the Ensemble page for a sample).
You can include your fxml in your application jar and load it from there or you can load it off your server relative to your application deployment directory.
The information above is a variation of my forum answer on deploying JavaFX web applications to a server.
See the JavaFX deployment guide and Ensemble sample application source for more info.
deployment guide
deployment QuickStart
ensemble sample application
JavaFX sample application source at the JavaFX demos and samples link

How to open a Java Web Start Application from a Hyperlink in a JavaFX 2.0 Application

I have a web application that loads other applications from within it, how can I open a java web start application from within my JavaFx 2.0 application. All help is greatly appreciated.
It's long to answer, you need to study how to Deploy Java Web Start application first.
The basic approach is:
Create a JAR file containing your application's class files and resources. including Main-Class attribute in your MANIFEST.MF.
Create JNLP files to describe how your application to run, You can also use JavaFX Packager tool to help.
Then look at source code for The Java FX Ensemble example to figure out JavaFX specific configuration, and full documentation Deploying JavaFX Applications.

Integration of Java application with OpenCms

I want to know how to integrate a Java web application with OpenCms contents. Is it possible to integrate a Java application with OpenCms?
Yes, it's possible. For example you can integrate SpringMVC or Struts into OpenCms, or other tools like JForum, an open source java forum, which also supports single-sign-on (SSO).
You can find information here & a small sample OpenCms+Spring integration project:
http://www.opencms-wiki.org/wiki/Integration_HOWTOs
Since OpenCms is open source and based on Java EE standards, you are pretty free.
What I have done successfully is to create a jstl tag library to connect JSPs in OpenCms to a business backend.
In my case it was done through a SOAP web-service.
Another advantage of this was that I could test and develop my code in Eclipse, without a dependency on OpenCms.
Deploying to production would then mean to deploy a jar file to the OpenCms webapp.
Yet another advantage: Since we put some of the view-logic into the OpenCms-hosted JSPs, they were versioned by OpenCms.
We have integrated SprigMVC into an existing OpenCMS installation. Here is a description of how we went about that: http://blog.shinetech.com/2013/04/09/integrating-springmvc-with-opencms/

Resources