Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

HelloWorld EJB Deploying in Sun One Application Server 7 under Windows

 
Ranch Hand
Posts: 2379
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have started preparing and deploying a simple EJB in Sun One Application Server 7. So I thought I can go with you here...
Step-1: Download and Install SunOne Application Server 7
Download SunOne Application Server 7 from http://wwws.sun.com/software/products/appsrvr/appsrvr_download.html
Unzip the downloaded ZIP file to your chosen directory. I have installed it in my office's C:\winxpprog\javaGroup\sun1as7 and in my home PC's D:\win2kProg\javaGroup\SunOneApp7 directory. We'll call it %SunOneHome% from now on. Now you can use your control panel's Services tab or Start Menu\Sun Microsystems sub menu to start stop the application server.
Now write down a simple Stateless Session Enterprise JavaBean that say's HelloWorld to its users.
Step-2: Write Down The Remote Interface
HelloWorldRemote.java

Step-3: Write Down The Home Interface
HelloWorldHome.java
package com.javaRanch.sunOne;
/**
* HelloWorldHome provides the container the means to create and destroy EJB's.
*/
public interface HelloWorldHome extends javax.ejb.EJBHome
{
HelloWorldRemote create() throws java.rmi.RemoteException, javax.ejb.CreateException;
}
Step-4: Write Down The Enterprise Bean
HelloWorldBean.java

Coming with the later parts soon.
[ August 10, 2003: Message edited by: Ashik uzzaman ]
 
Ashik Uzzaman
Ranch Hand
Posts: 2379
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Step-5: Compile The Codes
Remember that when you are compiling the codes you have to get the javax.ejb API within your classpath. For J2SDK Reference Implementation we use j2ee.jar file, for JBoss we use jboss-j2ee.jar file and for Sun One Application Server 7, I found those API in %SunOneHome%\lib\appserv-ext.jar file. I don't find reason for why it was not in the appserv-rt.jar file; at least its nothing to keep in ext (extra), right?
Before compiling your codes in your %Project_Home% (where you kept all your source codes, for me it was C:\winxpprog\coding\sun1as7tut), I think you have installed JDK 1.3 or JDK 1.4 in your machine appropriately. So give the following command after changing to your directory to your source code repository.
javac - classpath %SunOneHome%\lib\appserv-ext.jar -d . *.java
It should create the following directory strucutre "%Project_Home%\com\javaRanch\sunOne" and three class files there. If it happends for you, then you have done the compilation part.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic