Validating Cached Home Object

We cache the home objects to save on jndi lookups. But if the home
object belongs to a different application (something.ear), and
something.ear gets redeployed, the cached home object is no longer
valid.
Was wondering if there's a way to validate the cached home object.

Refer to
http://dataml.net/articles/ValidateXMLSchema/part1.htm

Similar Messages

  • Caching a Home object

    Reading a book that has an example with a DTOFactory creating a DTO based on information in an entity bean.
    The first step in the DTOFactory's DTO creation method is the JNDI lookup of a Home object (of the entity bean from which it will make a DTO).
    It says next to the JNDI lookup that "[t]his could be cached to avoid the expense of future lookups".
    Is it referring to the Home object returned from the lookup as being cached? How would caching a Home object be implemented?
    (I'm not too familiar with caching...would this mean just putting it in an member variable and doing a check to see if it's the first time the JNDI lookup is being requested? ... If not the first time, then skip the lookup and return the stored member variable value?)
    Thanks.

    (I'm not too familiar with caching...would this mean just putting it in an member variable and doing a check to see if it's the first time the JNDI lookup is being requested? ... If not the first time, then skip the lookup and return the stored member variable value?)Yes, it often looks something like
    static XYZRemoteHome xyzHome;
    public static synchonized XYZRemoteHome getXYZHome() {
       if (xyzHome == null) {
           ctx = getInitialContext();
           xyzHome = (XYZRemoteHome) PortableRemoteObject.narrow(ctx.lookup("XYZRemoteHome"), XYZRemoteHome.class);
       return xyzHome;
    }

  • EJB Home Objects and Stubs

    Hi,
    Can anyone pls tell me,what are the objects are created in Server after the Deployment of EJB.
    Is the EJB Home Object,EJB Home Object Stub,EJB Home Object Skeleton, EJB Local Home Object, EJB LocalHome Object Stub,Ejb LocalHome Object Skeleton.And Finally both the Stub objects and Skeleton Objects will be stored in the Jndi Registry ?
    Thanks in Advance,
    Venkat

    Nic,
    Caching the home object is a comon practice.
    Take a look here:
    http://www.theserverside.com/resources/patterns_review.jsp
    Look at the EJB Home Factory Pattern.
    Regards,
    -Dat

  • Validation on View Objects

    Cab we set validation on View Objects to override the validations on underlying entity objects?

    Hi Arun,
    I m using Oracle Fusion Middleware (Jdeveloper ) version 11.1.2.0.0.
    Currently i m very begginer to Oracle ADF and for my knowledge purpose i want to know whether we can write validation on view objects declaratively not programatically to override the entity objects level validation.
    The link u specified contains information related to the validation on view objects programatically not declaratively.
    Using the version that i mentioned, i m not able to create validation on view objects declarativley...

  • The method getBean() is not valid for metadata object /ex/model/remittance/client/common/bc4j.xcfg

    Hi,
    I am getting bellow error when i am running my application. I am using JDeveloper 11.1.2.3
    <Nov 6, 2013 9:52:57 AM AST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY>
    <Nov 6, 2013 9:52:57 AM AST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
    <BC4JConfigLifeCycleCallBack> <contextInitialized> MDS-01702: The method getBean() is not valid for metadata object /ex/model/remittance/client/common/bc4j.xcfg - it is allowed on only bean metadata objects.
    oracle.mds.exception.MDSRuntimeException: MDS-01702: The method getBean() is not valid for metadata object /ex/model/remittance/client/common/bc4j.xcfg - it is allowed on only bean metadata objects.
      at oracle.mds.core.MetadataObject.getBean(MetadataObject.java:327)
      at oracle.adf.share.jndi.MDSBackingStore.getMOBean(MDSBackingStore.java:558)
      at oracle.bc4j.mbean.RuntimeMXBeanImpl.init(RuntimeMXBeanImpl.java:120)
      at oracle.bc4j.mbean.RuntimeMXBeanImpl.<init>(RuntimeMXBeanImpl.java:110)
      at oracle.bc4j.mbean.RuntimeMXBeanImpl.<init>(RuntimeMXBeanImpl.java:101)
      at oracle.bc4j.mbean.BC4JConfigLifeCycleCallBack.contextInitialized(BC4JConfigLifeCycleCallBack.java:114)
      at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
      at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
      at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1872)
      at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153)
      at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508)
      at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
      at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
      at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
      at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
      at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
      at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
      at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
      at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
      at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:636)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
      at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:205)
      at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:58)
      at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
      at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
      at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184)
      at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:361)
      at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
      at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)
      at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
      at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
      at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
      at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
      at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:180)
      at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:96)
      at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    <Nov 6, 2013 9:53:11 AM AST> <Notice> <LoggingService> <BEA-320400> <The log file C:\Users\maroof\AppData\Roaming\JDeveloper\system11.1.2.3.39.62.76.1\DefaultDomain\servers\DefaultServer\logs\DefaultDomain.log will be rotated. Reop
    I seen oracle docs solution
    MDS-01702: The method getBean() is not valid for metadata object {0} - it is allowed on only bean metadata objects.
    Cause: An attempt was made to access the metadata object using the bean API but the metadata object was not a bean metadata object. The schema for the root element may not have been registered with MDS, or the beans were not available on the classpath.
    Action: Regenerate the beans from the schema definitions and ensure that the correct versions are on the classpath. Check that the schemas are registered with the MDS instance.
    Level: 1
    Type: ERROR
    Impact: Configuration
    But i am not getting what i do in my application for removing this error.
    Maroof

    Do you use MDS in your application?
    It's possible that you see a leftover of an earlier deployment.
    Do you get the same error if you only start the integrated server (application server navigator->integrated server->debug or run)?
    IF you don't get it when you only start the server without running your application, the problem is somewhere in your app. If you get the error it's probably an old deployment or a configuration error of your server. In this case stop jdev, rename the DefaultDomain folder C:\Users\maroof\AppData\Roaming\JDeveloper\system11.1.2.3.39.62.76.1\DefaultDomain tp C:\Users\maroof\AppData\Roaming\JDeveloper\system11.1.2.3.39.62.76.1\xxxDefaultDomain and start jdev again. Then use hte application server navigator to create a new integrated server (you should see this option as the DefaultDomain folder is not present) and once the new integrated server is created test again.
    Timo

  • Declarative validation on view objects

    Is it possible to set declarative validation on view objects(which override validation in underlying entity objects)?

    [Duplicate post|https://forums.oracle.com/forums/thread.jspa?threadID=2325821&tstart=0]

  • 10g XE - 404 error when I click on Home Object Browser (in IE)

    Greetings
    I use 10g XE with my xp/sp3 system, with IE7 (initially IE8RC1-also problematic).
    The problem is that if I click on Home>Object Browser
    I always get a "HTTP 404 Not Found"/The "Webpage cannot be found" error message
    I've followed the instructions from htp://download.oracle.com/docs/cd/B25329_01/doc/install.102/b25143/toc.htm#BABFHAEC,
    I've uninstalled my antivirus (Kaspersky Internet Security 2009) and have Windows Firewall disabled
    I've setup the ports needed by Oracle to my router (1521,2030,8080)
    I have even started IE in safe mode(=without addons) --- iexplore -extoff
    I've tried almost anything...
    With other browsers (Firefox,Google Chrome, Opera)
    that "Object Browser" button works ok,
    BUT at other points (eg. "SQL>SQL Scripts>Create")
    they all have more or less display problems (while IE shows all other things ok).
    Please help :(
    PS. I've read in http://kr.forums.oracle.com/forums/thread.jspa?threadID=554359
    that there is a patch (#5648872) that could fix the problem,
    but unfortunately http://metalink.oracle.com/ is only for Oracle's paying customers,
    while I need/use Oracle 10gxe (free download) for my university lessons :( :(

    Yes, of course.
    Here is what I get in IE now instead of a plain 404:
    the first few lines:
    Mon, 23 Feb 2009 23:17:20 GMT
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "FLOWS_020100.WWV_FLOW", line 11227
    ORA-06512: at "FLOWS_020100.WWV_FLOW_CONDITIONS", line 392
    ORA-06512: at "FLOWS_020100.WWV_FLOW_DISP_PAGE_PLUGS", line 717
    ORA-06512: at "FLOWS_020100.WWV_FLOW_DISP_PAGE_PLUGS", line 309
    ORA-06512: at "FLOWS_020100.WWV_FLOW", line 3098
    ORA-06512: at "FLOWS_020100.WWV_FLOW", line 2422
    ORA-06512: at "FLOWS_020100.WWV_FLOW", line 9357
    ORA-06512: at "FLOWS_020100.F", line 236
    ORA-06512: at line 30
    DAD name: apex
    PROCEDURE : f
    +URL : [http://XDB|http://xdb/]+ HTTP Server:8080/apex/f?p=4500:1001:4320649656424332::NO:::
    PARAMETERS :
    +===========+
    p:
    +4500:1001:4320649656424332::NO:::+
    the full page:
    [http://pastebin.com/f39c20e60]
    ?:|

  • How to cache the objects MANUALLY?

    hello
    some o-r mapping tools can cache the objects that have been queried,then next time these objects are required,it don't need to access the database again,it can also monitor the database updating.
    i wonder how i can implement such "cache" function MANUALLY? because i DON'T want to use ANY o-r mapping tools. i only use the jdbc to query database,then generate the object.
    who can give me some clue?? or articles? or sample codes??
    thank you!!!!!

    no you don't understand me,what i want to know is the
    mechanism of the cache,and how to implement it myself
    without using the o-r mapping tools.
    the dao pattern can encapsulate the database
    access,but it can NOT cache the object .First you need to define how the caching occurs.
    - Can the data in the database change without going through your code?
    - Are there multiple copies of your app running at the same time. If yes then what happens if one is updated?
    - How many of these can there be and what impact will this have on memory?
    - etc.
    You also need to identify the 'identity' of an object.
    A simple strategy....
    - Some layer requests an object using the 'identity'.
    - The database layer code looks in a hash for the 'identity'. If it finds it it returns it.
    - If it doesn't find it it uses a DAO to load it, then puts it in the hash, then returns it.

  • Exception when invoking create method on entity ejb's home object

    I have a simple entity bean. I am able to get the reference to the entity's home object. But when I run create method on entity's home interface, I get the following exception. The create method takes no arguments as the primary key is Auto-Increment field in MYSQL database. Here is the exception. I am using jdeveloper and embedded OC4J as server.
    07/06/22 15:51:15 java.lang.NullPointerException
    07/06/22 15:51:15 at EmployeeHome_EntityHomeWrapper2.create(EmployeeHome_EntityHomeWrapper2.java:1168)
    07/06/22 15:51:15 at com.pd.EmpAddInput.addEmployee(EmpAddInput.java:64)
    07/06/22 15:51:15 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    07/06/22 15:51:15 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    07/06/22 15:51:15 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    07/06/22 15:51:15 at java.lang.reflect.Method.invoke(Method.java:585)
    07/06/22 15:51:15 at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
    07/06/22 15:51:15 at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
    07/06/22 15:51:15 at javax.faces.component.UICommand.broadcast(UICommand.java:332)
    07/06/22 15:51:15 at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:287)
    07/06/22 15:51:15 at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:401)
    07/06/22 15:51:15 at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
    07/06/22 15:51:15 at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:268)
    07/06/22 15:51:15 at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
    07/06/22 15:51:15 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
    07/06/22 15:51:15 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:712)
    07/06/22 15:51:15 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:369)
    07/06/22 15:51:15 at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:865)
    07/06/22 15:51:15 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:447)
    07/06/22 15:51:15 at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:215)
    07/06/22 15:51:15 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
    07/06/22 15:51:15 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
    07/06/22 15:51:15 at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    07/06/22 15:51:15 at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
    07/06/22 15:51:15 at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
    07/06/22 15:51:15 at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
    07/06/22 15:51:15 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    07/06/22 15:51:15 at java.lang.Thread.run(Thread.java:595)
    What may be causing this exception.

    I have solved the problem. It had to do with the autocommit=true feature of the MYSQL connection. However I have ran into another trouble. I am getting the following exception.
    java.lang.IllegalStateException: Can not call getPrimaryKey() inside ejbCreate(...) methods, the entity does not have an identity yet, see the EJB 2.0 specification chapter 10.5.4
         at com.evermind.server.ejb.EJBUtils.throwGetPrimaryKeyInEJBCreateException(EJBUtils.java:892)
         at EmployeeRemote_EntityBeanWrapper0.getPrimaryKey(EmployeeRemote_EntityBeanWrapper0.java:1686)
         at EmployeeHome_EntityHomeWrapper2.create(EmployeeHome_EntityHomeWrapper2.java:1055)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    java.lang.IllegalStateException: Can not call getPrimaryKey() inside ejbCreate(...) methods, the entity does not have an identity yet, see the EJB 2.0 specification chapter 10.5.4
         at com.evermind.server.rmi.RMICall.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMICall.java:109)
         at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:125)
         at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:517)
         at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:461)
         at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
         at __Proxy0.create(Unknown Source)
         at com.pd.model.EmployeeRemoteClient.main(EmployeeRemoteClient.java:37)
    I am not calling getPrimaryKey() in ejbCreate() then why this exception

  • Is it OK to cache home stubs in 6.1?

    I heard that caching home stubs may cause hot deployment issues in WebLogic
    server. Is this the case for 6.1? What about remote stubs (i.e. for a
    stateless session bean)?
    Thanks,
    Bob

    Regarding the remotes stubs: Remote interface is not serializable. If your app
    needs to work in clustered env then weblogic 6.1 will have problems replicating
    the remote interface. If you absolutely have to cache the remote stub in httpsession,
    get the handle of the remote interface and cache it. To get the remote interface
    from the handle use handle.getEJBObject().
    sudy
    "Bob Lee" <[email protected]> wrote:
    I heard that caching home stubs may cause hot deployment issues in WebLogic
    server. Is this the case for 6.1? What about remote stubs (i.e. for a
    stateless session bean)?
    Thanks,
    Bob

  • Home object  one for each client

    1.
    When client looks up for home (context.lookup("TraderHome")) :-
    1.Client gets the Home Stub which was implemented by the Server, is it correct ?
    2.On the server who will communicate with this client homestub? One home-object for on server ? Is it correct ?
    3. So Client home-stub and server-home object one-to-one communication ?
    4. Will the home-stub object carries any context from server ?(like security or user-specific context ?
    5. Can we restrict so that certain user can only get the home object ?
    please make me clear ...
    -thanks
    Praveen Sadhu.

    When client looks up for home (context.lookup("TraderHome")) :-
    1.Client gets the Home Stub which was implemented by the Server, is it correct ?
    2.On the server who will communicate with this client homestub? One home-object for on server ? Is it correct ?
    3. So Client home-stub and server-home object one-to-one communication ?
    4. Will the home-stub object carries any context from server ?(like security or user-specific context ?
    5. Can we restrict so that certain user can only get the home object ?
    please make me clear ...
    -thanks
    Praveen Sadhu.

  • Caching Long Objects

    Hi,
    I would like to know why is Long objects are not cached internally and pooled in Java. Since Long objects are immutable there shouldn't be any problem in doing this right? Let me know am I missing anything here...Currently for one of my applications Iam planning to do this caching of Long objects myself. But the code for that looked pretty ugly as I need to put the newly constructed Long object into a HashMap and get the reference to the previously cached Long object. I believe providing this implementation will reduce my application memory requriements drastically as I need to cache huge volumes of data (around 1 GB of data need to be cached). Will there be any problems in providing an implementation like this ... Are there any better alternatives ?

    Objects in general take somewhere in the region of 24-32 bytes to represent (excluding any member
    variables) therefore Long will require somewhere in the region of 32 to 40 bytes to represent. The
    hashMap you use to cache your Longs creates additional overhead (we'll ignore this for now as it can be
    amortised over the individual unique Longs that you cache.
    a long takes 8 bytes to store.
    a reference takes 4 bytes (on a 32 bit machine 8 on a 64 bit JVM)
    Therefore on 64 bit machines there is no advantage. Caching will always take more memory then using
    native longs.
    on a 32 bit VM the advantage of using cached Longs when compared to native longs occurs when you
    have an average of at least 8 references to each unique Long. (for a large number of unique Longs)
    However there are, I believe, plans to do this in 1.5. However they are not doing it to save memory. They
    are doing it to improve the performance of autoboxing. Also the cache will not be dynamic it will be of
    fixed size and created when the VM starts up. Basically values in the range -128 to 127 (or something
    similar) will be cached for byte, short, int , long.
    matfud

  • JNDI Exception while trying to create home object

    Hi everyone,
    I'm trying out a test application to create a home object in a remote computer. I'm using the SUN Ref-Impl v1.3 . I ran the small code below,
    try {
    Hashtable env= new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
    env.put(Context.PROVIDER_URL, "iiop://localhost:1050");
    env.put(Context.SECURITY_PRINCIPAL, "guest");
    env.put(Context.SECURITY_CREDENTIALS, "guest123");
    InitialContext ic= new InitialContext(env);
    Object objRef= ic.lookup("jdbc/eVDB");
    System.out.println("DB conn success!");
    } catch (Exception ex) {
    ex.printStackTrace();
    System.out.println("Unable to conn DB... "+ ex.getMessage());
    I successfully accessed this Database object wrapped in an entity bean through .jsp .
    But when I ran the above code the follwing exception was emitted,
    javax.naming.NameNotFoundException. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
         at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:72)
         at org.omg.CosNaming._NamingContextExtStub.resolve(_NamingContextExtStub.java:402)
         at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:440)
         at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:492)
         at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:470)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at TestJNDI.main(TestJNDI.java:26)
    Unable to conn DB... null
    ========================
    If anybody can help me I would be most grateful. Thank you.

    i added the j2ee.jar and the out put changed.
    when i write,
    ic.lookup("eV/CheckLogin");
    it successfuly created the home object.
    But when I added a database JNDI reference it failed,
    when i wrote,
    ic.lookup("java:comp/env/jdbc/eVDB");
    the following exception occures,
    javax.naming.NameNotFoundException: No object bound for java:comp/env/jdbc/eVDB
         at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:116)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at TestJNDI.main(TestJNDI.java:30)
    and when i put,
    ic.lookup("jdbc/eVDB")
    the previous exception occures,
    javax.naming.NameNotFoundException. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
         at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:72)
         at org.omg.CosNaming._NamingContextExtStub.resolve(_NamingContextExtStub.java:402)
         at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:440)
         at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:492)
         at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:470)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at TestJNDI.main(TestJNDI.java:30)
    ===============
    <sigh> I'm stumped...

  • ClassCastException - While type casting Home object after EJB JNDI Lookup

    Sun One Application Server throws a ClassCastException when I try to type cast Home object to it's respective interface type.
    Here is the code ---
    ==============================================
    Object obj = PortableRemoteObject.narrow( context.lookup( jndiName ), homeClass);
    System.out.println("Remote Object - obj : "+obj);
    if (obj != null) {
       System.out.println("obj.getClass().getName() : "+obj.getClass().getName());
       System.out.println("obj.getClass().getSuperclass() : "+obj.getClass().getSuperclass());
       Class[] interfaces = obj.getClass().getInterfaces();
       if (interfaces != null) {
          for (int count = 0; count < interfaces.length; count++) {
             System.out.println("interfaces[ " + count + " ].getName() : " + interfaces[ count ].getName());
    }==============================================
    The class name is dislpayed as the Stub class name.
    While displaying the interfaces, the Home Interface name is displayed.
    But later when I try to type cast it into Home Interface type, it throws a ClassCastException.
    Can somebody please check this?

    Please post the stack trace. Also, take a look at our EJB FAQ to make sure you're doing the
    recommended lookup :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html

  • How can I cache an object for unlimited time or for ever.

    Hi,
    How can I cache an object for ever or unlimited time. What values should be used to in cache-config.xml i.e.
    <expiry-delay system-property="tangosol.coherence.zerostage.expiry.delay">XXXms</expiry-delay>
    <flush-delay system-property="tangosol.coherence.zerostage.flush.delay">XXXms</flush-delay>
    thanks a lot in advance.

    Hi Suhas,
    If you look in the documentation http://download.oracle.com/docs/cd/E14526_01/coh.350/e14509/toc.htm and more specifically here http://download.oracle.com/docs/cd/E14526_01/coh.350/e14509/appcacheelements.htm#BABDHGHJ you will see the explination for the two configuration items you mention.
    The default expiry-delay is zero which means no expiry - that is the data will stay in the cache forever (or until you do a remove). If expiry is zero then flush-delay has a default of zero is used and automatic flushes are disabled.
    JK

Maybe you are looking for