JNDI Problem...Confusing...

Hi All,
I am confronted with a puzzling problem...
Environment:
Weblogic 7
JBoss 3.0.4
Solaris 2.8
What I am trying to do:
An MDB running in the Weblogic context (running on machine A)
looks up a Session Bean deployed under JBoss (running on machine B).
This reference (home reference) is stored in a HashMap for re-use,
since JNDI lookups can be expensive. This Home Reference is used
to create a remote reference.
Now, the problem I am running into:
The above mechanism works fine when I first start the WL Server,the
JBoss server, and lookup the Session Bean (this is stored in the
HashMap,
for re-use) using JNDI (see below for code). So long as the JBoss
App Server is up and running, everything works fine.
When I bounce the JBoss App Server, and try to use the SessionBean
Home reference (stored in the HashMap) to create a remote reference,
I get a java.rmi.NoSuchObjectException -- which is understandable,
since the JBoss App Server is bounced.
After I catch the java.rmi.NoSuchObjectException in the MDB, I am
trying to
lookup the Session Bean deployed under Jboss (using the same
piece of code that I used initially to perform the lookup) from
the MDB running in Weblogic context, and all I get is a
'null' object. NO EXCEPTIONS ARE THROWN EITHER. Until I bounce
the Weblogic Server, I am not able to lookup the Session Bean
deployed in JBoss App Server.
What am I doing wrong? Can you please help?
Code that I am using to perform the lookup:
public InitialContext getJBContext() {
Properties props = null;
InitialContext initCtx = null;
try {
props = new Properties();
props.put("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
props.put("java.naming.provider.url", "jnp://<host>:<port>");
initCtx = new InitialContext(props);
} catch (Exception ex) {
e.printStackTrace();
When I use the above obtained InitialContext, and do a
lookup like "Object obj = getJBContext().lookup("invoiceBean");"
the returned Object is 'null'. As I mentioned above, this
happens after I bounce the JBoss App Server, and wouldn't
go away until I bounce the Weblogic App Server as well.
Thanks much,
Srini

Looks like for some reason your Entity Bean didn't deploy properly. Can you please post the deploment descriptors of your EJBs.
Also, you can check on the Server's JNDI tree for your Entity Bean's entry.
Cheers!
Dips

Similar Messages

  • URGENT:Testing deployed OAS EJB Aplication (JNDI Problem)

    Please I need urgently help on this subject matter:
    Environment:
    OAS 4.0.8.2a on NT 4.5 SP5
    Jdeveloper 3.1
    Oracle 8R2
    After succesfull deployment of BC4J aplication on OAS I want simply test it. When I click to test on the appModule on the tree, the dialog asking the connection information appears..I choose OAS option from the drop down box.
    The error message I get is:
    "apps/ejb/ClientesProjectOAS/pkgClientes/PkgClientesModule is not the name of a registered component"
    I have tried with other variants too taking into account what OAS Administration shows..but no luck!
    Now, WHAT SHOULD BE PUT TO THE "JNDI PATH" and "CLIENT JAR PATH" options. This is the most confusing point to me and there are practically no valid/good information on online help.
    Thanx.
    Best regards,
    Ari Supperi
    [email protected]

    I have (almost) the same problem. Any idea? My weak english must be the reason, but I cannot find out what to enter into the JNDI and the Client jar path during testing my OAS deployed AppModule.
    Thx,
    Tib
    null

  • New version of JDev causing JNDI problems

    We just upgraded to the newest Developer Preview of JDEV and all of a sudden client code that compiled and ran fine under the old version is no longer running. I'm guessing something changed in the libraries, but I'm not sure what and why this is occurring.
    Here's what happened:
    1) It seems that the constructor for InitialContext having a parameter for Properties is no longer available. PITA...but whatever, I switched it to use the Hashtable environment which should I figured work. However:
    2) Upon switching to the new environment passage I get an exception:
    javax.naming.CommunicationException with the topmost stacked function being oracle.oc4j.security.KeyExchange.getKeyAgreement.
    I'm guessing that passing the string password into the environment is no longer acceptable?!? WTF!
    So, does anyone have any suggestions to fix this. I'm sure we should be using jndi.properties and all that jazz, but we have tons of client code that works this way and I'm not about to go changing it all unless I really have to.
    edit: I tried a sample piece of code using jndi.properties file and am getting the same exception. Maybe this is a problem between the two libraries (OC4J server & the lib on JDev??) GRRRRRRR!
    Message was edited by:
    [email protected]

    OK...turned out to be the second one. I guess the new JDEV libs aren't compatible with the older server I'm running? I just had to remove all the Jdev libraries from the project and point them to the libs within the server install.
    So...if anyone else runs into this...that's how I fixed it. Sorry I wasted y'alls time and threadspace :D.

  • Crystal Report JRC and JNDI problem

    I need to convert one of our internal web application from using Crystal Report Server 10 RAS to using Crystal Report XI Java Component (JRC). I found several examples from SAP/BusinessObjects but am stuck with a database connectivity problem.
    The basic enviornment info:
    JBoss 4.0.3 SP1
    Crystal Report JRC XI
    Windows XP/Server 2003
    JDK 1.5.x
    MS SQL Server 2005
    The error I am getting is "Error finding JNDI name (xxx)", although the application is already using the same JNDI and was able to display data on the web.
    I added debug code:
                    Context initialContext = null;
                    try {
                        initialContext = new InitialContext();
                        DataSource ds = (DataSource) initialContext.lookup("java:MYAPP");
                        String t = ds.toString();
                        log.debug(t);
                    } catch (NamingException e) {
                        log.error(e);
    I was able to get the data source successfully. The actual report file uses JDBC with JNDI named as "MYAPP". When I call the viewer, it gives
    Error finding JNDI name (MYAPP)
    message.
    Any comment or help would be appreciated.
    Thanks.

    How are you setting your connection info?
    This is what we do:
    IConnectionInfo connectionInfo = new ConnectionInfo();
    PropertyBag propertyBag = new PropertyBag();                    
    propertyBag.put("JNDI Datasource Name", reportJndiName);
    propertyBag.put("Database DLL", DATABASE_DLL); // required!!! (but we don't actually provide a DLL, or even run in windows)
    connectionInfo.setAttributes(propertyBag);
    connectionInfo.setKind(ConnectionInfoKind.SQL);
    ConnectionInfos connectionInfos = databaseController.getConnectionInfos(null);
    IConnectionInfo oldConnectionInfo = connectionInfos.getConnectionInfo(0);
    databaseController.replaceConnection(oldConnectionInfo, connectionInfo, null, DBOptions._useDefault );

  • Color space problem/confusion

    I posted the following message to another thread, but at the recommendation of a member I am starting a new thread here. For a couple of answers see the thread below.
    http://forums.adobe.com/message/3298911#3298911
    I will provide much more information hoping an Adobe support person will chime in. This is extremely odd.
    System: HP, AMD, Windows 7 64-Bit, Nvidia 9100, all updates to Windows, latest Nvidia 9100 driver
    Display: Samsung 226CW, Windows settings 32-bit color, correct resolution,
    Calibration: Done with ColorMunki, D65 target, done after monitor has been on for more than 30 minutes
    Personal:  (I am adding this information with some hesitation, please excuse it if  it sounds like I'm bragging; I am not). I have multiple posts on my  blog, have made many presentations on color managed workflow and am very  comfortable with the settings in Photoshop and Lightroom. Please take  this only as a baseline information, I am not bragging. In fact, I am  begging for information!
    Problem:
    Any, I mean ANY,  original JPEG image in sRGB space coming out of the camera with no  adjustments, any PSD file in sRGB space, any TIFF file in sRGB space  look significantly paler in Lightroom and in Photoshop CS5 than they  look in other Windows based image viewers like FastStone or XnView. This  should not need these applications to be color space aware, but the  situation is the same with or without their color managment turned on or  off. I have done the following:
    1. Totally uninstalled Lightroom 3 and reinstalled it
    2.  Recreated a brand new Lightroom catalog/library and reimported all the  images, converting all the RAW files to DNG (just in case!)
    3. Recalibrated the display
    When  I view a file, any file and I will use for the sake of simplicity a  JPEG file in sRGB color space, in Lightroom it looks pale. Since the  file is in sRGB color space, I have verified this, the rendering in  Lightroom should be the same as rendering in anything else. But it is  not. I took my monitor and connected it to this system with the same odd  behavior of rendering in Lightroom being much paler than outside. It  appears as if I am viewing an image in Adobe RGB in a windows viewer  that is not color managed.
    I further tried the following:
    1.  I copied various versions of one file, all in sRGB color space. One PSD  and two JPEG files from the folders of the above system and copied them  to my system, Intel, Windows 7 64-bit, display calibrated and profiled  with ColorMunki to the same standards as the problem system above.
    2. Imported them to Lightroom on my system
    3.  The rendering in Lightroom is identical to rendering outside Lightroom  for all the files and all are same as the rendering in FastStone on the  problem system. Outside rendering was done using FastStone as on the  problem system.
    My deduction is that something on the  problem system outlined in the opening of the message is interfering  with the Adobe rendering engine and I have no idea what it could be. I  WILL GREATLY APPRECIATE if an Adobe engineer could chime in and steer me  in the right direction. I am willing to try other things but I have run  out of ideas despite the fact that I have reduced much of the problem  to the lowest common denominator of sRGB and JPEG against a PSD in sRGB.
    Waiting anxiously of your help.
    Cemal

    Also, I know enough to calibrate a monitor when it is connected to a new computer. That said, even without calibration the behavior should have changed to display all the images in question the same but perhaps with somewhat off colors. Am I right? I am not arguing the point, I am rhetorically raising the question. If the 226CW is wide gamut and 244T is not, when I connect 244T on the same computer the wide gamut issue should be eliminated, should it not? I am not talking at this point about the "correct" color, but the same color in or out of Lightroom.
    Unfortunately when you connect another monitor to a computer and don't calibrate or manually change it, Windows will not change the monitor profile. Macs will autodetect and change the profile but this innovation has not reached windows yet. The behavior you observe is caused by managed apps using the monitor profile and unmanaged apps not. If the monitor profile is not changed, the behavior doesn't change.
    BTW, for a "cheap" software to be color space aware it does not need a quantum leap in technology I believe. It simply needs to know how to read the ICC profile and the LUT, is that correct?
    It's extremely simple to program color management into apps. Standard API libraries have been available in Windows for over a decade. The reason why this hasn't happened is related to the fact that Microsoft hasn't made IE color managed and the software makers do not want to confuse folks when images look different in their program vs IE. Considering that this still is the biggest issue people wrongly complain about in every color managed application (just check Photoshop fora) that is maybe not that strange.

  • Oracle 8i & JNDI Problem

    I am trying to connect to a remote instance of Oracle 8i. The DataSource object is bound, but when I do a lookup I get a null pointer exception.
    Here's the source code so far:
    public class ConnectionManager {
    private static ConnectionManager instance = null;
    private static String USER_NAME = "dyn3";
    private static String PASSWORD = "dyn3";
    private static String DRIVER_TYPE = "thin";
    private static String DATABASE_SERVER_NAME = "3.87.208.60";
    private static int PORT = 1521;
    private static String DATABASE_NAME = "etest";
    private static int MAX_CONNECTIONS = 500;
    public static final String ORACLE_DATABASE_URL = "@3.45.93.127:1521:";
    public static final String ORACLE_DATABASE_SID = "media6";
    private static String BIND_NAME =
    DATABASE_NAME+"@"+DATABASE_SERVER_NAME+":"+PORT;
    private InitialContext initCtx = null;
    * Loads the Oracle JDBC driver
    * @see oracle.jdbc.driver.OracleDriver
    * @see java.sql.DriverManager
    private ConnectionManager() throws Exception {
    try {
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    createOracleDataSource();
    }catch(Exception s) {
    s.printStackTrace();
    throw s;
    private void createOracleDataSource()
    throws SQLException, NamingException {
    DataSource ods = new DataSource();
    ods.setDriverType(DRIVER_TYPE);
    ods.setServerName(DATABASE_SERVER_NAME);
    ods.setDatabaseName(DATABASE_NAME);
    ods.setPortNumber(PORT);
    ods.setUser(USER_NAME);
    ods.setPassword(PASSWORD);
    ods.setMaxLimit(MAX_CONNECTIONS);
    rebind(ods);
    private void rebind(OracleConnectionCacheImpl ods)
    throws NamingException {
    try {
    File directory = new File("jdbc");
    if ( ! (directory.exists()) ) {
    directory.mkdir();
    System.out.println("url= "+directory.toURL().toString());
    Hashtable env = new Hashtable ();
    env.put (Context.INITIAL_CONTEXT_FACTORY,
    "com.sun.jndi.fscontext.RefFSContextFactory");
    env.put (Context.PROVIDER_URL,
    directory.toURL().toString());
    initCtx = new InitialContext(env);
    System.out.println("Context = "+initCtx);
    System.out.println("BIND_NAME="+BIND_NAME);
    initCtx.rebind(BIND_NAME, ods);
    }catch(NameAlreadyBoundException n) {
    //do nothing - this is OK
    }catch(NamingException ne) {
    ne.printStackTrace();
    throw ne;
    }catch(Exception e) {
    e.printStackTrace();
    * Returns an instance of ConnectionManager
    public static ConnectionManager getInstance() throws Exception {
    if (instance == null) {
    instance = new ConnectionManager();
    return instance;
    * Gets a connection to the database
    public Connection getConnection() throws SQLException, NamingException {
    DataSource pds = (DataSource)initCtx.lookup(BIND_NAME);
    return pds.getConnection();
    Can anyone shed some light on this problem? The Oracle manuals aren't much help.
    Thanks!

    You can use internet just to check if the apache server embedded with your oracle, not to verify oracle itself. Open a prompt in your host and try to access it by sqlplus "/ as sysdba" this should let you connect, then verify listener is up and running, lsnrctl status , this will let you know if you are able to connect, next if you want to access it from outside, install an 8i client on a remote pc and configure connectivity files using netca.
    ~ Madrid

  • FS JNDI problem in PI 7.1

    Hi,
    We configured File Based JNDI 1.1.2 in SAP PI 7.0 and it was working fine. But recently we upgraded this to PI 7.1 from then its not working any more.
    In communication channels i could see some error like
    Error connecting due to missing class: com.sun.jndi.fscontext.RefFSContextFactory. Ensure that all resources required are present in the JMS provider library: aii_af_jmsproviderlib.sda
    we have deployed all the necessary libraries. But still we are getting this error.
    Any ideas what's happing here? Pleas  help me out.
    Best Regards,
    Prasad Babu.

    Hi Stefan,
    actually its the problem with the descriptor file. After fixing it i was able to deploy it on the server. Now i configured PI 7.1 JMS communication channel with the module i created and deployed. In communication channel i am getting i am below exception.
    Message processing failed. Cause: javax.ejb.TransactionRolledbackLocalException: Exception raised from invocation of public com.sap.aii.af.lib.mp.module.ModuleData com.Demo.JMSadapterModuleBean.process(com.sap.aii.af.lib.mp.module.ModuleContext,com.sap.aii.af.lib.mp.module.ModuleData) throws com.sap.aii.af.lib.mp.module.ModuleException method on bean instance com.Demo.JMSadapterModuleBean@63120b10 for bean sap.com/DemoJMSEARxml|DemoJMSEJB.jarxml|JMSadapterModuleBean; nested exception is: java.lang.NullPointerException; nested exception is: javax.ejb.EJBException: Exception raised from invocation of public com.sap.aii.af.lib.mp.module.ModuleData com.Demo.JMSadapterModuleBean.process(com.sap.aii.af.lib.mp.module.ModuleContext,com.sap.aii.af.lib.mp.module.ModuleData) throws com.sap.aii.af.lib.mp.module.ModuleException method on bean instance com.Demo.JMSadapterModuleBean@63120b10 for bean sap.com/DemoJMSEARxml|DemoJMSEJB.jarxml|JMSadapterModuleBean; nested exception is: java.lang.NullPointerException; nested exception is: javax.ejb.EJBTransactionRolledbackException: Exception raised from invocation of public com.sap.aii.af.lib.mp.module.ModuleData com.Demo.JMSadapterModuleBean.process(com.sap.aii.af.lib.mp.module.ModuleContext,com.sap.aii.af.lib.mp.module.ModuleData) throws com.sap.aii.af.lib.mp.module.ModuleException method on bean instance com.Demo.JMSadapterModuleBean@63120b10 for bean sap.com/DemoJMSEARxml|DemoJMSEJB.jarxml|JMSadapterModuleBean; nested exception is: java.lang.NullPointerException; nested exception is: javax.ejb.EJBException: Exception raised from invocation of public com.sap.aii.af.lib.mp.module.ModuleData com.Demo.JMSadapterModuleBean.process(com.sap.aii.af.lib.mp.module.ModuleContext,com.sap.aii.af.lib.mp.module.ModuleData) throws com.sap.aii.af.lib.mp.module.ModuleException method on bean instance com.Demo.JMSadapterModuleBean@63120b10 for bean sap.com/DemoJMSEARxml|DemoJMSEJB.jarxml|JMSadapterModuleBean; nested exception is: java.lang.NullPointerException
    Any idea on what could be the problem?
    Am i missing something here. Do i need to adjust any libraries on server?
    Thanks for your help.
    Best Regards,
    Prasad Babu.

  • JNDI problems in OC4J

    Hi,
    I'm running OC4J integrated with the SOA Suite 10.1.3.3.
    I have a legacy web service created with XFire and deployed in OC4J, lets call it HelloWorldService. I would like to bind a POJO object from within this service with JNDI.
    I would then like to lookup this object from another web service which is a EJB3 session bean, deployed in the same OC4J instance. Lets call it LookupBean.
    I can see in the JNDI browser that the POJO is bound under the HelloWorldService. But when i try to lookup the POJO i get an error saying that the POJO cannot be found.
    This is how i bind the POJO from HelloWorldService
    Context initialContext = new InitialContext();
    initialContext.bind("HelloWorldServicePOJO", obj);
    This is how i try to do the lookup from LookupBean:
    Hashtable env = new Hashtable();
    env.put("java.naming.factory.initial",
    "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put("java.naming.provider.url","ormi://localhost:12401/HelloWorldService");
    //env.put("java.naming.provider.url","opmn:ormi://localhost:6003:home/HelloWorldService");
    env.put("java.naming.security.principal","oc4jadmin");
    env.put("java.naming.security.credentials","oc4jadmin");
    Context context = new InitialContext(env);
    POJO obj = (POJO) context.lookup("HelloWorldServicePOJO");
    I have tried also with the out commented line above, but it does not work. What can be wrong?
    Thanks,
    Mattias

    Hi,
    thanks for the link, but I already knew it and read a lot in it. I still don't get what exactly is going wrong. I replaced the jgroups-core.jar by my jgroups-jar which results in the same exception. It also seems that somehow the commons-logging.jar-classes from /webservices is being loaded even though it's not in the classpath of my application. I noticed this when I replaced every commons-logging.jar by the commons-logging-api.jar from JCL 1.0.4 (which we use in our application) since my EJBs could not be loaded then due to the following problem:
    06/08/04 15:34:42 oracle.oc4j.admin.internal.DeployerException: java.lang.InstantiationException: Error initializing ejb-modules: [cms-core:pbb-jms-receiver-1.0:Importer_Topic] - Unable to load ejb-class com.pironet.pbng.jms.mdb.asynchron.ImporterTopicSubscriber, see section 23.2 of the EJB 2.1 specificationjava.lang.ExceptionInInitializerError
    06/08/04 15:34:42 at oracle.oc4j.admin.internal.ApplicationDeployer.addApplication(ApplicationDeployer.java:510)
    06/08/04 15:34:42 Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Category
    06/08/04 15:34:42 at java.lang.Class.getDeclaredConstructors0(Native Method)
    06/08/04 15:34:42 at java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)
    06/08/04 15:34:42 at java.lang.Class.getConstructor0(Class.java:2640)
    06/08/04 15:34:42 at java.lang.Class.getConstructor(Class.java:1629)
    06/08/04 15:34:42 at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:410)
    06/08/04 15:34:42 ... 27 more
    It seems like the initialization of the jchannel happens, even though it's being initialized in my application, in one of the classloaders which don't have access to my libs...and I'm definitely not going to add all my jars into locations the root-classloader (or whoever) has access to.

  • Jndi problem

    Hi,
    I have to write a simple application that uses jndi to get a jdbc connection.
    I'll try to explain step by step everything what I did. I used Tomcat 5.5.12, SQL Server 2000.
    1. I created a simple web app "jndi" and next I put the jdbc lib to the WEB-INF/lib
    2. I added
    <Context docBase="jndi" path="/jndi" reloadable="true" source="org.eclipse.jst.j2ee.server:jndi">
    <Resource name="jndi/cimmarron_com" auth="Container" type="javax.sql.DataSource"
    maxActive="100" maxIdle="30" maxWait="10000" username="xxx" password="xxx"
    driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
    url="jdbc:microsoft:sqlserver://localhost:1433;databaseName=db1;password=hib1"/>
    </Context>
    to server.xml . The preceding xml code is between <host> tag
    3. My web.xml file in WEB-INF/ looks:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlnssi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>
    jndi</display-name>
    <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>
    <resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jndi/cimarron_com</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>
    4. At the end, I wrote the simple Main.java :
    package test;
    import javax.naming.*;
    import java.sql.*;
    import javax.sql.DataSource;
    public class Main {
    * @param args
    public static void main(String[] args) throws SQLException,NamingException{
    Context ctx = new InitialContext();
    DataSource source = (DataSource) ctx.lookup("java:comp/env/jdbc/cimarron_com");
    Connection conn = source.getConnection();
    Problems:
    I've got the exception like this:
    Exception in thread "main" javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
    at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
    at javax.naming.InitialContext.lookup(InitialContext.java:351)
    at test.Main.main(Main.java:12)
    and I have web.xml warning "CHKJ4019W: Invalid res-sharing-scope; valid values are "Shareable" or "Unshareable"
    I really don't know where is the problem, I've looked for helping in google for 2 days and I still don't know

    Tourang,
    I have only two suggestions for you (but no answers -- sorry).
    1. Try the JDeveloper and ADF forum.
    2. For your information, "JDeveloper" has an embedded OC4J server. Are you deploying to a different OC4J (_not_ the embedded one) and trying to run your application from the embedded one?
    Good Luck,
    Avi.

  • Crazy JNDI Problem... (Third Party DB Driver Effects Lookup???) (OAS 10g)

    Ok folks, I need some help here...
    The scenario is this...
    I have a simple web app (one jsp) which is used as a "status checker" to ensure that all the session beans we expected to be deployed are actually deployed and that they can be looked up with JNDI and run some small status routine... That war file for that app is included in the ear file with all of the session ejb jar deployments...
    Now, the collection of session beans references three different datasources at one time or another... 2 of which are oracle databases and 1 is a DB2 database...
    Lets name them as follows...
    OracleDataSource1
    OracleDataSource2
    DB2DataSource
    Now, if I configure the three datasources in the oracle standalone OC4J 10g datasource file and deploy the ear file to standalone OC4J 10g, all of the lookups work, and it successfully uses the datasources... no problems at all...
    Ok, so now I try to deploy the ear on OAS 10g using the enterprise manager console, and deployment works fine...
    If I run the app before configuring the datasources, of course the lookups work, but the status routines of certains beans fail because they are not able to look up the datasources... no big deal, just start adding the datasources...
    I configure OracleDataSource1 and rerun... now things still work, the lookups for all the beans works fine, and some pass now, but others still want the other datasources...
    Now configure OracleDataSource2 and rerun... as before, things all work great but there are still complaints looking for the DB2DataSource from a couple of the routines...
    Herein lies the problem...
    I configure DB2DataSource and rerun, and boom, my program crashes claiming that the lookup of the bean failed...
    Now mind you, these beans have all been looked up numerous times during previous runs, and absolutely nothing has been changed with the application... in fact, even the beans that wanted the DB2DataSource were looked up successfully and then just complained of no datasource during their status routine execution...
    It's just that once I configure the DB2DataSource, all of a sudden my lookups don't work... I have tried commenting out a couple of the beans, and regardless of which lookups are commented out, it still fails saying it can't find any of the beans, even if the beans i'm trying to look up don't use the DB2DataSource, it doesn't seem to matter...
    The InitialContext used for the lookup uses the default "new InitialContext()" constructor and the lookups work fine when the DB2DataSource is not configured, but once it is, the lookups fail saying the objects are not found...
    I have consulted with a few other developers here, and noone can seem to understand why this behavior is happening... I have added debugging statements to print the contents of the context's environment, and it is always empty regardless of whether the lookups pass or fail...
    The ONLY difference I can see with this DB2DataSource is that it uses an external 3rd party driver... The oracle connections use a driver which was packaged with the OAS installation... I feel pretty strongly that it has to do with the driver because if I have the DB2DataSource configured (causing the failure) and then I edit that datasource to say that it should us the oracle driver, miraculously it causes the lookups to work again, except now I get the error saying the oracle driver doesn't like my DB2 jdbc url...
    I'm sorry for the long post, but I'm hoping that at least one person has encountered this before... I cannot think of any reason why the configuration of that datasource with the third party driver would cause these problems, especially when the exact same configuration and setup DOES work with standalone OC4J 10g, even with the DB2DataSource configured... ????? And the fact that the lookups work fine until that datasource is configured really blows my mind... i wouldn't think the datasource configuration should have anything to do with whether the lookups of the session beans succeed or not... hahaha...
    Any help would be great... I'm pullin my hair out here... :)
    Thanks,
    -Garrett

    No, I have not asked on the oracle forums yet... :)
    It seems that the cause is the driver itself... if I set a different driver for the datasource configuation, the lookups work but it just complains about the driver not being correct for the individual beans...
    I have found some documentation claiming that there is an OAS version of the DB2 driver, as well as a Merant version, but I can't seem to find jar files for either...
    Does anyone know where I can download the "YMdb2.jar" file? Supposedly this contains the DB2 DataDirect driver that I need...
    Thanks,
    -Garrett

  • JNDI problem with Sun Application Server

    I am trying to call a extremely simple EJB from a remote computer. But everytime I run the client I get a Class castException. I have used Weblogic and Jboss in the past and I never had any problem with JNDI. I included all the files except for the descriptor. Please help, this is driving me nut.
    Here is the exception i get:
    java.lang.ClassCastException
    at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
    at clients.testEjbTest.main(testEjbTest.java:42)
    The remote Interface :
    package ejb.test;
    import javax.ejb.*;
    public interface Test extends javax.ejb.EJBObject{
    public String getResult() throws java.rmi.RemoteException;
    The Home interface is:
    package ejb.test;
    import javax.ejb.*;
    public interface TestHome extends javax.ejb.EJBHome{
    public Test create() throws java.rmi.RemoteException, CreateException;
    The Bean is:
    package ejb.test;
    import javax.ejb.*;
    public class TestBean implements javax.ejb.SessionBean {
    public TestBean() {}
    public String getResult() { return "hello";}
    public void ejbActivate() {  }
    public void ejbPassivate() {  }
    public void ejbRemove() {  }
    public void ejbCreate() throws CreateException {  }
    public void setSessionContext(javax.ejb.SessionContext sessionContext) { }
    The client is:
    public class testEjbTest {
    public testEjbTest() { }
    public static void main(String[] args) {
    try{
    Properties env = new Properties();
    env.setProperty("java.naming.factory.initial", "com.sun.jndi.cosnaming.CNCtxFactory" );
    env.setProperty("java.naming.provider.url", "iiop://192.168.0.102:3700");
    InitialContext ic = new InitialContext(env);
    Object objref = ic.lookup("TestBean");
    Object tt = PortableRemoteObject.narrow(objref, ejb.test.TestHome.class);
    }catch(Exception e){e.printStackTrace();}

    Hi,
    I am new to this Forum.
    I have an application running on Weblogic.
    I want to shift to using SunOne as the Webserver and weblogic as application server.
    But when I deploy the application I am getting this ClassCastException
    at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow.
    java.lang.ClassCastException
         at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
         at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
         at com.elsevier.portal.admin.web.proxy.LoginProxy.getLoginSession(LoginProxy.java:156)
         at com.elsevier.portal.admin.web.proxy.LoginProxy.authenticateUser(LoginProxy.java:48)
        at com.elsevier.portal.admin.web.actions.LoginAction.login(LoginActi
    on.java:201)
         at com.elsevier.portal.admin.web.actions.LoginAction.execute(LoginAction.java:80)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java
    :1482)
          at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:
    525)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:807)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
         at org.apache.catalina.core.StandardWrapperValve.invokeServletServic
    e(StandardWrapperValve.java:771)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:322)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
    warning: CORE3283: stderr: at org.apache.catalina.core.StandardHostValve.invoke(StandardHostVal
    ve.java:209)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:161)The code snippet is as follows�.
    protected LoginSession getLoginSession() throws ApplicationException {
    LoginSessionHome home = null;
    LoginSession object = null;
    try {
    home = (LoginSessionHome) (PortableRemoteObject.narrow(ProxyUtil.getEJBHome(getProperties().getProperty(DataCoreConstants.LOGIN_JNDI_NAME),getProperties()),LoginSessionHome.class));
    object = home.create();
    catch(ClassCastException cse){
    cse.printStackTrace();
    logger.error("Class Cast Exception is thrown while casting the Object to                      LoginSessionHome");
    logger.error(cse);
    throw new ApplicationException(ExceptionConstants.CLASS_CAST_EXCEPTION);
    return object;
    }Same method is running on weblogic without any problem�
    Help needed urgently.
    Regards,
    Neha.

  • J2EE RI and MySQL, JNDI problems

    Hi.
    I am trying to write a simple J2EE application that would use Entety EJB with bean persisatance. I have downloaded driver from the www.mysql.org, copied it to the lib/system directory and modified J2EE_CLASSPATH in bin/userconfig.bat. I am using reference implementation server and with deploytool in �tools/serverconfiguration/datasourses/standard� I am specifying driver: org.gjt.mm.mysql.Driver or com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource and in datasourses in JNDI Name I write �jdbc/mydb� and in JDBC URL �jdbc:mysql://localhost:3306/this�, problem comes up when I try to reference �jdbc/mydb� from an entity bean, during deployment process of application it says that it is not bound
    Binding name:`java:comp/env/jdbc\persondb`
    Warning: Reference reference java:comp/env/jdbc\persondb is using a JNDI name that is not bound: jdbc\mydb
    I do not get it, what I am doing wrong? Please help me to find out how to bind a JNDI name to MySQL

    Ive been playing with the J2EE RI server for a bit now..
    and dispite documentation to the contrary the latest RI DOES NOT use standard naming conventions when referencing jndi resources.
    ie:
    so if you trying to get : java:com/env/jdbc/persondb
    then try accessing it by
    jdbc/persondb
    omit the java:com/env/

  • Websphere 6: JNDI problem with Sping - urgent.

    Hi,
    I have my cJSC project working fine with JNDI on my local sun app server. However when deploying to websphere I am getting problems.
    Obviously websphere is different setup and I have had to add the following to the web.xml to get a datasource
    <resource-ref>
         <description>VMS Datasource</description>
         <res-ref-name>jdbc/VMSDS</res-ref-name>
         <res-type>javax.sql.DataSource</res-type>
         <res-auth>Container</res-auth>
    </resource-ref>
    However, the app is still bombing out with following..
    Error page exception
    The server cannot use the error page specified for your application to handle the Original Exception printed below. Please see the Error Page Exception below for a description of the problem with the specified error page.
    Original Exception:
    Error Message: SRVE0207E: Uncaught initialization exception thrown by servlet
    Error Code: 500
    Target Servlet: Faces Servlet
    Error Stack:
    java.lang.NullPointerException
    at javax.faces.webapp.FacesServlet.init(FacesServlet.java:144)
    at com.ibm.ws.cache.servlet.ServletWrapper.init(ServletWrapper.java:231)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:274)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:480)
    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2954)
    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:221)
    at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:210)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1912)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:84)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:472)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:411)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:288)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:207)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:109)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:619)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
    Error Page Exception:
    Error Message: Cannot find FacesContext
    Error Code: 0
    Target Servlet: null
    Error Stack:
    javax.servlet.jsp.JspException: Cannot find FacesContext
    at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:405)
    at com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:105)
    at com.ibm._jsp._ErrorPage._jspx_meth_f_view_0(_ErrorPage.java:330)
    at com.ibm._jsp._ErrorPage._jspService(_ErrorPage.java:63)
    at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:88)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.ibm.ws.cache.servlet.ServletWrapper.serviceProxied(ServletWrapper.java:264)
    at com.ibm.ws.cache.servlet.CacheHook.handleFragment(CacheHook.java:344)
    at com.ibm.ws.cache.servlet.CacheHook.handleServlet(CacheHook.java:216)
    at com.ibm.ws.cache.servlet.ServletWrapper.service(ServletWrapper.java:246)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1282)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1239)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:113)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:82)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:670)
    at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:117)
    at com.ibm.ws.jsp.webcontainerext.JSPExtensionServletWrapper.handleRequest(JSPExtensionServletWrapper.java:178)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:294)
    at com.ibm.ws.webcontainer.webapp.WebApp.sendError(WebApp.java:2593)
    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2983)
    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:221)
    at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:210)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1912)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:84)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:472)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:411)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:288)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:207)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:109)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:619)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
    Anybody used JSC and Websphere with JNDI? I go live next week and don't want to have to configure a context file each time for production.
    Regards,
    LOTI

    Is the resource ref the same as you configured for the bundled
    Sun App server ?
    We do have a sample JNDI application and tip if they help:
    http://developers.sun.com/prodtech/javatools/jscreator/reference/code/sampleapps/2/JaasAuthentication.zip
    (see the README file in the zip file)
    http://developers.sun.com/prodtech/javatools/jscreator/reference/tips/2/jaas_authentication.html
    John

  • 10G JNDI problems

    I migrated from 9.0.3 to 9.0.4 and now have the following problem. I am using the local OC4J instance. I am attempting to get the connection to the database using the following code:
    try
    Context ctxt = new InitialContext();
    DataSource ds = (DataSource PortableRemoteObject.narrow(ctxt.lookup("jdbc/RVDS"), DataSource.class);
    con = ds.getConnection();
    catch (Exception ex)
    ex.printStackTrace();
    The stack trace is as follows:
    04/04/05 12:46:36 javax.naming.NamingException: com.evermind.server.ApplicationInitialContextFactory should only be used inside Orion server environments. For client com.evermind.server.ApplicationClientInitialContextFactory or com.evermind.server.rmi.RMIInitialContextFactory should be used
    04/04/05 12:46:36      at com.evermind.server.PreemptiveApplicationContext.getContext(PreemptiveApplicationContext.java:31)
    04/04/05 12:46:36      at com.evermind.naming.FilterContext.lookup(FilterContext.java:138)
    04/04/05 12:46:36      at javax.naming.InitialContext.lookup(InitialContext.java:347)
    04/04/05 12:46:36      at MVRInit.jspService(MVRInit.jsp:35)
    04/04/05 12:46:36      at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:139)
    ...MORE...
    This was working just fine in 9.0.3, Any ideas what is happening?

    Kevin -- I'm not sure why it's not working anymore. What you have there looks kind of funky -- you're doing a remote cast on a local object. The stacktrace is telling you that it's not a supported operation -- when you just construct an InitialContext with no parameters, it gives you ApplicationInitialContextFactory, which doesn't support this remote lookup and casting
    If you want to get a datasource from JNDI from a servlet/ejb running in the local OC4J container, then it's actually a little bit easier to do. There's no need to do the PortableRemoteObject.narrow(string,class).
    If you had a datasource defined with a location of "jdbc/RVDS", and assuming you don't want to do the fully abstract resource-ref-mapping, then you should be able to get the datasource just by doing a lookup of the initialcontext.
    try
      InitialContext ic = new InitialContext();
      DataSource ds = (DataSource)ic.lookup("jdbc/RVDS");
      Connection con = ds.getConnection();
    If you were running on a remote node (ie application client) and wanted to get a DS from an OC4J instance, then you'd need to use the ApplicationClientInitialContextFactory and specify a corresponding resource ref entry in the deployment descriptor and then look that up.
    hope that helps
    -steve-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • UserManagement JNDI Problem: objectClass: account

    Hello,
    i'm using JNDI to develop a usermanagement on an OpenLDAP Server.
    I only use the standard LDAP schemes (core;cosine;inetorg).
    here is a LDIF that works with ldapadd
    dn: ou=max,cn=Entwicklung,ou=roles,dc=ecs,dc=com
    ou: max,
    uid: maxLogin
    userPassword: maxLoginPW
    description: whatever u what
    objectClass: top
    # objectClass: account--> uid attribute; description attribute
    objectClass: account
    # objectClass: simpleSecurityObject --> userPassword attribute
    objectClass: simpleSecurityObject
    Everything works fine except:
    When I try to bind an context containing the mentioned attributes, JNDI does not seem to know the ACCOUNT object class (from cosine scheme)
    and throws an exception.
    SchemaViolationException: [LDAP: error code 65 - no structural object class provided]
    ACCOUNT is a structural class.
    if i add objectClass: organizationalUnit for workarround, following exception is thrown:
    [LDAP: error code 65 - attribute 'uid' not allowed]
    another hint that[b] JNDI does not know objectclass ACCOUNT and cosine.scheme respectively.
    How can i import the cosine scheme into JDNI?
    regards
    SPN

    I solved the problem.
    Thanks 4 reading :)

Maybe you are looking for