How to reload embedded oc4j in JDeveloper without terminating it?

To the experienced:
Using JDeveloper (10.1.3.4), when I need to see the effect of my changes in the application code (in the backing beans), the only way I know is to terminate the embedded oc4j by clicking the red square button (or Run > Terminate > Embedded OC4J Server), and then run a .jspx page to restart the oc4j. All these steps are just for the changes in the code to be loaded into the oc4j.
That is a bit too cumbersome because such reloading is frequent. To test the changed application I need to use an outside page that sends a request to that .jspx page, with some information that the .jspx page needs. That won't work because the oc4j has been terminated. So I have to Run that .jspx page inside JDeveloper just to start the oc4j, knowing that this will spill error in the browser window because the information from the outside page is missing.
Is there a way to have the application in the running oc4j updated without terminating and restarting the oc4j?
Thanks for helping!
Newman

It kind of depends on the type of changes you did - some changes can be picked up automatically just by saving the new file and reloading in the browser.
In any case you don't need to first stop the server and then run, you can just hit the run button again and JDeveloper will re-deploy your new page.
You can have the HTML file be part of your project and run it from inside JDeveloper - this will also re-deploy your new JSPX.

Similar Messages

  • Mail Session configuration with embedded oc4j in jdeveloper 10g 10.1.3.1

    Hello all:
    I'd tried to use javamail in a j2ee application. I´d defined an resource reference with the EJB Module Editor but when i run the application it throws:
    java.lang.InstantiationException: Error initializing ejb-modules: No Mail Session configured for the resource MailSession
    How can i configure a Mail Session with the embedded oc4j of jdeveloper 10g 10.1.3.1?
    Thanks a lot.

    Hi,
    You need to add following configuration in $ORACLE_HOME/j2ee/home/config/application.xml & restart your OC4J :-
    <mail-session location="EMailSession" smtp-host="mail.cdsc.com">       <property name="mail.transport.protocol" value="smtp"/>       <property name="mail.debug" value="true"/>    </mail-session>Regards,
    Sandeep

  • Problem running embeded OC4J from JDeveloper 11g TP 3

    I've just downloaded JDeveloper 11g Technical Preview 3. Unzipped it and ran.
    IDE runs ok, but when I try to run Web project on embedded OC4J, I got exceptions and the server never starts (exception text included on the bottom).
    Here is the way to reproduce the error:
    1. Create new Web Project with New Gallery wizard:
    a. New Gallery->general->projects->web project
    b. on Web Application page (step 3 of 7) choose Servlet 2.5/JSP 21.
    c. on Page Flow technology page (4 of 7) choose none
    d. don't include available libraries (5 of 7)
    e. on Web Project Profile (6 of 7) check Add JSP Page
    f. finish
    e. choose jsp name (after clicking finish a dialog pops up)
    2. Run the page
    a. select the page in Application Navigator
    b. right click on it and choose Run option
    In my case I got the following exception:
    [Starting Embedded OC4J Server using the following ports: HTTP=8988, RMI=23891, JMS=9227.]
    C:\Documents and Settings\kazelot\Application data\JDeveloper\system11.1.1.0.22.47.96\o.j2ee\embedded-oc4j\config>
    D:\work\jdev1111\jdk\bin\javaw.exe -client -classpath D:\work\jdev1111\j2ee\home\oc4j.jar;D:\work\jdev1111\jdev\lib\jdev-oc4j-embedded.jar -Xverify:none -XX:MaxPermSize=512m -Ddisable.checkForUpdate=true -Doracle.application.environment=development -Doracle.j2ee.dont.use.memory.archive=true -Doracle.j2ee.http.socket.timeout=500 -Doc4j.jms.usePersistenceLockFiles=false "-Djava.security.policy=C:\Documents and Settings\kazelot\Application data\JDeveloper\system11.1.1.0.22.47.96\o.j2ee\embedded-oc4j\config\java2.policy" oracle.oc4j.loader.boot.BootStrap -config "C:\Documents and Settings\kazelot\Application data\JDeveloper\system11.1.1.0.22.47.96\o.j2ee\embedded-oc4j\config\server.xml"
    [waiting for the server to complete its initialization...]
    2008-01-30 13:19:09 oracle.j2ee.xml.XMLMessages warningException
    WARNING: Exception Encountered
    2008-01-30 13:19:10 oracle.oc4j.util.SystemLog log
    SEVERE: Server start failed processing configuration
    java.security.AccessControlException: access denied ( CredentialAccessPermission credstoressp.credstore.default.systemuser read)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
         at java.security.AccessController.checkPermission(AccessController.java:427)
         at oracle.security.jps.util.JpsAuth$AuthorizationMechanism$3.checkPermission(JpsAuth.java:256)
         at oracle.security.jps.util.JpsAuth$Diagnostic.checkPermission(JpsAuth.java:180)
         at oracle.security.jps.util.JpsAuth$AuthorizationMechanism$6.checkPermission(JpsAuth.java:280)
         at oracle.security.jps.util.JpsAuth.checkPermission(JpsAuth.java:315)
         at oracle.security.jps.util.JpsAuth.checkPermission(JpsAuth.java:338)
         at oracle.security.jps.internal.credstore.util.CsfUtil.checkPermission(CsfUtil.java:527)
         at oracle.security.jps.internal.credstore.ssp.SspCredentialStore.getCredential(SspCredentialStore.java:412)
         at oracle.security.jps.fmw.util.JpsFmwUtil.findSystemUser(JpsFmwUtil.java:218)
         at oracle.security.jps.fmw.JpsUserManager.init(JpsUserManager.java:235)
         at oracle.security.jps.fmw.JpsUserManager.<init>(JpsUserManager.java:247)
         at oracle.security.jps.fmw.JpsUserManagerFactory$JpsUserManagerFactoryI.create(JpsUserManagerFactory.java:252)
         at com.evermind.server.deployment.UserManagerConfig$JAZN.construct(UserManagerConfig.java:635)
         at com.evermind.server.deployment.UserManagerConfig.delegatee(UserManagerConfig.java:253)
         at com.evermind.security.IndirectUserManager.getAdminUser(IndirectUserManager.java:126)
         at com.evermind.security.IndirectUserManager.getAdminUser(IndirectUserManager.java:126)
         at com.evermind.server.XMLApplicationServerConfig.setPassword(XMLApplicationServerConfig.java:3157)
         at com.evermind.server.XMLApplicationServerConfig.<init>(XMLApplicationServerConfig.java:244)
         at com.evermind.server.ApplicationServer.createConfig(ApplicationServer.java:648)
         at oracle.oc4j.server.ServerFactory$Worker.prepareConfig(ApplicationServerFactory.java:201)
         at oracle.oc4j.server.ServerFactory$Worker.start(ApplicationServerFactory.java:220)
         at oracle.oc4j.server.ServerFactory$Worker.run(ApplicationServerFactory.java:235)
         at java.lang.Thread.run(Thread.java:595)
    2008-01-30 13:19:10 oracle.oc4j.util.SystemLog logNoStack
    SEVERE: Server exiting: ApplicationServer entered state EXITING
    Process exited with exit code 1.
    Is it something with my configuration. My environment is:
    ADF Business Components     11.1.1.47.96
    Java(TM) Platform     1.5.0_11
    Oracle IDE     11.1.1.0.22.47.96
    SOA Composite Editor     11.1.1.0.0 (Build 071219.1424)
    Versioning Support     11.1.1.0.22.47.96
    Thanks for any suggestions,
    kazelot

    change the file to just (DIRTY way, but works)
    grant {
         permission java.security.AllPermission;
    };Really dirty as these permissions are not Java EE compliant.
    --olaf                                                                                                                                                                                                                                                                                                                                                                           

  • The embedded oc4j in JDeveloper returned a wrong data from the SOAP message

    Greetings,
    I made a webservice in .NET to send simply the current time of the server. then, I developed another client in JDeveloper to receive the time.
    and the object declared in j2ee as Calendar object.
    everythings went fine, but what I have noticed when I print the Calendar object, the time came plus 3 hours later as the .NET time.
    FYI, I had checked the soap message that was received by embedded OC4J ,it was correct time, but the problem when you print it. and both .NET and Jdeveloper in the same machine
    example:
    <?xml version = '1.0' encoding = 'utf-8'?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
    <HelloWorldResponse xmlns="http://tempuri.org/">
    <HelloWorldResult>2008-10-14T10:40:21.12</HelloWorldResult>
    </HelloWorldResponse>
    </soap:Body>
    </soap:Envelope>
    when I printed the data, I got 2008-10-14T13:40:21.12
    so, does anyone have an idea about what is going on ??
    thanks in advance.

    ANY HELP :(

  • Using embedded oc4j in jdeveloper 10.1.3. EA failed

    Hallo
    i have the following problem, and hope somebody can help me.
    i installed the jdev 10.1.3.EA 3412 on notebook with suse linux 9.2 and made a simple hallo world jsp.
    compilation was ok with no errors.
    when i run the jsp in jdev i get the following message:
    [Starting OC4J using the following ports: HTTP=8988, RMI=23891, JMS=9227.]
    **** Unable to obtain password from principals.xml. Using default.
    /home/wilhetho/jdevhome/system/oracle.j2ee.10.1.3.34.12/embedded-oc4j/config>
    /usr/share/jdk1.5.0_06/bin/java -server -classpath /opt/oracle/jdev/j2ee/home/oc4j.jar:/opt/oracle/jdev/jdev/lib/jdev-oc4j-embedded.jar -Xverify:none -DcheckForUpdates=adminClientOnly -Xrs -Doracle.application.environment=development -Doracle.j2ee.dont.use.memory.archive=true -Doracle.j2ee.http.socket.timeout=500 -Doc4j.jms.usePersistenceLockFiles=false oracle.oc4j.loader.boot.BootStrap -config /home/wilhetho/jdevhome/system/oracle.j2ee.10.1.3.34.12/embedded-oc4j/config/server.xml
    [waiting for the server to complete its initialization...]
    24.01.2006 19:15:34 com.evermind.server.XMLDataSourcesConfig parseRootNode
    INFO: Legacy datasource detected...attempting to convert to new syntax.
    06/01/24 19:15:43 java.net.NoRouteToHostException: No route to host
    06/01/24 19:15:43      at java.net.PlainSocketImpl.socketConnect(Native Method)
    06/01/24 19:15:43      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    06/01/24 19:15:43      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    06/01/24 19:15:43      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    06/01/24 19:15:43      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    06/01/24 19:15:43      at java.net.Socket.connect(Socket.java:507)
    06/01/24 19:15:43      at java.net.Socket.connect(Socket.java:457)
    06/01/24 19:15:43      at java.net.Socket.<init>(Socket.java:365)
    06/01/24 19:15:43      at java.net.Socket.<init>(Socket.java:207)
    06/01/24 19:15:43      at oracle.jdevimpl.runner.oc4j.Oc4jNotifier.sendMessage(Oc4jNotifier.java:98)
    06/01/24 19:15:43      at oracle.jdevimpl.runner.oc4j.Oc4jNotifier.postInitApplicationServer(Oc4jNotifier.java:55)
    06/01/24 19:15:43      at com.evermind.server.ApplicationServer.serverExtensionPostInit(ApplicationServer.java:1041)
    06/01/24 19:15:43      at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:927)
    06/01/24 19:15:43      at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:98)
    06/01/24 19:15:43      at java.lang.Thread.run(Thread.java:595)
    06/01/24 19:15:43 Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview initialized
    After this, the oc4j container is up an running, because i can reach it over the adress localhost:8988.
    So now my two questions:
    -> there is no browser starting (i tried different entries under tools-preferences-webproxy). what can be the reason?
    -> where does the error message no route to host come from?
    thank you

    Hi, here Re: java.net.ConnectException: Connection timed out: connect i post my workaround.
    bye
    Antonio.

  • Embedded OC4J (Jdeveloper 10.1.3.2) HTTP switch HTTPS

    I need to debug some web application that switches between HTTP and HTTPS and back again. I have done all the required configuarion of the embedded OC4J to support this namely:
    1. create self signed certificate
    2. created a second web-site (secure-web-site.xml) that listens for https connections on another port e.g. 4443
    3. added relevant <ssl-config> entry to secure-web-site.xml
    4. Marked the relevant <web-app> element as shared in the secure-web-site.xml and default-web-site.xml files
    I now start the embedded OC4J in jdeveloper and all is well, https and http work fine. However a different session is created for each of the web-sites the secure and the default (i.e one for the http and one for the https). I understand why since the browser treats http://www.mydomain.com:8988 and https://www.mydomain.com:4443 as separate web sites.
    One Solution
    ~~~~~~~~~~
    If my understanding is correct if I use the standard ports 80 and 443 then the browser would treat these as the same web site and only one cookie jsessionid cookie gets created and so only one session
    2nd Solution
    ~~~~~~~~~~
    If I use non-default ports like 8888 and 4443 then I can set the cookie domain in the orion-web.xml file <session-tracking cookie-domain=".mydomain.com" /> and this ensures one jsessionid cookie is shared for the whole domain and so again only one session
    Unfortunately I cannot implement either solution in the embedded OC4J since for solution one no matter what I do I cannot get the embedded OC4J to listen on port 80. It always finds a conflict and chooses a different port like 1024 even though no other process is using port 80
    The second solution does not work since the orion-web.xml file gets overwritten everytime I start the embedded OC4J and so I lose any updates I make.
    Does anybody have any ideas how to overcome these problems? I know I could use a standalone container but then I will lose all the convenience of testing within Jdeveloper.
    Many thanks.

    Hi,
    I'll file an ER to allow developers in JDeveloper to test http and https. What I usually do - as a work around - is to open files that are change on each start of the embedded OC4J in TextPad. TextPad asks if an opened file should be reloaded when it has been changed on the filesystem. I then say "no" and safe the opened file gain, overriding the JDeveloper changes.
    Its not perfect, but much better than re-editing all the files.
    Frank

  • EJB lookup works in embedded OC4J but not stand-alone

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

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

  • How to use mapviewer extension for jdevelop?

    I am working on the mapviewer. But my problem is that I can not connect mapviewer, or I can not start mapviewer using the embedded oc4j by jdeveloper. In mapviewer faq I read that:
    "How do I view the mapping metadata through JDeveloper's Connections Navigator?
    We have developed an Oracle JDeveloper extension that lets you browse the available list of styles, themes and basemaps defined in a datasource through JDeveloper's Connections Navigator. To do this, you will first need to download the mvconnection.jar file from OTN's MapViewer site. This jar contains the code that defines a MapViewer connection type for JDeveloper. To install, simply drop this jar file to the JDeveloper extension directory, normally $JDEV_HOME/jdev/lib/ext. Then restart JDeveloper, and you are all set.
    But when I restart jdeveloper, I got the message:
    "H:\Programme\jdev\jdev\lib\ext\mvpalette.jar!\META-INF\jdev-ext.xml
    Error: jar:file:/H:/Programme/jdev/jdev/lib/ext/mvpalette.jar!/META-INF/jdev-ext.xml<Line 105, Column 18>: XSD-2021: (Error) Element not completed: 'jsplibrary'
    H:\Programme\jdev\jdev\lib\ext\mvconnection.jar!\META-INF\jdev-ext.xml
    Error: jar:file:/H:/Programme/jdev/jdev/lib/ext/mvconnection.jar!/META-INF/jdev-ext.xml<Line 25, Column 20>: XSD-2034: (Error) Element 'description' not expected.
    Error: jar:file:/H:/Programme/jdev/jdev/lib/ext/mvconnection.jar!/META-INF/jdev-ext.xml<Line 26, Column 13>: XSD-2034: (Error) Element 'help' not expected.
    I use Jdeveloper 10g. Have you ever met the same problem?
    Thanks in advance

    The Map Viewer extension is still not available for JDeveloper 10g. It works with JDeveloper 9.
    The Mapping group is currently working on an upgrade.

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

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

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

  • OC4J under JDeveloper

    I'm trying to run OC4J under JDeveloper. I'm using JDeveloper v.10.1.3.1 and OC4J v.10.1.3 . There is a Wizard in JDeveloper that's used to define an App Server connection. The problem I'm having is on Step 3 of 4 of the Wizard. There are 3 entries here. They are:
    1. Host Name (default value is 'localhost').
    2. RMI Port (default value is 23791)
    3. URL Path (NO DEFAULT VALUE).
    I have no idea what the URL path should be or the RMI Port. How does one go about finding out what these entries are and defining an App server connection?
    I can run the App server outside of JDeveloper but would prefer to have it inside if possible.
    Thanks,
    Bill

    If you are using the embedded oc4j of JDeveloper, you do not use this Wizard. You just run your application, servlet, jsp and etc.
    If you would like JDeveloper to connect to an oc4j standalone, by default, you do not have to enter anything into that URL Path. Just hit "finish" or "next" in that step of the Wizard once you enter that value for "Host Name" and "RMI Port".

  • XML validation errors in embedded OC4J jazn.xml

    hi
    If I open the jazn.xml of the embedded OC4J in JDeveloper 10.1.3.3.0 and select "Validate XML" from the context-menu on that file, I get these messages in the "XML Validation Errors - Log" :
    D:\oracle\jdevstudio10133\jdev\system\oracle.j2ee.10.1.3.41.57\embedded-oc4j\config\jazn.xml
        Error(10,28): <Line 10, Column 28>: XML-24535: (Error) Attribute 'schema-major-version' not expected.
        Error(10,28): <Line 10, Column 28>: XML-24535: (Error) Attribute 'schema-minor-version' not expected.
        Error(10,28): <Line 10, Column 28>: XML-24536: (Error) Missing Attribute 'filepath'
        Error(10,28): <Line 10, Column 28>: XML-24536: (Error) Missing Attribute 'OC4J_INSTANCE_ID'Strange, because I'm not aware of any changes I've made to this file.
    Could someone (from Oracle) please confirm that this is "intended", so I can exclude it as possible cause for the "security configuration issue" that I'm having.
    many thanks
    Jan Vervecken

    Thanks for your reply Frank.
    If "the content seems to be correct" then the XML schema jazn-10_0.xsd might not be what it should be.
    For the attributes "filepath" and "OC4J_INSTANCE_ID" it says they are "required", just like the validation by JDeveloper says, but they are not in the documentation.
    For the attributes "schema-major-version" and "schema-minor-version" the documentation says:
    "This attribute is not defined directly in the XSD for jazn.xml. It is according to the attributeGroup specification in the top-level OC4J XSD."
    Although there is no exact reference in that documentation, and also not in jazn-10_0.xsd, that XSD could be oc4j-10_0.xsd because it defines this:
        <xsd:attributeGroup name="oc4j-schemaVersionAttributeType">
            <xsd:annotation>
                <xsd:documentation>This type defines two different attributes which are intended to be used in the
                    root element of a schema document to define version 10.0 of the schema document.
                </xsd:documentation>
            </xsd:annotation>
            <xsd:attribute name="schema-major-version" type="xsd:integer" fixed="10"/>
            <xsd:attribute name="schema-minor-version" type="xsd:integer" default="0"/>
        </xsd:attributeGroup>I'm not sure if it is the validation by JDeveloper that went wrong here, or the XML schema jazn-10_0.xsd that is incomplete about these "schema version" attributes.
    Anyway, it seems OK to exclude it as possible cause for the "security configuration issue" that I'm having.
    regards
    Jan

  • JDev 10.1.3 embedded OC4J:  How to run HTTP in port 80 without conflicts?

    Hi
    I need to run the HTTP protocol using port 80 in the OC4J embedded version that JDeveloper 10.1.3 brings. I don't want the port to be decided at run time. I'm trying to configure it to use port 80, but I get conflicts and the port reconfigures to another value (1024). I need the port to be 80 in order to be consistent to the production port. (Why? Because I'm using SSLEXT, for those who are familiar with it).
    How can I understand the conflictand resolve it? How can I know the conflicting process that demands the port 80?

    Only way you can change this is to hack jdeveloper...
    in jdev.jar (or jdev-sr.jar if you have service pack) find Oc4jPortConflictUtil.class and replace it with compiled code below.
    package oracle.jdevimpl.runner.oc4j;
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.net.ServerSocket;
    import java.util.ArrayList;
    import java.util.Iterator;
    import javax.swing.JOptionPane;
    import oracle.bali.ewt.text.MultiLineLabel;
    import oracle.bali.ewt.text.WordWrapper;
    import oracle.ide.util.IdeUtil;
    import oracle.jdeveloper.runner.RunMgrArb;
    import oracle.jdeveloper.xml.oc4j.Oc4jConfigAdmin;
    final class Oc4jPortConflictUtil
        private final Oc4jConfigAdmin _admin;
        private final PrintWriter _log;
        private static final int HTTP_SOCKET = 0;
        private static final int RMI_SOCKET = 1;
        private static final int JMS_SOCKET = 2;
        private static final int IIOP_SOCKET = 3;
        private static final int IIOP_SSL_SOCKET = 4;
        private final ServerSocket _sockets[] = new ServerSocket[5];
        Oc4jPortConflictUtil(Oc4jConfigAdmin oc4jconfigadmin, PrintWriter printwriter)
            _admin = oc4jconfigadmin;
            _log = printwriter;
        boolean acquirePorts()
            try
                ArrayList portConflicts = new ArrayList();
                _admin.setHttpPort(reservePort(0, _admin.getHttpPort(), 23, portConflicts));
                _admin.setRmiPort(reservePort(1, _admin.getRmiPort(), 24, portConflicts));
                _admin.setJmsPort(reservePort(2, _admin.getJmsPort(), 25, portConflicts));
                int iiopPort = _admin.getIiopPort();
                if(iiopPort > 0)
                    _admin.setIiopPort(reservePort(3, iiopPort, 26, portConflicts));
                int iiopSslPort = _admin.getIiopSslPort();
                if(iiopSslPort > 0)
                    _admin.setIiopSslPort(reservePort(4, iiopSslPort, 27, portConflicts));
                boolean flag = userAcceptsPorts(portConflicts);
                return flag;
            catch(IOException e)
                e.printStackTrace(_log);
            boolean flag1 = false;
            return flag1;
        void releasePorts()
            int n = _sockets.length;
            for(int i = 0; i < n; i++)
                closeSocket(_sockets);
    _sockets[i] = null;
    private int reservePort(int index, int portSetting, int runMgrArbMsg, ArrayList portConflicts)
    ServerSocket socket = findAvailablePort(portSetting);
    int actualPort = socket.getLocalPort();
    boolean portReassigned = portSetting != actualPort;
    if(portReassigned)
    portConflicts.add(RunMgrArb.format(runMgrArbMsg, Integer.toString(actualPort)));
    _sockets[index] = socket;
    return actualPort;
    static ServerSocket findAvailablePort(int port)
    if(port < 80 || port > 65535)
    port = 80;
    do
    try
    ServerSocket serversocket = new ServerSocket(port);
    return serversocket;
    catch(IOException e) { }
    if(port < 65535)
    port++;
    else
    port = 80;
    } while(true);
    static void closeSocket(ServerSocket socket)
    if(socket != null)
    try
    socket.close();
    catch(IOException e)
    e.printStackTrace();
    private boolean userAcceptsPorts(ArrayList portConflicts)
    throws IOException
    if(portConflicts.size() > 0)
    for(Iterator iter = portConflicts.iterator(); iter.hasNext(); _log.println(iter.next()));
    MultiLineLabel mesg = new MultiLineLabel(WordWrapper.getTextWrapper(), RunMgrArb.getString(28));
    int result = JOptionPane.showConfirmDialog(IdeUtil.getMainWindow(), mesg, RunMgrArb.getString(29), 2);
    if(result != 0)
    releasePorts();
    _admin.rollbackChanges();
    _log.println(RunMgrArb.getString(30));
    log.println(RunMgrArb.format(31, Integer.toString(admin.getHttpPort()), Integer.toString(_admin.getRmiPort()), Integer.toString(_admin.getJmsPort())));
    log.println(RunMgrArb.format(32, Integer.toString(admin.getIiopPort()), Integer.toString(_admin.getIiopSslPort())));
    return false;
    return true;

  • How to set up data source for JDeveloper's embedded OC4J Server?

    Help needed. I Created a BMP EJB and tried to test
    it with JDeveloper's( version 9.0.3) embedded
    OC4J server. For JDBC, I created a data source
    in data-source.xml lacated in JdeveloperHome\j2ee\home\config. However,
    when I run the test client. I got the error
    from JNDI lookup:
    java.rmi.RemoteException: jdbc/entdatasource not found
    Could anybody with similar experience help?
    Thank you in advance.
    -John Wang

    Try making your changes in the data-source.xml located @ JDev_root\jdev\system9.0.3.1035\oc4j-config.
    You can tell that this is the one to be modified by watching the log when you start the OC4J server. Look for the line that says C:\JDEV\JDK\bin\javaw.exe -ojvm -classpath . . .
    the -config option will point to where the server.xml is used from, the same dir should be where you get your data-source.xml

  • JDeveloper 10.1.3.2 - Nullpointer in Embedded OC4J Preferences

    When I want to have a look at the jazn-data file holding the users and policies I'm getting the followin error in the dialog-screen:
    java.lang.NullPointerException
         at oracle.jdevimpl.xml.oc4j.jazn.PolicyPanel.onEntry(PolicyPanel.java:38)
         at oracle.ide.panels.MDDPanel.enterTraversableImpl(MDDPanel.java:926)
         at oracle.ide.panels.MDDPanel.enterTraversable(MDDPanel.java:899)
         at oracle.ide.panels.MDDPanel.mav$enterTraversable(MDDPanel.java:106)
         at oracle.ide.panels.MDDPanel$Tsl.updateSelectedNavigable(MDDPanel.java:1348)
         at oracle.ide.panels.MDDPanel$Tsl.updateSelection(MDDPanel.java:1216)
         at oracle.ide.panels.MDDPanel$Tsl.actionPerformed(MDDPanel.java:1210)
         at javax.swing.Timer.fireActionPerformed(Timer.java:271)
         at javax.swing.Timer$DoPostEvent.run(Timer.java:201)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
         at java.awt.Dialog$1.run(Dialog.java:515)
         at java.awt.Dialog.show(Dialog.java:536)
         at java.awt.Component.show(Component.java:1300)
         at java.awt.Component.setVisible(Component.java:1253)
         at oracle.bali.ewt.dialog.JEWTDialog.runDialog(Unknown Source)
         at oracle.bali.ewt.dialog.JEWTDialog.runDialog(Unknown Source)
         at oracle.ide.dialogs.WizardLauncher.runDialog(WizardLauncher.java:55)
         at oracle.ide.panels.TDialogLauncher.showDialog(TDialogLauncher.java:276)
         at oracle.jdevimpl.xml.ModalEditor.showDialog(ModalEditor.java:112)
         at oracle.jdevimpl.xml.ModalEditor.showDialog(ModalEditor.java:88)
         at oracle.jdevimpl.runner.oc4j.EmbeddedServerAdminCommand.doit(EmbeddedServerAdminCommand.java:68)
         at oracle.ide.controller.CommandProcessor.invoke(CommandProcessor.java:259)
         at oracle.ide.controller.IdeAction.performAction(IdeAction.java:541)
         at oracle.ide.controller.IdeAction$1.run(IdeAction.java:772)
         at oracle.ide.controller.IdeAction.actionPerformedImpl(IdeAction.java:789)
         at oracle.ide.controller.IdeAction.actionPerformed(IdeAction.java:498)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
         at java.awt.Component.processMouseEvent(Component.java:5488)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    The only changes I've made in my application was unchecking the Extensions I'm not using in my application. After changing these Extensions (this is a tip regarding memory-consumption of jdeveloper) I'm getting these errors in the realm-dialog.
    Regards,
    Nathalie
    PS: I've unchecked the following extensions:
    - ADF Security 10.1.3.40.66
    - BI Beans Graph 10.1.3
    - Oracle Webcenter Preconfigured OC4J 10.1.3.2.0
    - Portlet Creation Extension 10.1.3.40.66
    - Versioning Support 10.1.3.40.66

    Hi,
    OC4J needs to be configured to support HTTP and HTTPS sessions. Because the embedded OC4J uses the default-web-app configuration during testing I am not so sure about configuring it for HTTPS. However, in this case I suggest you test it as a stand alone container in which case HTTPS configuration happen as described in the OC4J security guide.
    "How do I make the Embedded OC4J redirect http requests for secure web content to https automatically as required in the servlet 2.4 spec ?"
    I don't find this statement in my version of the Servet 2.4 spec. Can you point me to the line in the document?
    If you mean transport guarantee, then this is not exactly what you say:
    "The transport-guarantee element specifies that the communication between client and server should be NONE, INTEGRAL, or CONFIDENTIAL. NONE means that the application does not require any transport guarantees. A value of INTEGRAL means that the application requires that the data sent between the client and server be sent in
    such a way that it can’t be changed in transit. CONFIDENTIAL means that the application requires that the data be transmitted in a fashion that prevents other entities from observing the contents of the transmission. In most cases, the presence of the INTEGRAL or CONFIDENTIAL flag will indicate that the use of SSL is required."
    Servlet 2.4 spec
    This however doesn't mean automated redirect to https but says that this requires SSL, which means that a http error is thrown if https isn't used
    Frank

  • How do I make embedded OC4J use IBM Db2 schema mapping

    I am using JDeveloper 903 with a datasource which happens to be of type IBM DB2. Whenever, I try to deploy and test an entity bean from withinn JDeveloper, the embedded OC4J seems to be using a different database schema mapping scheme than what is required by IBM DB2. As a result of this OC4J tries to autocreate tables with wrong syntax and obviously fails. Can somebody tell me how do I get things setup correctly.
    TIA
    Vimal

    Magnus,
    The optimizations related to efficiently supporting overflow-style caching are not included in Coherence 3.5. I created COH-2338 and COH-2339 to track the progress of the related issues.
    There are four different implementations of the PartitionAwareBackingMap for Coherence 3.5:
    * PartitionSplittingBackingMap is the simplest implementation that simply partitions data across a number of backing maps; it is not observable.
    * ObservableSplittingBackingMap is the observable implementation; it extends WrapperObservableMap and delegates to (wraps) a PartitionSplittingBackingMap.
    * ObservableSplittingBackingCache is an extension to the ObservableSplittingBackingMap that knows how to manage ConfigurableCacheMap instances as the underlying per-partition backing maps; in other words, it can spread out and coalesce a configured amount of memory (etc.) across all the actual backing maps.
    * ReadWriteSplittingBackingMap is an extension of the ReadWriteBackingMap that is partition-aware.
    The DefaultConfigurableCacheFactory currently only uses the ObservableSplittingBackingCache and the ReadWriteSplittingBackingMap; COH-2338 relates to the request for improvement to add support for the other two implementations as well. Additionally, optimizations to load balancing (where overflow caching tends to get bogged down by many small I/O operations) will be important; those are tracked by COH-2339.
    Peace,
    Cameron Purdy
    Oracle Coherence

Maybe you are looking for