What's wrong with MyEJB? please!!

What's wrong with my client code for lookup CMP EJB?
i deployed a simple CMP EJB2.0 on j2ee server.
JNDI Names
Application
component Type Component JNDI Name
EJB StudentEJB myEJB
files.Application.test.Ejb1
General
JAR File Name:ejb-jar-ic.jar JAR Display Name:Ejb1
JNDI Names
EJBs
Component JNDI Name
StudentEJB myEJB
References
Ref.Type Referenced By Reference Name JNDI Name
Resource Ejb1[CMP] jdbc/Cloudscape
javax.naming.NameNotFoundException: No object bound for java:comp/env
at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:116)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at client.testejb.main(testejb.java:14)
testejb.java:
try {
Context ic = new InitialContext();
Context myEnv = (Context)ic.lookup("java:comp/env");
Object objref = myEnv.lookup("MyEJB");
StudentHome home = (StudentHome)PortableRemoteObject.narrow(objref,com.test.StudentHome.class);
Student stu = home.create("123400001111","Satori","Asfar");
Student stu = home.findByPrimaryKey("12340001111");
System.out.println(stu.getFirstName());
} catch (Exception ex) {
ex.printStackTrace();
Could you tell me something about myEJB?
Thanks in advance.

Looks like your JNDI names do not match, you have myEJB
in the description and MyEJB in the lookup. Is this just a typo for the example?

Similar Messages

  • I cant use my areplay it keeps giving me a error occurred loading this content try again latter i would like to find out what is wrong with it please

    i just want to know what s going on with it it worked good when i bought it and it has been only a couple of month that i have had it

    I have the same problem I use a BT home hub the old white one and a iPad 4 if I reboot the hub it works ok for pics and some I player content then when I try to load a certain program it crashes and I need to reboot the hub again. Is this a problem with the hub?

  • Seek and flvPlayback - what's wrong with this please?

    Hi,
    I'm trying to build a player where there's a button that pause the video and then moves the video forward by one second. I am using the following:
    flvPlayback.pause();           
    var newTime = flvPlayback.playheadTime + 1;          
    var currentTime = timeToString(newTime);           
    var endTime = timeToString(flvPlayback.totalTime);         
    progressLabel.text =  currentTime + " / " + endTime;           
    percentLabel.text = Math.round(currentTime/endTime) + "%";           
    flvPlayback.seek(newTime);
    This works for the progressLabel and percentLabel but the video itself does not move to the specified point. Only when I hit play does the video scrub to the right point - can someone help please?

    Thanks for that - but is there anyway to have the player paused instead of playing automatically?
    I tried to use this (where pausePlayback is just a flvPlayback.pause function) but it didn't work:
                flvPlayback.pause();
                var newTime = flvPlayback.playheadTime + 1;
                var currentTime = timeToString(newTime);
                var endTime = timeToString(flvPlayback.totalTime);
                progressLabel.text =  currentTime + " / " + endTime; percentLabel.text = Math.round(currentTime/endTime) + "%";
                flvPlayback.seek(newTime);
                var timer:Timer = new Timer(40, 1);
                timer.addEventListener(TimerEvent.TIMER_COMPLETE, pausePlayback);
                timer.start();
                flvPlayback.play();

  • My macbook pro simply won't turn on. The light is dim when charging! What's wrong with it please?

    Hello there
    My macbook turned off the other day and i havent been able to turn it on since
    When charging it, a faint green light comes on but nothing else
    any help would be much appricated!
    thanks

    The folks at the Genius Bar are very good at Power and other Physical problems like this. Your appointment for an evaluation is FREE, in warranty or out.
    Be sure to bring all the equipment you normally use together -- MacBook, Power Adapter, and external drives and mice, if any.

  • Crop Functio... what is wrong with this code???

    Hi all,
    I have created this method to crop my bufferedimage, but when i call it it does not seem to do anything. :(
    Can anyone see what is wrong with it please?
    Thank you for you help!
    Claire
    x
         public BufferedImage cropImage()
              mBufferedImageCrop = copy(mBufferedImage);
              Graphics grphc = mBufferedImageCrop.getGraphics();
              Rectangle desiredArea = new Rectangle(10,10,10,10);
              BufferedImage sub_bi = mBufferedImageCrop.getSubimage(desiredArea.x, desiredArea.y,
                                                                                 desiredArea.width, desiredArea.height);
              grphc = mBufferedImageCrop.getGraphics();
              grphc.drawImage(sub_bi, desiredArea.x, desiredArea.y, this);
              repaint();
              return sub_bi;
         }I call this method using:
    displayPanel.cropImage();
    displayPanel.validate();
    repaint();Thanx

    I worked out the problem!
    :)

  • What's wrong with the itunes store UAE? i couldnt buy my favorite songs and movies because there's no "music" and "movies" category. please do something... thanks!

    what's wrong with the itunes store UAE? i couldnt buy my favorite songs and movies because there's no "music" and "movies" category. please do something... thanks!

    You are not addressing Apple here...
    This is a User to User forum...
    iTunes Store: Which types of items can I buy in my country?

  • Can someone please tell me what's wrong with the Inside of my iPad Charger? *Picture Included

    It won't charge my iPad. So I wanted to take a good look inside and see what's wrong with it. But I don't know anything about these wires. Here's the Pic of it.
    http://oi39.tinypic.com/2ed5yl2.jpg
    http://oi42.tinypic.com/5btptt.jpg
    http://oi39.tinypic.com/ih8rq1.jpg
    PLEASE HELP. It would be a Big Help

    That's unfortunate, because it would appear that the cable is pretty much toast. If it wasn't before, it pretty much is now that you've cracked it open.
    Either borrow one, or bite the bullet and buy one locally. You're not getting anywhere with that one.

  • My iphone 4 with 4.3.3 upgrade to 5.1.1,it said to me I should active it,I buy a active-card but it say 'Your request couldn't be processed.We're sorry, but there was an error processing your request. Please try again later.'  What's wrong with my iphone

    my iphone 4 with 4.3.3 upgrade to 5.1.1,it said to me I should active it,I buy a active-card but it say 'Your request couldn’t be processed.We’re sorry, but there was an error processing your request. Please try again later.'  What's wrong with my iphone

    It sounds a lot like your phone was jailbroken or hacked to unlock it before you updated.
    Was it?

  • What's wrong with my code? please help....

    when display button is clicked it must diplay the remarks but it didn't happen...
    what's wrong with my code? please help
    here is my code.....
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    public class Area extends Applet implements ItemListener,ActionListener
         {Label arlbl = new Label("AREA");
          Choice archc = new Choice();
          Label extlbl = new Label("EXPENDITURE TYPE");
          CheckboxGroup extchk = new CheckboxGroup();
              Checkbox fchk = new Checkbox("FOOD",extchk,true);
              Checkbox schk = new Checkbox("SHELTER",extchk,false);
              Checkbox echk = new Checkbox("EDUCATION",extchk,false);
              Checkbox uchk = new Checkbox("UTILITIES",extchk,false);
          Label exalbl = new Label("EXPENDITURE AMOUNT");
          TextField exatf = new TextField("",20);
          Label remlbl = new Label("REMARKS");
          TextField remtf = new TextField("",30);
          Button disbtn = new Button("DISPLAY");
          Button resbtn = new Button("RESET");
          String display;
          public void init()
              {add(arlbl);
               archc.add("MANILA");
               archc.add("MAKATI");
               archc.add("QUEZON");
               archc.add("PASAY");
               add(archc);
               archc.addItemListener(this);
               add(extlbl);
               add(fchk);
               fchk.addItemListener(this);
               add(schk);
               schk.addItemListener(this);     
               add(echk);
               echk.addItemListener(this);
               add(uchk);
               uchk.addItemListener(this);
               add(exalbl);
               add(exatf);
               add(remlbl);
               add(remtf);
               add(disbtn);
               disbtn.addActionListener(this);
               add(resbtn);
               resbtn.addActionListener(this);
         public void itemStateChanged(ItemEvent ex)
              {int n = archc.getSelectedIndex();
               if(n==0)
                   {if(fchk.getState())
                         {exatf.setText("10000.00");
                         display = archc.getSelectedItem();
                   if(schk.getState())
                        {exatf.setText("15000.00");
                        display = archc.getSelectedItem();
                   if(echk.getState())
                        {exatf.setText("24000.00");
                        display = archc.getSelectedItem();
                   if(uchk.getState())
                        {exatf.setText("8500.00");
                        display = archc.getSelectedItem();
              if(n==1)
                   {if(fchk.getState())
                        {exatf.setText("5000.00");
                        display = archc.getSelectedItem();
                   if(schk.getState())
                        {exatf.setText("11000.00");
                        display = archc.getSelectedItem();
                   if(echk.getState())
                        {exatf.setText("7500.00");
                        display = archc.getSelectedItem();
                   if(uchk.getState())
                        {exatf.setText("24000.00");
                        display = archc.getSelectedItem();
              if(n==2)
                   {if(fchk.getState())
                        {exatf.setText("13000.00");
                        display = archc.getSelectedItem();
                   if(schk.getState())
                        {exatf.setText("7000.00");
                        display = archc.getSelectedItem();
                   if(echk.getState())
                        {exatf.setText("27000.00");
                        display = archc.getSelectedItem();
                   if(uchk.getState())
                        {exatf.setText("6000.00");
                        display = archc.getSelectedItem();
              if(n==3)
                   {if(fchk.getState())
                        {exatf.setText("6000.00");
                        display = archc.getSelectedItem();
                   if(schk.getState())
                        {exatf.setText("9000.00");
                        display = archc.getSelectedItem();
                   if(echk.getState())
                        {exatf.setText("15000.00");
                        display = archc.getSelectedItem();
                   if(uchk.getState())
                        {exatf.setText("19000.00");
                        display = archc.getSelectedItem();
         public void actionPerformed(ActionEvent e)
              {if(e.getSource() == disbtn)
                    {String amtstr = exatf.getText();
                     int amt = Integer.parseInt(amtstr);
                        {if(amt > 8000)
                             {remtf.setText(display + " IS ABOVE BUDGET");
                        else
                             {remtf.setText(display + " IS BELOW BUDGET");
              if(e.getSource() == resbtn)
                   {archc.select(0);
                   fchk.setState(true);
                   schk.setState(false);
                   echk.setState(false);
                   uchk.setState(false);
                   exatf.setText("");
                   remtf.setText("");
    Edited by: lovely23 on Feb 28, 2009 11:24 PM

    Edit: thanks for cross-posting this question on another forum. I now see that I wasted my time trying to study your code in the java-forums to help you with an answer that had already been answered elsewhere (here). Do you realize that we are volunteers, that our time is as valuable as yours? Apparently not. Cross-post again and many here will not help you again. I know that I won't.

  • HT201401 my iphone screen has got line please tell me what's wrong with my phone

    i have bought recently iphone 5s from apple store but now my iphone screen has got line please tell me what's wrong with my phone

    It is not working cprrectly.
    Take it back.

  • I am getting the error "We're sorry we cannot complete your request on the iTunes store at this time. Please try again later." on both my iPhone and iTunes on my computer. What is wrong with iTunes? Is the server down???

    I am getting the error "We're sorry we cannot complete your request on the iTunes store at this time. Please try again later." on both my iPhone and iTunes on my computer. What is wrong with iTunes? Is the server down or what? I need to download some things and update some apps...

    I've been getting the same message for like an hour now.  Since everything was working fine a few hours ago, and nothing changed on my end before it stopped working, I'm guessing it's something on Apple's end.  They probably already know about it by now, and are hopefully working on fixing it, so there's probably not much we can do but wait for them to fix it.

  • HT4623 hi i have an iphone 4s and has not been a year yet no water damage but there is a white cloudy screen around the edges and will start going crazy with different colors and all someone please gel what is wrong with it?

    hi
    i have an iphone 4s and has not been a year yet no water damage but there is a white cloudy screen around the edges and will start going crazy with different colors and all someone please gel what is wrong with it?

    I switched the usb port and did the whole recovery holding of the buttons ect... And it worked, the computer detected the phone and i was able to click restore. However, the computer says preparing iphone for restore and it is still doing the restarting thing where the apple fades away and then comes back like it is restarting. If i can somehow get past this i will be able to go back to factory settings and resolve my problem, but this is where i am stuck.

  • Can someone tell me what's wrong with this LOV query please?

    This query works fine..
    select FILTER_NAME display_value, FILTER_ID return_value
    from OTMGUI_FILTER where username = 'ADAM'
    But this one..
    select FILTER_NAME display_value, FILTER_ID return_value
    from OTMGUI_FILTER where username = apex_application.g_user
    Gives the following error.
    1 error has occurred
    * LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query.
    Thanks very much,
    -Adam vonNieda

    Ya know, I still don't know what's wrong with this.
    declare
    l_val varchar2(100) := nvl(apex_application.g_user,'ADAM');
    begin
    return 'select filter_name display_value, filter_id return_value
    from otmgui_filter where username = '''|| l_val || '''';
    end;
    Gets the same error as above. All I'm trying to do is create a dropdown LOV which selects based on the apex_application.g_user.
    What am I missing here?
    Thanks,
    -Adam

  • What is wrong with this code? on(release) gotoAndPlay("2")'{'

    Please could someone tell me what is wrong with this code - on(release)
    gotoAndPlay("2")'{'
    this is the error that comes up and i have tried changing it but it is not working
    **Error** Scene=Scene 1, layer=Layer 2, frame=1:Line 2: '{' expected
         gotoAndPlay("2")'{'
    Total ActionScript Errors: 1 Reported Errors: 1
    Thanks

    If you have a frame labelled "2" then it should be:
    on (release) {
        this._parent.gotoAndPlay("2");
    or other wise just the following to go to frame 2:
    on (release) {
         this._parent.gotoAndPlay(2);
    You just had a missing curly bracket...

  • My macbook pro freezes and then displays a blue screen with black stripes... do you know what's wrong with it?

    My macbook pro freezes and then displays a blue screen with black stripes... do you know what's wrong with it?
    I have a two and half year mac book pro... I've had some issues with the screen looking scrambled when I quit certain applications, but now it's turned into something worse.  I'll be working on my computer and the thing will freeze.  When I force restart, the first screen, the apple logo, will be a blue tint and won't boot up normally.  Then I try safe mood and it will then boot just fine.  But there are blue stripes on my screen.  The screen alternates from a blue tint to normal and if the computer freezes again the screen will become completely blue with black stripes.  I haven't tried reinstalling my software because I don't have the startup discs that came with my computer.  If I was sure that would fix it I would purchase them, but if it's a hardware issue I'm afraid that I'm screwed.  I've been able to successfully get the blue off my screen by putting it to sleep and then waking it up, but that's not working well anymore either. 
    Does anyone else have experience with this?  Is it the firmware or what?  I have a MacBook Pro from early 2011 and I'm running Mac OS X 10.6.8.
    Please help... Thanks!

    I just experienced this exact same issue with my early 2011 15" macbook pro. Since like a month after purchasing it I had issues with the screen randomly going dark on me. I sent it in for repair inder waranty they replaced the gpu and logic board but I continued to have the same issues with the screen randomly going black sometimes I would need to reboot it in order to get the screen to go back on but it happened so infrequently and I used the computer for school so disnt find the time to resend it in to apple. Just last night the screen started to display the blue screen with black verticle lines on it. I called apple and explained to them  the issues that had been ongoing since I purchased the laptop but they said because I was now outside of warantee that any repairs at thia point wouldn't be covered. Fml so glad I spent 2200 on this future proof macbook pro what a joke my sister purchased a toshiba laptop for 300 4 years ago and it still running like a champ. I loved my macbook but at the price I paid I expect it to last longer than 2 years before leaving me high and dry. *** apple??

Maybe you are looking for