Lightweight portal server for WebSphere Portal development? - java

I'm doing some portlet development for IBM WebSphere Portal 6.1. However, the deployment process is painfully slow. As this is my first time doing portlet development, I'm not too familiar with the various portal servers out there. I'd like some recommendations for a lightweight portal server on which I can deploy quickly for development.

Pluto is the answer!
http://portals.apache.org/pluto/
I'm very happy now. :)

I believe Liferay has become Sun's adopted strategy, if that has any bearing.

If you are using Websphere Portal server, you can use the lazy load of portlet applications at server startup. This would help in less server startup times as it would not start many administrative applications.
For more information, follow this link
http://www-01.ibm.com/support/docview.wss?uid=swg27015437
Hope this help you :)

I'm not familiar with each of their deployment characteristics, but here is a list of open source portals in Java: http://java-source.net/open-source/portals

I was in a similar situation a year or two ago.
The server takes a long time to come up regardless, but it doesn't actually have to be restarted with any little change. You only have to restart the server with major changes, otherwise, restart or redeploy the project to the server.
Nevertheless, the system wasn't snappy until I had three gigs of ram. I'd recommend first upgrading your workstation to support the server. They're called workstation class systems for a reason :) Get yourself an 8gb machine and tell your boss you will be twice as productive :)

I typically use hotdeployment of changes Java classes and JSP pages. This is the fastest way. We shared 1 server with 5 developers using hotdeployment of classes to PortalServer/installedApps/.ear/yourportlet.war and this worked great. However, now and then we did have to restart the server. If you changed deployement descriptors you still need to re-deploy the portlet WAR. Make sure the reloadingEnabled flag is set to false for the wps.war app on your development machine (restart picks up the change).

You can use developer mode explained here:
http://publib.boulder.ibm.com/infocenter/wpdoc/v6r1/index.jsp?topic=/com.ibm.wp.ent.doc_v615/install/chg_dev_mode.html

Related

IBM Bluemix : How the deploy an application on Bluemix?

I am new to IBM Bluemix, till now the application (Spring-Hibernate-Rest App) was running on Tomcat Apache server of Oracle ecosystem but because of some requirement changes now it needs to be deployed on Bluemix (IBM), How can I migrate the Apache server to Bluemix ? Please let me know if there is any documentation/blog which I can refer to. Thanks
Edit:
I got this link which helped a lot Liberty for java, still searching for a decent source.
IBM developerWorks hosts numerous tutorials for getting started on Bluemix, such as the following: http://www.ibm.com/developerworks/websphere/library/techarticles/1306_king/1306_king.html and http://www.ibm.com/developerworks/cloud/library/cl-move-java-app-hybrid-cloud-bluemix-trs/index.html. You can also ask product-related questions at the IBM forum: https://developer.ibm.com/answers/smart-spaces/12/bluemix.html. And as Kayaman points out, Google is always a good place to start.
As you probably figured out WebSphere Liberty is the Java app server in Bluemix.
There is a migration toolkit for migrating Tomcat to Liberty: http://www.ibm.com/developerworks/websphere/downloads/migtoolkit/index.html
More about Liberty can be found on http://wasdev.net
Please take a look at this post about the migration from LAMP to Bluemix to have a good starting point.
You should also note that moving from an on-premise solution to a Cloud Foundry-based one requires some considerations regarding the local file system:
Local file system storage is short-lived. When an application instance crashes or stops, the resources assigned to that instance are reclaimed by the platform including any local disk changes made since the app started. When the instance is restarted, the application will start with a new disk image. Although your application can write local files while it is running, the files will disappear after the application restarts.
Instances of the same application do not share a local file system. Each application instance runs in its own isolated container. Thus if your application needs the data in the files to persist across application restarts, or the data needs to be shared across all running instances of the application, the local file system should not be used.
For this reason local file system should not be used.
Moreover, I think you should take a look at IBM Containers: A container is basically an application with all its dependencies, that is stored in a portable, platform-independent module (the container).
These should help. I know this is a couple of years late, but better late than never.
https://console.bluemix.net/docs/runtimes/tomcat/getting-started.html#getting_started
https://console.bluemix.net/docs/runtimes/tomcat/index.html#tomcat_runtime
https://github.com/IBM-Cloud/get-started-tomcat

serving static content and java web apps from one server

I'm trying to build my own site where initially I will only host my profile and resume but will also build and publish some simple web applications that I can use as coding samples for jobs. The idea is people can see a demo of the apps and then see the code on github.
Can I do all this using only tomcat or should I use another server for this purpose?
I have heard that tomcat should only be used for java web applications but I've tried it locally and it seems to work...
You can totally do it all with tomcat.
Arguably, tomcat is not as efficient as apache or ngnix for serving static assets, 10% less so, and does not scale as well. There's a good article on the subject here:
http://tomcat.apache.org/tomcat-3.2-doc/tomcat-apache-howto.html
This is not not going to be an issue for you with a small site. Go with what gets you up and running the fastest.
If you want, later you can show off your technical prowess by running tomcat behind a web server. You can tell folks at interviews the story.

Which one is the better configuration: Tomcat only OR Apache Server + Tomcat?

I have a VPS where I want to install a web application for production.
Currently, it works on Tomcat 6 connected through Apache Server using AJP module.
Every thing works ok, but I want to know if it is a good idea to configure Tomcat as the main web server due we gonna run only JSP applications.
FYI: the server must handle https requests.
Thanks in advance.
Misinformation
Years ago there was much misinformation against using Tomcat directly as a web server, but in fact Tomcat works very well as such.
I've used nearly every version of Tomcat on various projects, though all were relatively low volume. Never let me down – well, the WebDAV module never worked right. But other than that Tomcat is fast and reliable both for static content as well as dynamic servlet work.
httpd
Apache HTTP Server ("httpd") is of course very advanced and full of features. If you need those features, then use httpd. If you have very high volume traffic, then use httpd. If you have huge amounts of static access and want to relieve Tomcat of that duty thereby letting Tomcat focus its performance on your servlets, then use httpd. If you want to keep a front-facing web site running while take Tomcat up and down, use httpd. But for most relatively simple web sites or simple web apps, Tomcat suffices.
I suggest you try Tomcat alone and see how it goes. Start with your development and testing systems. Review your config files for httpd to see if all its features can be reproduced using Tomcat features. If that all works, then do some load-testing. Either hack some load-tests of your own, or try any of the many load-test frameworks.
While you can hot-deploy webapps to Tomcat, that was not always recommended in production (I'm not sure about current versions). Plan how to handle taking down Tomcat to deploy updated apps and to perform maintenance chores.
Recent Tomcat
You say you are using Tomcat 6. You may want to consider moving to Tomcat 7 or 8, but review the release notes.
Jetty
Also consider Jetty, the most direct competitor/alternative to Tomcat. Jetty is much akin to Tomcat in its purpose, scope of features, and great reputation.
If you're using SSL you will get the following benefits by front-ending with Apache HTTPD:
Ability to specify cipher suites in order of preference, which is practically mandatory if you want case-hardened SSL, and impossible with Tomcat alone.
Ability to request or require client certificates on a per-location basis instead of globally, which is Tomcat's only mechanism.
There are many other benefits as well, such as:
the ability to load-balance between multiple Tomcat instances, which alone is probably enough of a reason to do it
more control over what's logged and where the log files go
more tools to defend against attacks of various kinds.
I used standalone Tomcats for years, but having made the switch I would never go back even for a clean-sheet project.
I don't think either is better, it depends on your requirements. In environments where you may have to address security or logging requirements horizontally across heterogeneous backends (IIS, Tomcat, etc), Apache is your friend (or an expensive load balancer).
Assuming you don't have these requirements, I don't know of any advantage in using Apache for Apache sake.
SSL is easily configured in Tomcat and performance these days is likely to be on par with Apache and can be improved with APR.

How can we make a compromise between Tomcat and Websphere?

Our team is facing a difficuties while developing/modifying a servlet.
The servlet is having some unknown problem and we think I may due to too many request.
We would like to find a way so that the request could be queue up.
But what matter most is that we are developing the servlet using tomcat as the servlet container, when we put it in the production server, our company use websphere to hold it.
I don't know about websphere, but I am sure it have some way to control the requests. But we are only allowed to use tomcat to develop. Thus we do not know what would happen in the production server, this make us very sad. Of course, our company cannot afford to make another websphere for development usage.
What can I do?
If you can't find the information you're looking for in the Infocenter, you should probably test/debug on WAS. There is a free developer license for Windows and Linux (you must install it on your development machine - see the FAQ for restrictions).
While there's some merit in targeting Tomcat in development, a complete ban on the target application server is counterproductive. Production is not the place you want to find incompatibilities.
Tomcat and Websphere has different architecture and servlet engines and i think you cannot get guarantee that application that perfectly runs on Tomcat will be as well on Websphere.
Try to use JBoss free version for tests. It much more similar to Websphere than a Tomcat.
We use it for this purpose on one of the project - and it cover 99% of our problems with deploys.
Also if i remember it right exist development license version of websphere and it kind of free(but with mad license restrictions)

Java EE App Server Hello World

I am fairly comfortable with standalone Java app development, but will soon be working on a project using a Java EE application server.
Does anyone know of a straightforward how-to tutorial to getting a hello-world type application working in an application server? I'm (perhaps naievly) assuming that the overall approach is similar between different frameworks, so I'm more interested in finding out the approach rather than getting bogged down in differences between the different frameworks.
If you are not aware of a good guide, then could you post bullet-point type steps to getting a hello-world running?, i.e.
Download XX
Write some code to do YY
Change file ZZ
Other steps...
Note: Just because I have a windows machine at home, I would prefer to run if this could be run on windows, but in the interest of a better answer, linux/mac based implementations are welcome.
I would choose JBoss AS or GlassFish for a start. However I'm not sure what you mean by Java EE "Hello World". If you just want to deploy some JSP you could use this tutorial (for JBoss):
http://www.centerkey.com/jboss/
If you want to get further and do the EJB stack and/or deploy an ear-file, you could read the very good JBoss documentation:
Installation Guide
Getting started
Configuration Guide
In general you could also just do the basic installation and change or try the pre-installed example applications.
I currently have JBoss installed (on windows). I develop with Eclipse and use the Java EE server integration to hot deploy or debug my code. After you get your first code running you realy should have a look at the ide integration since it makes development/deploy roundtrips so much faster.
The JavaEE (they dropped the 2) space is pretty big. A good tutorial to start is the one from Sun. For a simple hello world application, the web container only would suffice. A well known servlet jsp container is tomcat. See here for installation instructions. Try installing it with eclipse and create a web project. This will generate some files for you that you can look at and edit. Also starting and stopping the application server is simpler.
Another option is to get Oracle JDeveloper (free to download and use - it's a full featured IDE that includes some neat extras like the SQL workbench and BPEL designer).
As a learning tool, it is quite good, not only for the tutorials available from Oracle, but it includes a range of "cue-card" lessons in the tool itself to teach many common techniques.
cue card view http://tardate.heroku.com/images/jdev-cuecards.jpg
If you haven't gone near NetBeans in a while its catching up with Eclipse very fast and worth a look, especially when starting Java EE.
Version 6.x installs Tomcat and/or Glassfish for you and then provides wizards to create/deploy/redeploy applications.
The initial tutorial on Web Applications is here and a more complex example here.
As JeroenWyseur puts it, Java EE is a fairly big space. In addition to what he said, you should try to get more details of what exactly you'll be doing: servelts & co, EJB (entity, session, message beans?) and try to get familiar with that.
It should be clear for you that your code runs in a managed environment, which imposes a lot of constraints. in order to make sure you understand what happens you should get familiar with the concept of deployment. Then, if you do EJBs, transaction management is important too. If you don't understand exactly what happens when a bean or a servlet is deployed, how transactions are managed, how beans are invoked, you're going to have a hard time.
A book that helped me a lot back in the time is Mastering EJB, by Ed Roman.
Also, getting familiar with RMI will help you understand EJBs.

Categories

Resources