EJB lookup works in embedded OC4J but not stand-alone

I use JDeveloper 9.0.3.1 to develop a combined web & EJB application. The EJBs are deployed on a 9.0.3 iAS server on a different machine.
The EJB lookup is in a helper class that's called by the servlet. For EJB lookup, I use the class "com.evermind.server.rmi.RMIInitialContextFactory" as described by the OC4J servlet guide (http://download-uk.oracle.com/docs/cd/A97688_10/generic.903/a97680/develop.htm#1003973). So my code looks like this:
Hashtable map = new Hashtable();
map.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
map.put(Context.PROVIDER_URL, "ormi://server:port/app-business");
map.put(Context.SECURITY_PRINCIPAL, "admin");
map.put(Context.SECURITY_CREDENTIALS, "password");
map.put("dedicated.rmicontext", "true");
InitialContext context = new InitialContext(map);
Object thing = context.lookup("MyEjb");
EJBHome feedback = (EJBHome)PortableRemoteObject.narrow(thing, "com.company.ejb.MyEjbHome");
The last insert into the map (map.put("dedicated.rmicontext", "true");) wasn't mentioned neither in the servlet guide nor the EJB one. But without it, I'd always get some "domain is null" error.
Now this code above works flawlessly in the embedded OC4J of JDeveloper. But it always hangs in the "Object thing = context.lookup("MyEjb");" line when executed either in a stand-alone OC4J (the one from JDeveloper launched through the batch file in [JDeveloper directory]\jdev\bin\start_oc4j.bat) or in the OC4J in iAS.
Does anybody know why this happens or how to fix it? I know that there are other ways of EJB lookup in servlets but since we also have plain Java classes for testing purposes that access EJBs, this seemed like the simplest thing to do for both Java classes and servlets.

I was referring to the java client case where this optoin is not required. In general for web clients one doesn't use the rmi initial context to find the bean. This is because the bean and the webclient are both packaged in the same application. One defines the ejb-ref in the web.xml for the bean and then looks it using the default initial context. Something like
Context ctx = new InitialCOntext();
ctx.lookup("bean ejb-ref-name");
However if you must use rmi for accessing the bean from the web client then the dedicated connection property is required.
For java clients you would setup the rmi context environment.
Since you are trying to use a common utility class for both java and webclient I would recommend that you look into packaging the java client as a j2ee application client. Basically in that case you would be able to define a ejb-ref in the aplication-client.xml and use the default initial context in code for both the cases.
Hope that helps
Dhiraj

