Hot Deploy of Toplink requires OC4J restart

Hi
I have encountered the issue where redeploying an EAR containing Toplink references requires a restart of the OC4J instance.
I understand that the Toplink session manager is not re-initialized within this deployment, and therefore an execption is thrown - "missing descriptor".
Is there any way round this; i.e. having to execute an oc4j restart following each EAR file deployment?
Thanks
Marc

Marc,
Here is a sample method I use that leverages the new API.
     * Helper method to lookup the singleton server session using the sessions
     * configuration location and session name. It ensure that the session is
     * logged in but will not refresh it if it already exist. It also checks to
     * ensure that the class-loader has not changed. If it has the SessionManager
     * will force the session to be refreshed.
     * @param sessionsXML Resource name for the sessions.xml configuration file.
     *                    Typically this is 'META-INF/sessions.xml'
     * @param sessionName Name of the session. This method assumes it is a server
     *                    session
     * @return The server session already logged in
    private Server lookupSession(String sessionsXML, String sessionName) {
        XMLSessionConfigLoader loader =
            new XMLSessionConfigLoader(sessionsXML);
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        return
            (Server) SessionManager.getManager().getSession(loader,
                                                            sessionName,
                                                            cl,
                                                            true, // login
                                                            false, // refresh
                                                            true); // check loader
    }Doug

