Stuck In the Mud with First EJB

I am using the apress 'Beginning Java EE, from Novice to Professional' book. In its first EJB example it attempts to create am extremely simple stateless session bean. There are two classes and a remote interface as follows;
package beans;
import javax.ejb.Remote;
@Remote
public interface SimpleSession
public String getEchoString(String clientString);
package beans;
import javax.ejb.Stateless;
@Stateless
public class SimpleSessionBean implements SimpleSession {
public String getEchoString(String clientString) {
return clientString + " - from session bean";
package client;
import beans.SimpleSession;
import javax.naming.InitialContext;
public class SimpleSessionClient {
public static void main(String[] args) throws Exception
InitialContext ctx = new InitialContext();
SimpleSession simpleSession
= (SimpleSession) ctx.lookup(SimpleSession.class.getName());
for (int i = 0; i < args.length; i++) {
String returnedString = simpleSession.getEchoString(args);
System.out.println("sent string: " + args[i] +
", received string: " + returnedString);
The directory structure is;
SimpleSessionApp
|-beans
|-SimpleSession
|-SimpleSessionBean
|-client
|-SimpleSessionClientThe tells you to add the following to your classpath;
set CLASSPATH=.;C:\jboss\lib\concurrent.jar;
C:\jboss\lib\jboss-common.jar;
c:\jboss\client\jboss-j2ee.jar;
c:\jboss\lib\commons-httpclient.jar;
C:\jboss\server\all\lib\jboss.jar;
C:\jboss\server\all\lib\jboss-remoting.jar;
C:\jboss\server\all\lib\jboss-transaction.jar;
C:\jboss\server\all\lib\jnpserver.jar;
C:\jboss\server\all\deploy\ejb3.deployer\jboss-ejb3.jar;
C:\jboss\server\all\deploy\ejb3.deployer\jboss-ejb3x.jar;
C:\jboss\server\all\deploy\jboss-aop.deployer\
jboss-aop.jar;
C:\jboss\server\all\deploy\jboss-aop.deployer\
jboss-aspect-library.jar
The next step is to compile the java source  code;
javac -d . client/*.java
javac -d . beans/*.javaAfter this you create an ejb3 jar;
jar cf SimpleSessionApp.ejb3 beans\*.javaAnd deploy this jar to your jboss deploy directory while jboss is running. Once this is done you run the client with the following arguments and switches while inside the client directory of SimpleSessionApp;
java
-Djava.naming.factory.initial=
org.jnp.interfaces.NamingContextFactory
-Djava.naming.factory.url.pkgs=
org.jboss.naming:org.jnp.interfaces
-Djava.naming.provider.url=
localhost client.SimpleSessionClient
Now is the time for all good men
After having done all of this I get the following error
+Exception in thread "main" java.lang.NoSuchMethodError: main+
why is this? This is my first attempt at creating an ejb and I'm totally lost. Any help would be appreciated.
Edited by: Jazman on Feb 19, 2008 2:42 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

if you turn the computer off and turn it back on while you hold down the mouse key that should get the disc out.

Similar Messages

  • HT1895 My macbook pro is making strange fan related noises. Sounds as if something is stuck in the fan. First time this has happened since I got my computer. Every time I put it to sleep I wouldn't hear the sound anymore. Any suggestions?

    My macbook pro is making strange fan related noises. Sounds as if something is stuck in the fan. First time this has happened since I got my computer. Every time I put it to sleep I wouldn't hear the sound anymore. Any suggestions?

    ... Sounds as if something is stuck in the fan.
    Probably is. They get dusty. Shut down your computer and clean it out with a vacuum (don't blow dust back inside).

  • Last night i was downloading the new update for the Iphone, and after the download was done and trying to install, it errored out.  And now my phone is stuck on the screen with the itunes icon and the USB.

    Last night i was downloading the new update for the Iphone4 on my laptop through Itunes.  After the download was done, it was starting to install, and then an error came up and didnt get a chance to check it.  Now my Iphone is stuck on the screen with the USB pointing to the Itunes Icon and wont do anything else.  Any advice on how to get this fixed, or do i need to go to the Apple store and have them look at it.

    slawdog31 wrote:
    Is the sleep wake button at bottom center of the Iphone or on top?
    Top
    iPhone User Guide

  • I just finished downloading and attempting the install of ios 7 on my iPhone 5.  I'm using the newest version of iTunes.  And now, I'm stuck at the screen with the iTunes logo and the plug.  But no matter what recovery mode wont work

    I just finished downloading and attempting the install of ios 7 on my iPhone 5.  I'm using the newest version of iTunes. 
    And now, I'm stuck at the screen with the iTunes logo and the plug.  But no matter how many times I try, recovery mode will not work.  My phone is currently useless unless I can figure this out.

    No problem, glad to help!
    Update: my PC USB hub was connected to a USB 3 port, I connected the 30 pin cable directly to my PC, And the restore worked just fine. Restored phone from iCloud backup and seems to be working fine.

  • After i updated to the new ios7 my ipad 3 stuck at the window with the terms. I push agree but it is not going on. Please help

    After update to the new ios 7, during the restart my ipad 3 stuck at the window with the terms. I push agree but the window is still there. Please help. Thanks

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try on anoterh computer to help determine if you have an iPod or computer problem.
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
      Apple Retail Store - Genius Bar

  • My iMac is stuck on the desktop with the spinning wheel

    Please help...my iMac is stuck on the desktop with the spinning wheel.

    Press Command-Option-Esc, then select the unresponsive app from the Force Quit window that appears, and click Force Quit.

  • Fell in the mud with my Canon 7D :( Is it ruined???

    Sunk in mud up to my knees yesterday while trying to photograph close to a lake.  I was holding my camera with the lens pointing skyward, but the bottom left side of my camera went into the mud.  Is it ruined?  I have it drying right now hoping the mud will dry and I can brush it off.   

    JMomOhio wrote:
    Thanks for all of the suggestions! I let it dry for a couple of days and then cleaned it with a damp cloth after using a soft toothbrush to get some of the bigger pieces of dried mud/silt. I turned it on and it seems to be working properly, but the dials are a bit stiff. I may send it off to Canon if the dials don't loosen up. Thanks again!!
    Muddy water damage is notoriously corrosive and you should have your camera service ASAP. The dirt granuals in suspension can penetrate hinges and dials leading to premature (read EXPENSIVE) repairs. Better to just bite the bullet and let the Canon staff give it a thorough cleaning.
    Good luck.

  • Just installed moutain lion: picture on lg 23 inch moniter  now stuck  om the right with some  loss of right edge and   occaisional  waving whole display; Please  helppry

    Just imstalled  Mountain Lion on my mac mini. On my LG 23 inch moniter the    picture is stuck on the right and I lose  the right edge. Sometimes the display  truns  actively wavy. Please help. Had NO moniter  problems until Mountain Lion

    Apple computers: Troubleshooting issues with video on internal or external displays

  • My iphone 4 fell off the charger and now it won't turn back on, it's stuck on the screen with the apple icon

    My iphone won't turn back on after it fell off the charger. When I plug it back into the charger, the screen with the apple icon pops up and it buzzes and just keeps repeating the same two steps. What can I do? Help!

    Try these steps: http://support.apple.com/kb/ts3281

  • My macbook will not start up. It gets stuck on the page with the apple and the pinwheel. Can anyone assist?

    My macbook will not start up. It gets stuck on teh opening page with the apple. It was working fine and all of a sudden i cant get it to work. Does anyone know what could be wrong with it? Or, is there a bypass to the start up page?

    You won't lose your files unless something goes very wrong -- which may already have happened. You absolutely must have a backup before you do anything else. If you don't already have one, boot from your installation disc and follow the instructions in this article under "Instructions for backing up to an external hard disk via Disk Utility":
    Mac OS X v10.5, v10.6: How to back up and restore your files

  • My ipad is stuck in the sync with the imac

    My iPad cannot sync with iMac since it seems stuck in a loop on the iMac's  iTunes.

    FORCE IPAD INTO RECOVERY MODE
    1. Turn off iPad
    2. Turn on computer and launch iTunes (make sure you have the latest version of iTune)
    3. Plug USB cable into computer's USB port
    4. Hold Home button down and plug the other end of cable into docking port.
    DO NOT RELEASE BUTTON until you see picture of iTunes and plug
    5. Release Home button.
    ON COMPUTER
    6. iTunes has detected iPad in recovery mode. You must restore this iPad before it can be used with iTunes.
    7. Select "Restore iPad"...
    Note:
    1. Data will be lost if you do not have backup
    2. You must follow step 1 to step 4 VERY CLOSELY.
    3. Repeat the process if necessary.

  • Stuck in the installation with windows using boot camp

    I gave windows 35GB on my HDD. When I came to the part in the installation to chose a place to install windows on, all the places that was showing gaved my the answer "you need to have NTFS". The problem was that none of them had it, not even the 35GB space that I made with boot camp for this.
    I chose to stop it all and started go back in the installation. But when I came to the choosing of languages I clicked on "x", then my computer started restarting itself. It is know I am stuck.
    I manage to get the installation disk out, so now my screen is black and all that is showing is "no bootable device -- insert boot disc and press any key"
    I dont know how to get back to ios.
    Please help me find a way to get back to iOS!

    You must read the Boot Camp directions before charging in, this is clearly covered on Page 7.
    Reboot: at the sound of the chime press and hold the option key. When the startup manager loads select OSX to boot from.
    IOS is for iPads, you want to get back to OSX

  • My ipod 4g is stuck at the battery with a lightning bolt underneath and won't charge

    My iPod died about a month ago, and I waiting. I tried charging it with almost everything I could. I plugged it into the wall, computer, etc..
    To make this easier, my iPod is not jailbroken and the home button fell off and I had a feeling it had to do with the orange chip underneath the home button being loose, but that's not what other people who experienced the same thing as me had.
    I tried pressing the power button, holding the power button. I can't use the home button since it is broken. I always used Assisitive Touch.
    I tried pressing the power button over and over. I left the iPod in each section I charged it at for at least a night, hoping that in the morning it would turn on again.
    Because it won't turn on, my iPod won't register in itunes so I can't restore it or recover it in any way that I know of without using itunes or the home button.
    I eventually gave up on it and recently came back to my iPod, wanting to use it again.
    I would really like to know how to fix it.

    Place the iPod in recovery mode using one of these programs and then try restoring via iTunes:
    For PC
    RecBoot: Easy Way to Put iPhone into Recovery Mode
    If necessary:
    Download QTMLClient.dll & iTunesMobileDevice.dll for RecBoot
    and                                           
    RecBoot tip
    For MAC or PC       
    The Firmware Umbrella - TinyUmbrella
    Last, make an appointment at the Genius Bar of an Apple store.
      Apple Retail Store - Genius Bar

  • My iPod Touch 4th gen is stuck on the screen with the iTunes logo and usb logo and it wont show up in itunes either. How do i fix it?

    I forgot my passcode to my ipod so i went to restore it. When it said if i waned to restore and update that was my only option. So now i clicked that and my ipod will not leave this screen. No matter what i do. I even tried literally every step such as: the DFU mode, reinstalling itunes and the apple mobile device support, hard resetting my ipod and so many things, yet they all dont seem to help. What can i do to fix this ipod.

    If you're unable to do the Restore, go into Recovery Mode per the instructions here.  You WILL lose all of your data (game scores, etc,) but, for the most part, you can redownload apps and music without be charged again.  Also, if you have IOS-7, read this.

  • I tryed to sync my brand new iPod to update it after I had everything setup and the iPod froze up and is stuck on the "Syncing with iTunes" screen and will not update, so now it won't do anything. What do I do?

    This really confuses me

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar       

Maybe you are looking for