Complete Glassfish Guide with MySQL - java

I want to start a JavaEE project, I've read about where to start with JavaEE and most of them were directed to Glassfish. I installed it, and was able to get to the localhost, however I don't know where to go next. Is there a complete guide or tutorial on how to use Glassfish? Also if I can use MySQL with Glassfish for the JavaEE project.

Of course, you can use MySQL. You can find a complete guide for setting up a connection with MySQL for Glassfish here.
An IDE like Netbeans is probably the easiest way to get started with JavaEE. You only need to add your freshly installed Glassfish server to Servers (under Services tab), then you can start working on your project.
However, it may be advisable not to use IDE at the beginning, since it hides from you some essential operations. Therefore, you'd better start by making your first 'test' project manually (I mean building and deploying).
There are several books for beginners to JavaEE platform and they usually start with a decent introduction on how to accomplish that. For example this one covers the topic in details:
Beginning Database-Driven Application Development in Java EE by Yuli Vasiliev.

Related

How to Migrate WebSphere 6.1 to WebSphere 8.5

I am new to WebSphere. One of the project came to upgrade the existing IBM WebSphere application server 6.1 to WebSphere application server 8.5. Four custom EJB application is running on server. Please guide what the solution to migrate to 8.5 Application Server.
I've handled a few migrations and there are definitely some gotchas to watch out for:
If this is any more critical than a development system, there is a bit of planning you'll need to do. You'll have to bring over any config from the old environment, and you'll have to make sure your applications will work in the new environment.
For the former, WebSphere itself ships with the configuration migration tools, both as command line tools and as a wizard. If you're migrating between installs on the same machine, I would definitely recommend the wizard as it better explains the process and what each setting does. If the installs are on different systems, the command line tools can help with that, but the wizard cannot. The tools to use are both documented at this link although for some reason the article neglects to mention that the wizard is also called migration.sh or migration.bat
If you have a cell topology (a deployment manager managing some number of application servers) you'll migrate the deployment manager first and then the nodes. In that case, the old cell will be disabled, so make sure you take a full backup of the old environment so you can roll back if you have to. The specific procedure for migrating a cell has a good overall order of steps to take, but doesn't mention the wizard. You can replace the "create profile, backup, restore" cycle with the wizard, but the rest of the steps should remain the same.
If it's just a standalone application server, those can usually coexist at the same time so you may be able to keep the old one active while you set the new one up, but I don't think there are any established documentation on how to do that, so to be safe, backup, and plan for some downtime.
Another consideration will be the applications themselves. You will be moving to a new version of WebSphere which supports a new level of Java EE and runs on much newer Java SE, and there are often problems and incompatibilities that come up. For that, I recommend running the binary application scanner with your applications and environment specified and seeing what it reports. If there are any severe issues it flags, it may be worth investigating those before starting the migration to minimize downtime.
Already I can tell that using EJB on WebSphere 6.1, you'll need to make sure that you install the EJBDeploy tool with your WebSphere 8.5 install. It will be automatically used during application deployment. Without that, it's pretty likely the applications won't work because their old EJBs won't deploy. Because of this, I believe you still need to use Java 7 unless you install this fix to get it to run on Java 8. I do not recommend running on Java 6 because that is going out of service by Oracle within a year or so.
So, to summarize:
Use the binary application scanner to see if there are any immediate compatibility issues to start addressing in the applications themselves
Make sure you have the EJBDeploy tool installed along with WebSphere 8.5
Use the migration wizard or command line tools to bring over your configuration and deploy your applications
#Jarid's answer documents everything available relating to WebSphere migration, and is also a good resource.
WebSphere provides an official migration toolkit to assist with the migration process: https://www.ibm.com/developerworks/library/mw-1701-was-migration/index.html

How to setup java web architecture on hosting slice/dedicated server?

I want to build web application that is based on java technology (tomcat )
Can I get please suggestions on how to set up the servers (apache – mod_jk – tomcat ? )
And what are the right frameworks to use or not .
For memory and ease of work from the development side ( to use plain jsp or mvc frame works? )
Although you didn't ask for alternatives to tomcat, if you are starting to look into web development you should have a look at Caucho's Resin. I find it is a better alternative than tomcat and makes it very easy to setup a system for test and development. It is completely built in Java and the open source version is free.
From development point of view always use an IDE such as Eclipse or Netbeans, makes the job easier n much faster. Here's a nice tutorial to get you started on developing web applications on Eclipse with Tomact integration - WTP Tutorials

Simple database web application with Eclipse and Glassfish

I just started to learning Eclipse with Glassfish server. I was looking around how can I make simple database web application, but can't figure out yet.
I downloaded the Glassfish bundle for Eclipse.
I need to create simple database ( perhaps one table ), and connect the database with simple web application. How to do that in Eclipse , can you give me some step by step link how can I do this
Thank you
For the database you could do worse than use JavaDb, which comes as standard with Java 6. Check out the JDBC tutorial for details on interfacing Java to a database.
If you decide to use Apache Derby as your database, a version of it called JavaDB comes with jee6 + Glassfish bundle, you can read this tutorial about how to connect to it and create tables from within Eclipse. You need to download the Apache Derby plugin.
This has nothing to do with Glassfish, however the example shows you how to connect to it from a normal Java desktop application using JDBC.
This Tip Of The Day seems to have the info you are looking for....
At this point, you have a webapp server and an IDE. Both of which are designed to be semi-agnostic when it comes to databases. The next choice is how you want to interact with the database. Then you should be able to find more information and examples on how to start constructing your webapp.
I'd suggest going with spring and stripes (http://www.springsource.org/ and http://www.stripesframework.org/display/stripes/Home respectively), but that's a personal choice.

How to start a web application with eclipse

I love eclipse and java. And i want to code my entire web application using eclipse .. right from designing html files to servlets.. I have zero experience in developing web apps .. So How to to setup eclipse for web apps and How do i get started ???
Google even autocompletes this question so you know it's a popular query!
There is very little information that you are providing, and there are actually tutorials for creating web applications with Eclipse and Java. You will want the JavaEE version of Eclipse as a starting point.
If you want to try using a web framework that works with Java I recommend Struts, although this may be too big if you're wanting to develop small web applications (and it's not exactly the easiest thing to start with).
I also recommend installing Apache Tomcat as your server because it's free and easy to use. Here's a good starting tutorial:
http://www.xwt.org/tutorial/eclipse/
Firstly, make sure you've got the Java EE eclipse binary : http://www.eclipse.org/downloads/
As has been mentioned, there are various google-able tutorials on how to set up, deploy and manage web applications under eclipse.

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