Question

Kind of a silly question...

I want to learn J2EE and have been doing some research. I want to build a simple multi-tiered architecture to develop some simple J2EE applications. I plan to use JBOSS as my Application Server and MySQL as my DBMS. I cannot find any simple JBoss installations, they all seem to be bundled in this JBOSS development studio.

Should I use the development studio or is there a better, more 'involved' way to get setup? My concern is that the development studio will not allow me to learn all the bits and pieces of a J2EE architecture.

Thoughts?

Was it helpful?

Solution

It's just my opinion but if you really want to learn how the things works, then use your IDE just for code editing and do the rest from the console, you will see how things works under the hoods.

I am going to describe how to run things under Linux but it's pretty similar to do it on Windows.

For instance, download JBoss from here, unzip it, go in the console to the folder where you have unzipped it and run sh bin/standalone.sh - whoa, your server is running now and you didn't need any hardcore setup in your IDE:-)

Then, it's always nice to have some application to get you started. If you are going to build an enterprise application you will definitely need some kind of tool which will manage your dependencies and libraries you will need for your project. In Java world, this tool is most commonly Maven. So install it to your machine (you will find some tutorial for this) and then just issue from command line this command

mvn -DarchetypeGroupId=org.codehaus.mojo.archetypes -DarchetypeArtifactId=webapp-javaee6 -DarchetypeVersion=1.5 -DarchetypeRepository=http://repo.maven.apache.org/maven2 -DgroupId=org.yourProject -DartifactId=hello-javaee7 -Dversion=1.0-SNAPSHOT -Dpackage=org.yourProject.hellojavaee7 -Darchetype.interactive=false --batch-mode archetype:generate

Then edit your pom.xml which contains dependencies for your project, you see there is just a single one - javaee-web-api which will give you everything you need for Java Web development, nice, isn't it?:-)But you have said that you need full Java EE stack, so change this dependency into

<dependency>
    <groupId>javax</groupId>  
    <artifactId>javaee-api</artifactId>  
    <version>7.0</version>
</dependency> 

And you've got even EJB, JTA and other technologies supported in your project. Ok, I now suppose you would like to see your app running, add another plugin to your pom.xml

<plugin>
    <groupId>org.jboss.as.plugins</groupId>
    <artifactId>jboss-as-maven-plugin</artifactId>
    <version>7.3.Final</version>
</plugin>

And then just issue this command from your project home directory

mvn jboss:deploy

And that's it, your starter app is available on http://localhost:8080/hello-javaee7-1.0-SNAPSHOT/

I guess it's little bit overwhelming for the start but it's not so hard, you don't have to be expert on Maven, JBoss, EJB or any other technology to build enterprise application:-)

P.S. I am not against any IDE but I think it's great to learn these things outside IDE because it will help you understand how things actually works, bonus of this approach is also that you can import this project to any IDE you want and continue development there.

OTHER TIPS

If you want to have the full Java EE stack, you can still use eclipse (or other Ide) and JBoss locally without the development studio.

Download the latest JBoss version from http://www.jboss.org/jbossas/downloads (Right now it's AS 7.1.1.Final). It's just a zip file you need to unpack.

In eclipse go to the server view, right click for "New". You need to "Download additional server adapters" and chose JBoss AS Tools from the list. The rest of the setup is pretty straightforward; Point to the directory with your JBoss AS and you are done.

Make a new project in Eclipse and under "Projects Facets" select "Dynamic Web Module". Now you can add the project to JBoss (Right click JBoss "Add / Remove".

Start the Server and enjoy your first Java EE Application.

The Eclipse tooling is for the more experienced. I would suggest downloading Netbeans with Glassfish (reference java EE server) as things work out of the box.

Then when you get a bit more experienced you will know what Eclipse needs to function well.

    using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


                // All three ways will return the same result FYI. You only need to pick one way
                return prov;

            }

            catch (Exception)
            {
                throw new Exception("there was a problem");
            }
        }
    }
}
-Add a menu entry for the contract controller consider the consultant controller
<li><a asp-area="" asp-controller="Contract" asp-action="Index">Contract</a></li>
<li><a asp-area="" asp-controller="Consultants" asp-action="Index">Consultants</a></li>


    public class WorkSessionMetadata
    {
        public int WorkSessionId { get; set; }
        public int ContractId { get; set; }
        public DateTime DateWorked { get; set; }
        public int ConsultantId { get; set; }
        public double HoursWorked { get; set; }
        public string WorkDescription { get; set; }
        public double HourlyRate { get; set; }
        public double ProvincialTax { get; set; }
        public double TotalChargeBeforeTax { get; set; }

    }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top