Similar Messages

  • Commit working in embedded OC4J but not in Application Server 10g

    Hi all
    i am creating an application using Jdeveloper 9051+adf+uix.
    here in a form i have a Create,Delete button and a commit button. after creating or deleting a row , i press commit button and it works fine in embedded OC4J.
    But after deploying this application on Oracle Application Server 10g , create and delete buttons are working (means data in form is getting submitted) but commit button is not working (commit button is enabled but data is not getting commited in the table.) after pressing the commit button the form is coming back to its previous position and the commit button is yet enabled. if i presses it second time then button goes disabled but data is not commited at all.
    Please provide me solution to this problem.
    Thanks

    Hi Brenden
    Thanks for reply
    in the application log file it is showing the following exception-
    08/07/01 16:51:29 mail_utility_app: Servlet error
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.xml.parser.v2.XMLDOMException, msg=cannot add a node belonging
    to a different document
    at oracle.jbo.server.Serializer.passivate(Serializer.java:189)
    at oracle.jbo.server.DBSerializer.passivateRootAM(DBSerializer.java:290)
    at oracle.jbo.server.DBSerializer.passivateRootAM(DBSerializer.java:277)
    at oracle.jbo.server.ApplicationModuleImpl.passivateStateInternal(ApplicationModuleImpl.java:4587)
    at oracle.jbo.server.ApplicationModuleImpl.passivateState(ApplicationModuleImpl.java:4479)
    at oracle.jbo.server.ApplicationModuleImpl.doPoolMessage(ApplicationModuleImpl.java:6818)
    at oracle.jbo.common.ampool.ApplicationPoolImpl.sendPoolMessage(ApplicationPoolImpl.java:3886)
    at oracle.jbo.common.ampool.ApplicationPoolImpl.doManagedCheckin(ApplicationPoolImpl.java:2131)
    at oracle.jbo.common.ampool.ApplicationPoolImpl.releaseApplicationModule(ApplicationPoolImpl.java:1211)
    at oracle.jbo.common.ampool.SessionCookieImpl.releaseApplicationModule(SessionCookieImpl.java:717)
    at oracle.jbo.common.ampool.SessionCookieImpl.releaseApplicationModule(SessionCookieImpl.java:634)
    at oracle.adf.model.bc4j.DCJboDataControl.releaseApplicationModule(DCJboDataControl.java:1340)
    at oracle.adf.model.bc4j.DCJboDataControl.endRequest(DCJboDataControl.java:1198)
    at oracle.adf.model.servlet.ADFBindingFilter.invokeEndRequest(ADFBindingFilter.java:289)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:238)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:224)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:133)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
    i have only one entity and one view object. there is no different document as it is shown in the exception.
    Thanks

  • Ajax functionality works in embedded OC4J, but not on iAS 10.1.2

    Hi,
    For a customer, we made an ADF application using JDeveloper 10.1.2. Using instructions from http://www.oracle.com/technology/pub/articles/vohra-ajax.html we coded a servlet, to find a description from a code the user entered in the application, and show this on the webpage without page refresh (the application uses JSP and Struts). This works fine in the embedded oc4j server JDeveloper provides, and also works fine on the Standalone OC4J server. However, when the application is deployed to the iAS from the customer, everything works fine, except the ajax functionality, the description fields simply are not shown.
    Does anyone have a clue what could be the problem? We also runned the application on the iAS server itself, and this gives the same error (no ajax functionality).
    Thanks in advance,
    Remco

    Hi dvohra,
    Thanks for your reply. I'm afraid I overlooked something, which is the reason of the ajax functionality not working. The Servlet that made the Ajax functionality used a datasource, and the same was in the Embedded OC4J Preferences. The ADF Business Components part was changed to use the datasource declared on the iAS. The Servlet however was not...
    So, all works now.

  • My jsp application works in embedded oc4j, but does not work on standalone

    env OC4J 10.1.3
    here is the error:
    javax.servlet.jsp.JspTagException: java.sql.SQLException: Closed Resultset: next
         at oracle.jsp.dbutil.tagext.dbNextTag.doStartTag(dbNextTag.java:105)
         at index.jspService(_index.java:220)
         [SRC:/mainPage.jspf:57]
         at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.0.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:662)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:370)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)

    Websites remembering you and automatically log you on is stored in a cookie.
    * Create an allow cookie exception (Tools > Options > Privacy > Cookies: Exceptions) to keep such a cookie, especially for secure websites and if cookies expire when Firefox is closed.
    Make sure that you do not run Firefox in Private Browsing mode.
    * https://support.mozilla.com/kb/Private+Browsing
    Do not use Clear Recent History to clear the "Cookies" and the "Site Preferences"
    * https://support.mozilla.com/kb/Clear+Recent+History
    Clearing "Site Preferences" clears all exceptions for cookies, images, pop-up windows, software installation, and passwords.
    See also:
    * http://kb.mozillazine.org/Cookies

  • JDeveloper 10.1.3.1 - injection works partiin embedded OC4J

    Hi,
    there are a few simple examples which do not work under embedded OC4J:
    Example #1:
    public class ContextListener implements ServletContextListener {
    @PersistenceUnit(unitName="myUnitName")
    private EntityManagerFactory emf;
    public ContextListener() {
    System.out.println( "constructor" );
    public void contextInitialized(ServletContextEvent event) {
    System.out.println( "init: emf = " + emf );
    When I run using embedded OC4J (testing servlet) - I see message 'constructor',
    but then hothing happens - no message from contextInitialized(), no response
    from servlet - IE displays 'page not found' message.
    Example 2:
    public class CatalogServlet extends HttpServlet {
    @PersistenceUnit(unitName="myUnitName")
    private EntityManagerFactory emf;
    public CatalogServlet( ) {
    System.out.println( "constructor" );
    public void init() throws ServletException {
    System.out.println( "Servlet init, emf = " + emf );
    Here results are a bit different: I see 'contrustor' message, then exception
    stack trace - and init() method of servlet did not get called.
    Note that:
    1) If instead of injecting EntityManagerFactory I try to inject session facade
    bean (using @EJB) - this works both in listener and in servlet.
    2) Injecting EntityManagerFactory works in my session facade bean,
    using the same @PersistenceUnit(unitName="myUnitName").
    3) Both examples above work well if I deploy application to WAR file
    and then deploy that WAR file to GlassFish application server.
    Is there something wrong with my code, or is there something wrong with
    embedded OC4J? May be some settings for OC4J that I missed?
    Regards, Leonid.

    Hello,
    It is a bug in the way the embedded OC4J is initializing the application.
    You can deploy successfuly deploy/run in the stand alone OC4J, so could you please for this purpose use the standalone version.
    Regards
    Tugdual Grall

  • How do I troubleshoot installation/distribution of a LabVIEW .exe which processes data using Matlab when it works on some computers but not others?

    I've been given the unenviable task of troubleshooting and installing/distributing software written by a former co-worker. I've modified the LabVIEW code and built an .exe file. I've successfully installed the Labview .exe file on several computers, but it won't work on some others. What's more baffling is that I installed it successfully on one computer, uninstalled it, and tried reinstalling it with no success. In fact, it's a new error (Dr. Watson for Windows NT application error). It doesn't help that I have different versions of LabVIEW and Matlab on the target computers. Some have LabVIEW 5.1, some
    have 5.0, and some don't have it at all. Some have Matlab 5.2, some have 5.3 (R11) and some have 6.0 (R12). It's also not clear to me where the Matlab m files should be located. I'm not sure if it's a LabVIEW Runtime Engine problem, or if it's a Matlab problem. I've also wondered how LabVIEW and Matlab talk to each other. When LabVIEW calls Matlab, it seems that Matlab is running in the background. In other words, clicking on the Matlab Command Window and typing "whos" or any other command/variable doesn't work.

    Jay del Rosario wrote:
    >
    > How do I troubleshoot installation/distribution of a LabVIEW .exe
    > which processes data using Matlab when it works on some computers but
    > not others?
    Poke around zone.ni.com and
    http://digital.natinst.com/public.nsf/$$Search/ .
    Good luck, Mark

  • Site works in the app, but not in the browser.

    Hello iWeb experts,
    I've got problems.
    Last night I published my site. And while it appears, and functions, properly in my iWeb app, it doesn't do the same in Safari, Firefox, and Internet Explorer.
    Two issues...
    FONTS
    I chose Bellamie, Univers Condensed, and Marydale as my fonts. From reading these forums, I've discovered those won't wysiwyg on other computers if the fonts aren't available and open on them. So my two choices are to make every bit of text a graphic or to use a set of more universal fonts, correct? So my questions are...One, is there a list somewhere of fonts that will work in any browser? And, two, is there a short-cut, or easy way to transform type into a graphic without having to create image files?
    FUNCTIONS
    Here are the functions that work fine in iWeb but have gone haywire in all of the browsers I tested...
    • The type in one nav link appears smaller than all the rest.
    • Some links are active, others are not.
    • Rollover highlighting works on some links, but not others.
    • Most of the rollover links appear in the proper static color, a few do not.
    I've tested these functions on three Macs, one PC, and in the three browsers mentioned above. All of them show the exact same problems. So something must be going wrong with iWebs coding, or my host server musn't like iWeb.
    Any thoughts, suggestions on these two issues? Thanks much for any advice.
    John
    PS - For reference, see: www.johnrunk.com

    Fascinating, Kirk (+he types with one raised eyebrow+).
    QuickTimeKirk wrote:
    When I drag across your page most of your links do not change. The "text" portion of them doesn't change, either. Something is covering them.
    I can see that. But for the life of me, I don't know what could be covering those links. In my app, when I click in the area of the links, the type is the first item selected. Unless, possibly, it could somehow be the faint reflection of my black-and-white image (me & the ground I stand on). Hmmm...
    QuickTimeKirk wrote:
    Single click (outside the boundaries of your page contents) and an "outline" will appear. It shows the image file dimensions and locations.
    This I don't see. An outline? As in "an object outline," or as in "a list of dimensions and locations?" When I click outside my page contents, I get nothing.
    Thanks, QTK. I truly appreciate your troubleshooting here.
    John

  • Can get the AirPlay to work off my computer, but not my iPhone or iPad. I have the latest software.  Airplay logo never appears on iPhone or iPad.

    Can get the AirPlay to work off my computer, but not my iPhone or iPad. I have the latest software.  Airplay logo never appears on iPhone or iPad.

    Try here  >  http://support.apple.com/kb/TS1538

  • HT5787 How can I change an old email to a new one? For some reason my old email comes up on my iPhone - and I don't get access to change to my new email which I have on my iCloud account on my pc. My AppleID works on my pc, but not on my iPhone!

    How can I change an old email adress on my iCloud accout to my new email (the same as on my pc), as long as my Apple ID works on my pc but not on my iPhone?
    Br
    Finn

    You would have to change it back to your old email address in order to turn off "Find My iPhone" on your devices. After you changed it back to your old address and deactivated "Find My iPhone" (activation lock) you could change your Apple ID to your new address again. Now it should wok on all your devices.

  • LR 5.6 on Mac desktop all of a sudden will not read any card from any reader but will work on my laptop. I can work on previous images but not import new ones. Even if I create a catalog on laptop and import to my desktop on a thumb drive, the images are

    LR 5.6 on Mac desktop all of a sudden will not read any card from any reader but will work on my laptop. I can work on previous images but not import new ones. Even if I create a catalog on laptop and import to my desktop on a thumb drive, the images are only accessible as long as the thumb drive is inserted.

    Sounds like you may need to repair the Disk Permissions on your drive where your images are stored.

  • I have a bluetooth headset that only works in phone feature but not in itunes or apps on my iphone, please help

    I have a bluetooth headset that only works in phone feature but not in itunes or apps on my iphone, please help.
    It works fine through my macbook, can't find anything in settings on iphone to resolve problem

    The headset has to have A2DP capability, which most (I believe) do not.
    http://en.wikipedia.org/wiki/Bluetooth_profile

  • When i burn videos to a dvd-r disc it works on my macbook but not on a windows/pc or my dvd player. How can i make it work on all the above and not just a mac product?

    when i burn videos to a dvd-r disc it works on my macbook but not on a windows/pc or my dvd player. How can i make it work on all the above and not just a mac product?

    Unfortunately, the recording & movie industry does not respect the rights of the people who make them money, and thus you can only use the paid-for content in ways they see fit. Even if I lived in a bunker where no one else could possibly see the movie I paid for, therefor I'm not 'sharing it illegally', I would still not be allowed in a blue moon to copy that movie to DVD for TV viewing. Someone will tell you to get an AppleTV. How about Apple give us one for free? Until this changes, people wanting to use their content in multiple locations will continue to download music & movies via torrents, legally or illegally.

  • I-pod touch works on a Mac but not a PC

    Please help! My I-pod touch works on a Mac but not a PC. When hooked up to a PC, the device is not recognized in I-tunes message, says I-pod in recovery mode and to restore, after checking update and restore, receive unknown error message (9). Have tried unistaling and reinstalling I-tunes, using different USB ports, creating new user, restarting computer, using different PC, and trying to reset by holding sleep/wake and home buttons all to no avail, very, very frustrated, everything is fine on a Mac!!

    I have CA Internet Security Suite Plus 2010, version 6.0.0.264.
    I was wondering about that one in particular.
    Try configuring you CA as per kalda01's instructions in this post:
    http://discussions.apple.com/message.jspa?messageID=10525876#10525876
    (Sometimes switching the security software off doesn't help, but doing the configuration does help. Not sure what's afoot with that, but it has happened with other security-package problems with iTunes in the past.)

  • When I send an email with bcc recipients, the bcc does not show in my sent mail so I can't reference back later who I sent the email to. Worked in Snow Leopard but not in Yosemite. Please advise if their is fix for that.

    When I send an email with bcc recipients, the bcc does not show in my sent mail so I can't reference back later who I sent the email to. Worked in Snow Leopard but not in Yosemite. Please advise if their is fix for that.

    Did you select View->Bcc Address Field from the menu bar?

  • G4 iBook works in Safe Mode, but not in regular mode (stuck on blue screen)

    14" iBook G4 1.2GHz with 1 gig of RAM.
    I recently had an issue with this machine in that the image on the screen would freeze but the cursor would be able to move around. This was narrowed down to an issue with the logic board. I wanted something a little more permanent than a shim, so I sent the board in to have it reballed.
    After installing the maching back into my iBook, it seemed to work fine until I applied a software update to the machine.
    It was then that I got to experience the first of many kernel panics.
    Restarting at different times always brought me to the dialog box which states that the machine needed to be restarted in multiple languages.
    Running the Apple Hardware Test off my install disks yielded this error code: 2ATI/2/4:113-xxxxx-125
    I have no idea what that means. I do know that just before I got the results of the test, the screen changed to all kinds of colors. It was only for a few seconds and then the results (with the error code) were displayed.
    Still, not sure what to do next, I tried resetting the PRAM. I also tried resetting the NVRAM.
    I also tried booting up into Safe Mode which actually worked. There were no issues with the machine and everything seemed to be working fine.
    When I tried to restart the machine in regular mode, I'm taken to the infamous blue screen and the machine just stays there. When I let the machine stay off overnight, it booted up normal, but after applying the software update, the machine was in kernel panic again.
    I've tried running fsck, but nothing changes.
    I'm still not sure why it seems to work in Safe Mode but not in regular mode.
    I'd appreciate any suggestions or ideas.

    Hi,
    A couple of the things that are disabled in safe mode are AirPort and non Apple startup items. The easiest thing for you to test is the AirPort card. Shut down and remove the AE card under the keyboard. See if it starts. If it does your AE card is bad. If not, start in safe mode and go to System Preferences>Accounts>youraccount and disable all non Apple startup (LOgin) items by clicking on them and then the minus sign. Restart normally and see if it will start.
    John

Maybe you are looking for

  • Ni-MAX no longer recognizes NI-5133 or any device if windows goes to sleep

    I am running Labview 8.6 and MAX 4.6.  There are three devices on the system, all using drivers from NI.  They are an Agilent 33220A function generator, NI-5102 scope/digitizer and a NI-5133 scope/digitizer.  The NI-5102 is PCMCIA and th NI-5133 is u

  • Edit in Photoshop TIFF Compression Not Applied

    I'm running LR4.1 on Windows 7 and have my LR 'External Editing' preferences set to 'ZIP' compression. When I 'Save' an 'Edit In' file from inside PS CS6 it does not apply ZIP compression. I verified this by checking the file size, then resaving usin

  • Handling .vol files

    Can someone tell how take input from .vol files ? 

  • Component Portal:portal is down in OAS 9.0.4.1.1

    Hello, i think i know why is down but i don't know how and where can i repair this. Inside the component Portal:portal is almost at the bottom Related link and beside is "Portal End User Default Homepage" which URL show me to http://http//server.doma

  • ITunes stretching videos, changing aspect ratios

    I use Elgato's EyeTV to record TV programmes, and their Turbo264 plug-in to encode for the Apple TV. All the programmes added to my iTunes library are suddenly appearing with the aspect ratio of 1456*576. I am certain that this is an iTunes problem r