Similar Messages

  • Hot deploying ejb in OC4J 10.1.2.0.2

    Hi all,
    I'm mantaining a large app using MyEclipse and OC4J and a lot of ejb and web modules...
    It's possible to deploy an application with exploded format in this version of oc4j?
    When I try to deploy in exploded format, oc4j doesn't find ejb descriptors and using the directory-format explained in the standalone-guide doesn't work at all.
    I tried the trick of deploy packaged first and then redeploy as exploded format explained in Myeclipse forums, but not success too.
    Can anyone point me in right direction to redeploy an ejb module without restart the server?
    thanks and sorry for bad english ...

    up

  • Procedure for hot deploying EJBs using  Jdeveloper and OC4J comtainer

    i am using JDeveloper , please any one help me out in hot deploying EJBs. what is the procedure if i want to hot deploy EJBS

    1) You have to start OC4J with higher Java heap size e.g. java -Xms100m -Xmx150m -jar oc4j.jar
    2) The RMI port by default used is 23791 and configurable by modifying config/rmi.xml.
    regards
    Debu

  • OC4J hot deployment

    Hi,
    Does OC4J support hot deployment (with exploded directory structure) ? If so, how to achieve this?
    Thanks in advance,
    Moin

    Have a look at Debu Panda's blog http://radio.weblogs.com/0135826/2004/05/17.html#a30
    This is a really good source for information on OC4J related issues.

  • OC4J - Hot Deployment Question.

    Hi All!
    I have a J2EE Application (App.ear), that often change. For every deploy I stop and start the app server (OC4J).
    Is there any risk if I adopt the "HOT DEPLOYMENT"? What are the 'Contraries', if there is any?
    (The application contain EJB, Servlet ecc.).
    Thanks in advance, Veri.

    Hello
    You can take a look to Debu's blog on Hot Deployment
    Regards
    Tugdual Grall

  • Hot delpoyment with TopLink and Stateless Session Beans

    What is the recommended procedure for making hot deployment of Stateless session beans work with toplink in WLS 7.0sp1 and oc4j (9.0.3)
    My current setup is as follows using WLS 7.0sp1:
    A stateless session bean is accessing toplink enabled persistent java classes via the SessionManager. I'm currently using the class loader of the stateless session bean:
    * Method in stateless session bean
    * Return the TopLink Session (based on the wls stateless session bean demo)
    public Server getSession() {
              return (Server)SessionManager.getManager().getSession("ejb_sessionbean", this.getClass().getClassLoader());
    Everything is working as such. My session bean can read and write the persistent java classes. However if I redeploy the stateless session bean jar file the toplink session is not reinitalized. This means that new settings in the session.xml are not used. I addition I get other errors.
    I'm having toplink on the server classpath. The toplink enabled persistent classes are in the stateless session bean jar file.
    Thanks
    Henrik

    What is the recommended procedure for making hot deployment of Stateless session beans work with toplink in WLS 7.0sp1 and oc4j (9.0.3)
    Everything is working as such. My session bean can read and write the persistent java classes. However if I redeploy the stateless session bean jar file the toplink session is not reinitalized. This means that new settings in the session.xml are not used. I addition I get other errors.
    I'm having toplink on the server classpath. The toplink enabled persistent classes are in the stateless session bean jar file.Henrik,
    This is a recent post note I found on the same topic:
    It all hinges on whether the TopLink ServerSession class has
    been loaded by a classloader which is actually thrown away
    during the hot deployment process. If this is the case, then
    hot deployment causes the ServerSession to go out of scope
    and finalize methods take care of logging it out properly.
    If you deploy your TopLink Project on the Sytem class path then
    it definately won't work. You'd have to restart the server every time.
    But if the TopLink Project is deployed inside of an .ear file
    and if you pass the correct ClassLoader to the
    SessionManager.getSession( .... ) call then TopLink Session will
    be re-started when you hot deploy the .earBased on this, the solution might be to deploy your EJBs in an ear file. Everything else looks OK. Can you try this and let us know?
    Thanks,
    Pete Farkas

  • Collaborative Development / Hot Deployment?

    We are a small development team (5-7 people) and have a need to develop collaboratively because each of us is working on small parts of a large application, and we have code dependencies upon eachother. We are looking for suggestions on how to develop collaboratively.
    We have attempted to use 9iAS to develop on - but every time we change any class files, we have to restart the OC4J container for them to be recognized error free. JDeveloper is out of the question because our current PC's cannot handle it (PII ~ 350mhz, 256RAM) and we cannot get new PC's for another year. We have attempted to run a standalone instance of OC4J on the server, but that still requires restarting the instance anytime classes are changed.
    Does anyone have any suggestions for collaborative development? Does anyone know of an environment that has a working hot deployment feature? We are not developing any EJB's, it is strictly a JSP/Servlet solution with Data Access classes for database interaction.

    Semi-speculation on my part follows:
              My understanding of "hot deployment" is that if a new ear file was placed in
              the applications directory it wouldn't supercede the old ear file until it
              was manually deployed. It may however get staged to managed servers but not
              actually deployed. i.e moved but not available.
              -Brett
              "Josh Garcia" <[email protected]> wrote in message
              news:3e1deefc$[email protected]..
              >
              > As I understand, hot deployment should ONLY occur when server(s) are in
              development
              > mode. Are there any cases where hot deployment can occur even when
              servers are
              > in production mode?
              >
              > A little more detail:
              >
              > We are running a WLS 7 SP1 cluster, and, even though our administration
              and managed
              > servers are all in production mode, our EAR is automatically deployed to
              managed
              > servers when placed in the 'applications' directory. Should this be the
              case?
              > I thought that I had to physically redeploy through the console if I was
              in prduction
              > mode.
              >
              > Josh
              

  • Hot deployment and JMX

    Hi,
    I need to know how classes are loaded in hot deployment. my problem is that I'm using a JMX server that has some MBeans registered into it, but when I redeploy an application, and the JMX server is recreated as are the MBeans, the JMX agent clearly points to the old instances of the MBeans instead of the redployed ones. It seems that only restarting the OC4J would fix the pointers.
    Is there any way to fix this? or do I have to restart the server every time I deploy an application?

    What option are you using for deployment ? Are you choosing re-deploy ? We recommend Oracle9iAS install in a test/production environment when
    the application has stabilized.
    Also if you are in a development mode and constantly changing your applications you should consider deploying your apps in standalone OC4J. You can choose to do open-expanded directory deployment.
    If you are using OC4J standalone:
    1) you can replace the EAR file in applications directory and it redeploys
    2) you can replace a Servlet class and change the time stamp on web.xml and it redeploys the srvlets
    3) It automatically redeploys the JSP files
    4) If your EJBs are changed, replace your EJBs and change the timestamp on application.xml and it redeploys
    Some of these options are disabled in OC4J embedded in Oracle9iAS to provide a stable environment for production applications.
    If you still have problems in hot-deployment in OC4J please send me a test case at [email protected]
    thanks
    Debu

  • Auto/hot deployment

    I am using Oracle9ias 9.0.2.0.0. I need to use hot deployment. So, I modified
    the server.xml file in %ORA_HOME%/j2ee/home/config to include
    application-auto-deploy-directory="../applications/auto"
    The ear file that I copied to %ORA_HOME%/j2ee/home/applications/auto is not
    being picked up by ther server. Restarting the server doesn't seem to make
    any difference.
    Any suggestions ?

    Hot deployment is development feature available in OC4J standalone.
    In a deployment environment such as Oracle9iAS
    hot deployment is not supported as things would get out of sync with the infrastructure
    repository used for managing the app server and your application.
    -Prasad

  • Hot deployment in weblogic

    Hi
    I have some questions related to hot deployment.
    1. Is Hot Deployment similar to auto-deploy option in development mode?
    2. Using Auto-deploy is it possible to get the application deployed on managed server
    ( I found that it gets deployed on Admin server and it is not recommended to deploy on Managed.. but is there any way to deploy on managed server)
    3. my application (ear) has dependencies... those are deployed as library.. is it possible to deploy library using auto-deploy
    Thanks

    1. no - hot deployment, deploy, redeploy, or undeploy an application while the server is running without affecting other applications or requiring a server restart
    2. no - the admin server has a feature known as auto-deployment that is enabled when you create a domain using development mode. With this feature, the server watches the autodeploy directory for changes and automatically deploys new or changed applications that it finds there.
    3. why would you want that - just deploy the libraries and refer to those libraries in your deployment overrides.
    Better way to auto-deploy is using the wldeploy Ant task. (http://download.oracle.com/docs/cd/E11035_01/wls100/programming/wldeploy.html)

  • Oracle Application Server 10.1.3.3.0 OC4J Restarting

    Oracle ADF application is deployed to the AS from JDeveolper 10.1.3.3.0 and runs fine initially but after continual use the OC4J returns a runtime exception and restarts.
    1. This instance is not associated with an infrastructure but it is on a server with 10.1.2.2.0 Infra and middle tier instances.
    2.The error occurs while using a web app. It all works fine at first, can nav pages, view records from the db just fine. Then after say 15mins the page returns Internal Server Error message at which time I check the Oracle app server ctrl to find the error below. That error is displayed in the actual app server ctrl page.
    After a few minutes I can refresh the web app page and it returns to the home page working fine again until the next exception and restart. Sometimes as a result of this issue the server will not OC4J will not restart and the page will stop working altogether. At this point I cannot ever restart the OC4J. I have to Restart the entire server machine.
    An error has occurred.
    Caught exception calling invoke on oc4j:name=Singleton,type=OpmnConfig
    Exception thrown in RequiredModelMBean while trying to invoke operation invoke
    Object reference no longer valid (disconnected)
    Object reference no longer valid (disconnected)
    Hide Additional Trace Information
    oracle.j2ee.admin.jmx.exception.config.ConfigMBeanException:
    Caught exception calling invoke on oc4j:name=Singleton,type=OpmnConfig
    at oracle.oc4j.admin.management.farm.util.OpmnProxyUtil.invoke(OpmnProxyUtil.java:204)
    at oracle.oc4j.admin.management.farm.util.OpmnProxyUtil.invokeSingle(OpmnProxyUtil.java:129)
    at oracle.oc4j.admin.management.farm.util.OpmnProxyUtil.invokeSingle(OpmnProxyUtil.java:99)
    at oracle.oc4j.admin.management.farm.mbeans.OpmnConfigAgr.getNotificationServerAttrs(OpmnConfigAgr.java:200)
    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.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
    at oracle.oc4j.admin.jmx.server.state.LocalizationFilterMBeanServer.invoke(LocalizationFilterMBeanServer.java:579)
    at oracle.oc4j.admin.management.farm.util.OpmnProxyUtil.invoke(OpmnProxyUtil.java:202) ... 50 more
    Caused by: java.io.IOException: Object reference no longer valid (disconnected)
    at oracle.oc4j.admin.jmx.client.RemoteMBeanServer.invoke(RemoteMBeanServer.java:820)
    at oracle.oc4j.admin.management.farm.mbeans.JVMAgr.invoke(JVMAgr.java:1481)
    at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:36)
    at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585) at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:239)
    at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1071) ... 58
    more Caused by: com.evermind.server.rmi.RMIConnectionException: Object reference no longer valid (disconnected)
    at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:60)
    at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
    at com.evermind.server.ejb.StatefulSessionRemoteInvocationHandler.invoke(StatefulSessionRemoteInvocationHandler.java:38)
    at __Proxy8.invoke(Unknown Source) at oracle.oc4j.admin.jmx.client.MBeanServerEjbRemoteSynchronizer.invoke(MBeanServerEjbRemoteSynchronizer.java:144)
    at oracle.oc4j.admin.jmx.client.RemoteMBeanServer.invoke(RemoteMBeanServer.java:816) ... 68 more

    Greetings,
    First I would recommend turning up your logging level to FINEST to glean more informatin regarding the error that is occurring. Please post these data along with any related Messaging service configuration information. It is possible that two services are attempting to make the same connection and it is causing one or the other to fail. You might also review the information in your opmn config file. Does the 10.1.2.2 instance remain running during the OC4j restart?
    OPMN Configuration:
    10.1.20 How to Specify Ports for State Replication in OPMN
    When you deploy an application utilizing state replication in a managed Oracle Application Server, OPMN dynamically allocates the ports that are used to propagate state across the cluster. You can restrict this allocation to a range of ports for an application that has peer-to-peer replication enabled. Specifying ports for state replication might be necessary in an installation with a firewall or network that uses a well-defined port range.
    To specify a range of ports for peer-to-peer state replication
    Add a <port> element to an OC4J instance configuration in the opmn.xml file.
    Specify the name of an application that has peer-to-peer replication enabled as the value of the id attribute of the <port> element.
    Specify a range of ports in the range attribute of the <port> element.
    For example, for deployment of an application named rac-web that is set up for peer-to-peer replication, the line labeled <port id=rac-web .../> in the following OC4J instance configuration tells OPMN to use ports 15213 to 15214 for state replication:
    <port id="default-web-site" range="80-100" protocol="http"/>
    <port id="rmi" range="12401-12500"/>
    <port id="rmis" range="12701-12800"/>
    <port id="jms" range="12601-12700"/>
    <port id="rac-web" range="15213-15214"/>
    For more information about state replication, see Chapter 9, "Application Clustering in OC4J," in the Oracle Containers for J2EE Configuration and Administration Guide.Quoted from:
    http://download.oracle.com/docs/cd/B32110_01/relnotes.1013/b32199/oc4j.htm#CEGICDEF-Michael

  • Hot deployment of servlet

    hi
    i have compiled the servlet in jdeveloper and set the path to oc4j../../web-inf/classes path;after compiling the class Is it neccassary to shutdown the oc4j container;
    after shutdown the container only i am seeing the effect;without shutdown the container can we see the effect;we can do it Tomcat ;Is there any facility in OC4J ;
    bye
    chaitanya

              Hi, suppose you have the servlet called JoeServlet and registered as joeservlet with an argument, say, a file joe.txt. If you want to 'hot' deploy the JoeServlet you should make sure that a) the servlet's name must be unique b) the servlet's class must be in your servlet classpath (see the properties sheet aside) c) the initial argument, say: joeargument=./joe.txt, must match the the name expected by your servlet (eg. getInitParameter("joeargument")). If you have done correctly WLS must work.
              Joe
              "Jayesh Patel" <[email protected]> wrote:
              >
              >I am trying to hot deploy a simple servlet using weblogic console.
              >
              >I am getting error saying that
              >
              >"Property change error for property "RegisterNewServlet".
              >Servlet could not be loaded or instantiated"
              >
              >I am sure that servlet class I am trying to load is in servlet
              >class path.
              >
              >Any idea what is going wrong here.
              >
              >Thanks.
              >
              >
              >
              

  • Hot deployment of Plugin on OIM cluster

    Does someone  know , how to deploy(re-register) the plugin(event Handler ,schedule Task etc.) on OIM cluster in real time.
    I have observed  that when i do re-register the plugin(after any code changes etc.) from one of the nodes of the cluster, the new code does not get reflected on all the nodes.
    It works from one or two nodes but not from all nodes.
    Even after doing Purge Cache from all nodes the behavior remains the same.(Restart of OIM will do the trick, but i need hot deployment)
    Any ideas?
    Thanks
    Akshat

    That's what I have observed that even though the documentation says that PurgeCache.sh will do the trick but it never works. You have to restart the OIM Servers.

  • Hot deployment

    Hi,
    I have a gateway which instantiates and runs applications. Each application implements an interface so the gateways only sees the class at type (interface).
    I have a huge problem in that we have a number of developers working on these applications. There are constantly bug fixes, new functionality etc. that must be added.
    How can I hot deploy these classes? I cannot restart the entire gateway every time I upload a class. This affects all the other applications.
    I have looked at dynamic class loading but this is going to take some serious time to create a custom class loader that will actually destroy old class loaders when creating new ones.
    Is there a simpler way to enable my gateway for hot deployment?
    thanks!

    Creating a new classLoader does not take a lot, and you can tell it NOT to cache the class.
    Also, you can simply destroy all current references to a class when running, replace the class file, and then allow code to call the class object again - thus reading the new class file.
    It's not typically a good idea to deploy-in-production any code.

  • Can I deploy applications to embedded oc4j, manually?

    Hi.
    I created an application using JDeveloper 10g and deployed it on embedded oc4j server. I don't want to start Jdeveloper each time I have to run application, so I started the embedded server using:
    java -jar oc4j.jar
    and it runs fine but the application is not running when I give the URL in browser.
    Is the port different when u run the server manually? or the web.xml is not read in this mode?
    Can you guys help?
    Thanks.

    To run a application on the embedded server right-click on the application and select Run for which the JDeveloper is required to be started.
    Or, get the URL for the application with right-click>Run and specify the url in a browser after starting the embedded server separately if the embedded server gets started separately.

Maybe you are looking for