Migrate from Tomcat to OC4J

Hi! Everyone,
I developed a Servlet/JSP application on tomcat, now I am going to deploy it to OC4J. In OC4J, directly under default-web-apps, I created a directory called misc, and put my servlets (in default-web-apps/misc/WEB-INF/classes), jsp (in default-web-apps/misc/jsp), beans (in default-web-apps/misc/WEB-INF/classes/beans) there (no EJB). The OC4J server can run jsp correctly, but it can not locate servlets. It can only locate servlets under default-web-apps/WEB-INF/classes directory.
It means it is not scalable if I put my servlets directly in default-web-apps/WEB-INF/classes, because if I deploy another project, which has a servlet, I also need to put it in the same directory.
All in all, OC4J can locate the servlet by "http://127.0.0.1:port/servlet/myservlet", but if I put the servlet in misc/WEB-INF/classes directory, it can not locate the servlet by "http://127.0.0.1:port/misc/servlet/myservlet".
In tomcat, it is good because every time I created a new project, I just create a new directory "misc" parallel to "examples", and I can access that project by "http://127.0.0.1:port/misc/servlet/myservlet". By doing this way, different projects are in different directory. But in OC4J, different projects' servlet has to be in the same directory (I know I can create a directory under WEB-INF/classes called misc, and then call my servlet by "http://127.0.0.1:port/servlet/misc.myservlet, but this is not what I want).
Is there a way to let OC4J to deploy projects like tomcat? The documentation said OC4J is 100% compatible with tomcat, but I think it is not.
Thanks a lot if you can provide help.
Jingzhi

Hi! Everyone,
I developed a Servlet/JSP application on tomcat, now I am going to deploy it to OC4J. In OC4J, directly under default-web-apps, I created a directory called misc, and put my servlets (in default-web-apps/misc/WEB-INF/classes), jsp (in default-web-apps/misc/jsp), beans (in default-web-apps/misc/WEB-INF/classes/beans) there (no EJB). The OC4J server can run jsp correctly, but it can not locate servlets. It can only locate servlets under default-web-apps/WEB-INF/classes directory.
It means it is not scalable if I put my servlets directly in default-web-apps/WEB-INF/classes, because if I deploy another project, which has a servlet, I also need to put it in the same directory.
All in all, OC4J can locate the servlet by "http://127.0.0.1:port/servlet/myservlet", but if I put the servlet in misc/WEB-INF/classes directory, it can not locate the servlet by "http://127.0.0.1:port/misc/servlet/myservlet".
In tomcat, it is good because every time I created a new project, I just create a new directory "misc" parallel to "examples", and I can access that project by "http://127.0.0.1:port/misc/servlet/myservlet". By doing this way, different projects are in different directory. But in OC4J, different projects' servlet has to be in the same directory (I know I can create a directory under WEB-INF/classes called misc, and then call my servlet by "http://127.0.0.1:port/servlet/misc.myservlet, but this is not what I want).
Is there a way to let OC4J to deploy projects like tomcat? The documentation said OC4J is 100% compatible with tomcat, but I think it is not.
Thanks a lot if you can provide help.
Jingzhi

Similar Messages

  • JSPX Migration from Tomcat to OC4J

    We are migrating the web tier of our application from Tomcat 5 to OC4J 10.1.3.0.0. We are having a problem in our jspx files. The code below works in Tomcat but not in oc4j.
    <gc3:viewFieldText name="invoice/invoice_xid" valueIndicator="invoice/indicator">
    <jsp:attribute name="label">
    <x:when select="$mainNode/invoice_type = 'B'">field.invoice/bill_xid</x:when>
    <x:otherwise>field.invoice/invoice_xid</x:otherwise>
    </x:choose>
    </jsp:attribute>
    </gc3:viewFieldText>
    We are trying to dynamically set the label attribute of one of our custom tags using <jsp:attribute> and the jstl xtags. mainNode is a variable bound in the request and based on the result of the XPath expression, we want to dynamically set the label attribute. The XPath expression is correctly evaluated, however instead of passing the text within the x:when or x:otherwise to our custom tag, it just writes it out to the screen.
    If I remove the xtags from the code and hard code the label it works as shown below.
    <gc3:viewFieldText name="invoice/invoice_xid" valueIndicator="invoice/indicator">
    <jsp:attribute name="label">
    field.invoice/bill_xid
    </jsp:attribute>
    </gc3:viewFieldText>
    Let me know if you need any further information.

    Chad,
    10.1.3.0.0 was buggy.
    Try 10.1.3.1.0 or the latest: 10.1.3.2.0
    (Just a suggestion.)
    Good Luck,
    Avi.

  • JAX-RPC on OC4J (Migrating from TOMCAT to OC4J) Problems

    I am attempting to compile and build a simple web service
    to using wsdeploy from Sun's JWSDP1.2. It works fine on Tomcat but when I try to deploy it to OC4J. I get the following error:
    7/23/03 11:58 AM Internal error in HttpServer
    java.lang.ClassCastException: com.evermind.naming.ContextClassLoader
         at com.sun.xml.rpc.server.http.JAXRPCContextListener.contextInitialized(JAXRPCContextListener.java:52)
         at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:583)
         at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:374)
         at com.evermind.server.Application.getHttpApplication(Application.java:657)
         at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:663)
         at com.evermind.server.http.HttpSite.getApplication(HttpSite.java:387)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:378)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:243)
         at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)7/23/03 3:53 PM 9.0.2.0.0
    I've come to notice that Oracle's WebServicesAssembler doesn't use com.sun.xml.rpc.server.http.JAXRPCContextListener but instead uses something else. When the JAXRPCContextListener starts to initialize it trys to perform the following operation:
    classLoader = (URLClassLoader)Thread.currentThread().getContextClassLoader();
    Is there any way to remedy this?? Or is there anything I can do to get this to work??
    Thanks
    Mike

    Have you deployed JAX-RPC onto OC4J? We currently do not have JAX-RPC available on OC4J.
    Mike.

  • Migrating from Tomcat to OC4J

    We are currently just using Tomcat for both HTTP and Servlet engine duties on our web server. The HTTP side is quite slow so
    we have just purchased the 9iAS with OC4J (v.1.0.2.2). The documentation say OC4J is "100%" Tomcat compatible. That's great but current setup uses HTML to build 3 frames then puts an HTML menu in one which has the javascript commands to run java classes via a servlet. We have our index.html in the top level folder, then the menu files in a sub-folder (menu), graphics in another (misc), javascript in another (lib), then the class files are below that in :
    /Web-inf/classes/html...
    /Web-inf/classes/database
    /Web-inf/classes/objecttypes
    /Web-inf/classes/Utils
    Anyone set up this style of application? as the examples only show running servlets directly.

    Sure. Are you having a specific problem, or just wondering if it will work? YOu class files are fine in those subdirectories so long as they correspond correctly with the package names. As far as referencing a servlet whose class is in a package, you do it in OC4J just like in Tomcat - by defining the servlet name and class and mappings in the web.xml file. If you can build a war using Ant and deploy that war to Tomcat, you will find that that war will deploy very nicely to Orion. The only additional work is to add any custom application setup to the Orion configuration files (server.xml, default-web-site.xml, etc) similar to what you would do in the Tomcat server.xml and worker.xml files.
    John H.

  • Migrating from jserv to OC4J

    Are there some documents related to this theme?
    Please help me.
    I'm obtaining an error when i deploy the app to oc4j, referent to jdbc connection.

    There was a generic Migration guide produced for the earlier 9.0.2 release with some content on migrating from JServ to OC4J.
    http://download-west.oracle.com/docs/cd/A97331_08/migrate.902/migrate/intapps.htm#1006415
    It's hard to provide much help without more details.
    cheers
    -steve-

  • Migrating from JServ to OC4J: problems with XSQLServlet configuration

    I'm trying to move an application using xsql pages from 9iAS to 10g (9.04). Development is currently done under JDev9 (9.02) an its OC4J standalone server.
    I guess I've done most of the configurations, since the application is working correctly now, BUT only with the connections defined statically in the XSQLConfig.xml of the XSQLServlet. On JServ, we implemented our own connection manager to pass our connections to the XSQLServlet as defined by the <connection-manager><factory> tag. Now, under OC4J, this no longer works:
    The log files tells:
    Failed to create custom connection manager factory: "our.connection.manager.factory": Using default.
    And with the default one, we get of course the 'cannot acquire database connection' error message which is ok, since we're not using one of those defined under XSQLConfig.xml...
    Background: Our connection manager is contained in a jar file with many other classes. These are visible to the 2 applications ("P" and "T") we're running successfully under OC4J Standalone. As I interprete the message as the XSQLServlet not being able to create an instance of our ConnectionManager, I guess I missed somewhere an library or classpath entry??
    Many thanx for any hints!

    There was a generic Migration guide produced for the earlier 9.0.2 release with some content on migrating from JServ to OC4J.
    http://download-west.oracle.com/docs/cd/A97331_08/migrate.902/migrate/intapps.htm#1006415
    It's hard to provide much help without more details.
    cheers
    -steve-

  • Migration from tomcat to weblogic 10.3.2

    Hi,
    I am developing a web application, its a servlet which basically acts as a front end for a web service,
    and I use CXF for the web service client, tested under a development tomcat instance and worked fine.
    I have the spring framework and the rest jars in the lib:
    wsdl4j-1.6.1.jar
    wss4j-1.5.8.jar
    jaxb-api-2.0.jar
    cxf-2.2.3.jar
    while I try to migrate to weblogic 10.3.2 follow the change as in
    http://cxf.apache.org/docs/application-server-specific-configuration-guide.html#ApplicationServerSpecificConfigurationGuide-WebLogic
    Then I got the exception:
    java.lang.IncompatibleClassChangeError: Class com.ibm.wsdl.DefinitionImpl does not implement the requested interface javax.wsdl.extensions.AttributeExtensible
    at org.apache.cxf.wsdl11.WSDLServiceBuilder.copyExtensionAttributes(WSDLServiceBuilder.java:137)
    at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.java:277)
    I have been research on this problem for a while, found some posts from experts like Dan on Nable...
    but I still didn't get it, could anyone help on this.
    Joelking

    can u let us know how did you resolve this?

  • Upgrade from tomcat to OC4J 10.1.3 jsp parser exception in tag lib

    i have problem in oc4j jsp parser
    but it work ok on tomcat as tomcat using jasper-compiler.jar
    when run on oc4j it give me the exception
    OracleJSP: oracle.jsp.parse.JspParseException: /jsp/layouts/elec/pageheading.jsp: Line # 3, <aa:h1 wrapped="true" labelKey="${heading1BundleKey}"/>
    Error: Errors parsing tag :h1 oracle.jsp.parse.JspParseException: /jsp/layouts/elec/pageheading.jsp: Line # 3, <aa:h1 wrapped="true" labelKey="${heading1BundleKey}"/>
    Error: oracle.jsp.provider.JspCompileException: <H3>Errors compiling:E:\oc4j\j2ee\home\application-deployments\default\sc40\persistence\_tagfiles\_oracle\_jsp\_tag\_aacom\_h1_2e_tag.java</H3><TABLE BORDER=1 WIDTH=100%><TR><TH ALIGN=CENTER>Line #</TH><TH ALIGN=CENTER>Error</TH></TR><TR><TD WIDTH=7% VALIGN=TOP><P ALIGN=CENTER>191</TD><TD> non-static variable _jspFragWriter cannot be referenced from a static context
    _jspFragWriter = null;
    -------------------------------------------------------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    and i have problem in web.xml
    as i using jsp servlet in jasper-compiler.jar in tomcat package
    <servlet>
    <servlet-name>jsp</servlet-name>
    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <init-param>
    ------------------------------------>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    i try to use this package in oc4j but i can not
    i put this servlet in global-web-application.xml instead of
    <servlet>
         <servlet-name>jsp</servlet-name>
    <servlet-class>oracle.jsp.runtimev2.JspServlet</servlet-class>
    ------------------>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    to make oc4j depend on tomcat parser it give me
    classnotfound mean that (oc4j can not found package) this printed in global-application.log
    i make
    <library path="E:/oc4j/j2ee/home/applib/jasper-compiler.jar"/>
    and still have problem
    any 1 have idea using tomcat parser in oc4j
    or have idea solve this problem
    thanx
    Message was edited by:
    [email protected]
    Message was edited by:
    [email protected]
    Message was edited by:
    [email protected]
    Message was edited by:
    [email protected]

    OC4J 10.1.3 does support JSP 2.0, as well as custom tag libraries (including JSTL 1.1).
    There are two approaches to configuring a custom tag library for use in JSPs served by OC4J:
    1) Package the JSTL or custom tag library with your application:
    i. include the necessary JAR file in your web app's /WEB-INF/lib folder
    ii. include the relevant Tag Library Descriptor (TLD) file(s) in your web app's /WEB-INF folder
    iii. for each TLD, add a <tag-lib> element to web.xml referencing the TLD file's location and taglib URI
    2) Place the JSTL or custom tag library in an Application Server instance-level directory ($ORACLE_HOME/j2ee/home/jsp/lib/taglib) to make them available to multiple applications (in all OC4Js installed in the Oracle Home)
    For example, if you'd like to use the JSTL 1.1 Core and Internationalization Tag Libraries, do one of the following:
    1) Package the JSTL or custom tag library with your application:
    i. Obtain an implementation of JSTL (e.g. Jakarta Taglibs) and include the standard.jar and jstl.jar files in your web module's /WEB-INF/lib directory
    ii. From the JSTL implementation you're using, also copy the c.tld and fmt.tld Tag Library Descriptors to your web module's /WEB-INF/lib directory
    iii. Add the following elements to your web module's web.xml file:
    <jsp-config>
    <taglib>
    <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
    <taglib-location>/WEB-INF/c.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>http://java.sun.com/jsp/jstl/fmt</taglib-uri>
    <taglib-location>/WEB-INF/fmt.tld</taglib-location>
    </taglib>
    </jsp-config>
    OR
    2) Copy the standard.jar and jstl.jar libraries from the JSTL implementation you're using to $ORACLE_HOME/j2ee/home/jsp/lib/taglib

  • Migrating from Tomcat to WebSphere

    I have a JSF application which works correctly under tomcat web-server. But when I tried to migrate this application to IBM WebSphere I was suprised to dicover that it didn't work at all. I found a lot of differences between how WS and Tomcat interprete faces-config. Moreover WS parser doesn't understand tags like "<tagname \>".
    Maybe somebody has already faced with such a problem and can tell me something how to solve it.

    WebSphere version is 6.

  • Request.getParameter returns null - Converting webapp from Tomcat to oc4j

    I support a simple web app that passes arguments via url context variables. For some reason it does not work in OC4J. When I use request.getContextPath() I see that the URL string only contains the webapps name, not the whole URL with parameters set.
    BTW it is an OC4J cluster

    *Name:             index.jsp
    *Function:         This page is 1st url for WebApp
    *Information:      This page is used as the home page for this application.
    *Version:          1.0 (created on 2005-06-06)
    * 2.0 052406 pge
    %>
    <%@ page pageEncoding="UTF-8"%>
    <%@ page import="com.hp.itsm.api.*" %>
    <%@ page import="com.hp.itsm.api.interfaces.*" %>
    <%@ page import="java.text.Collator" %>
    <%@ page import="java.util.*"%>
    <%@ page contentType="text/html; charset=utf-8" %>
    <%@ include file="include/variables_initialize.jsp" %>
    <%@ include file="include/methods_global.jsp" %>
    <%@ include file="include/methods_servicedesk.jsp" %>
    <%
    String login = request.getParameter("u");
    String xxx = request.getContextPath();
    //Service Call objects
    ApiSDSession SDsession = null;
    IPerson[] personList = null;
    IAccount accountRequester = null;
    Boolean bError = Boolean.FALSE; //Default to no errors found
    List errMsgList = new ArrayList(); //Array of error messages
    //Get account information
    accountRequester = getAccount(SDsession, login);
    if (accountRequester == null) {
    bError = Boolean.TRUE;
    errMsgList.add("Could not retrieve the accountRequester.");
    }

  • Migrating WebServices app from Tomcat to Glassfish...

    Hello!
    I've a WebService app. which now runs on Tomcat 5.5.23 and was written using JAX-WS. I've install Sun Java System App. Server 9.0 and I intend to migrate our app. here.
    The application is delivered as a war file which I've already deployed in glassfish using admin GUI of asadmin. I can see our app. at WebApplications section but I can't see it under WebServices section, although it seems at a first view that the application works and respond to client's request.
    I'd like to ask you if I need to use a special tool for migrating our aplication or what I did is enough and there is no need for other changes.
    Thank you very much
    With best regards,
    Sorin

    If I understand correctly, you are trying to load a few properties files on WLS that is specific to an application that you are migrating from tomcat to WLS. If that is the case, then as per my understanding we have the following options:
    a. Add all the properties in a jar file and add the same to the classpath or place the same in the lib directory of the server which can be picked at the server start-up.
    b. Place the properties file in the domain home which should help.
    Refer: loading a new properties file without restarting the managed server
    c. Else place the properties files in the web-inf of the application, that should help.

  • Urgent!!!!How to deploy only an EJB from Weblogic to oc4j.

    Hi
    How can i deploy only EJB from Weblogic into oc4j without any web application or client coming into pitcture as my client access bean remotely....
    regards,
    Sapthapathi

    If you are migrating from ejb1.1->ejb1.1 you shouldn't have many changes - your ejb-jar.xml file should be the same (I assume you are still talking about ejbs). Once you pull over the base ejb - then if you want to, mess around with the automatically generated orion-ejb-jar.xml file. Obviously - those are all app server specific. I go back and forth between wls6.1 and oc4j all the time. When going from wls5.1 to oc4j - what particular issues do you run into. What do you mean, in particular, by configuration changes?
    Curious -
    Ray
    hi,
    EJBs and other applications can be migrated from weblogic to oc4j but many changes are required.These changes are mainly configuration changes rather than code changes.Infact there are many problems in effect while migrating and delloyment.Hope oracle is a bit more attentive to this issue.
    regards,
    chennai

  • From Tomcat-Apache to OC4J

    I4m migrating an application from Tomcat-Apache to OC4J. I have a problem whith a taglib in a Servlet call a JSP that use a taglib.
    In the JSP call a taglib whith:
    <%@ taglib uri="/oficios" prefix="portalOficios"%>
    <jsp:useBean id="resultado" scope="session" class="com.npevolution.util.SQLResult" />
    <portalOficios:iteracion nombres="codigo" tipo="String" group="<%= resultado%>">
    <% String campoCodProv = (String)pageContext.getAttribute("campo0");%>
    <%String campoNombProv =(String)pageContext.getAttribute("campo1");%>
    </portalOficios:iteracion>
    thank you;
    Esther

    I looked at the code after a jsp compiled to a servlet. The
    jspService method of "EditTmpForm.jsp" is about 801 KB. But for another jsp "EditOperation.jsp", the  jspService method is about 236 KB.
    Both are much greater than 64 K, but why it runs okay for "EditOperation.jsp" but gives me error for "EditTmpForm.jsp"?
    Furthermore, since the HTML form is long, so the HTML code itself is bigger than 64 K, how can you prevent your _jspService method so that is is shorter than 64K?
    Thanks for your help!
    James

  • Problem with servlet after migrating from OC4J to WebLogic 10.3

    I come across a problem when I was migrating from jDev 11g TP4 to production version in that step also server got changed from OC4J to webLogic.
    I am running java http servlet along other jspx pages. When everything was on OC4J there was no problem whit security on this servlet ( servlet was under same authorization automatically, and I was able to create new application module on this servlet by createRootApplicationModule
    ) but when I changed to WebLogic 10.3 I come across a numerous problems. First one is solved i managed to put the servlet under same authorization as jspx pages by
    *&lt;servlet&gt;*
    *&lt;servlet-name&gt;report&lt;/servlet-name&gt;*
    *&lt;servlet-class&gt;path.to.class&lt;/servlet-class&gt;*
    *&lt;security-role-ref&gt;*
    *&lt;role-name&gt;name&lt;/role-name&gt;*
    *&lt;role-link&gt;valid-users&lt;/role-link&gt;*
    *&lt;/security-role-ref&gt;*
    *&lt;/servlet&gt;*
    but when I trying to create new application module I get JBO-30003 error which is Caused by:
    oracle.adf.share.security.ADFSecurityAuthenticationException: JAAS login error.
    Invalid null input: name
    Has anybody any idea what I am doing wrong?
    Thank you for your help, Rok Kogov&scaron;ek

    for example:
    web.xml
    <security-role>
    <role-name>yourrole</role-name>
    </security-role>
    weblogic.xml
    <security-role-assignment>
    <role-name>yourrole</role-name>
    <principal-name>wlsuser</principal-name > <!-- wlsuser is define at wls console-->
    </security-role-assignment>

  • Migration from weblogic6.1 to OC4J

    Hi,
    We are evaluating OC4J to migrate our application (EJB2.0). Currently we are evaluating weblogic6.1 too. We have 66 local entity beans and 7 session Facade(for those local Entities) beans. It's perfectly working with weblogic.
    Here I would like to mention that OC4J talks NOTHING about how to specify OC4J-specific XML descriptors. 'How to create EJB2.0' compatible stuff are already provided by SUN & co. OC4J-docs must also say how to deploy it into OC4J. HOW CAN "OC4J" EXPECT THE DEVELOPER TO START EASILY TO MIGRATE FROM another APP-SERVER?
    Allright, this is the problem we are facing after INVENTING some of "how to specify OC4J-specific XML descriptors" on our own. Please correct me if anything is incorrect.
    When we tried to deploy into OC4J, we couldn't invoke local entity beans using JNDI lookup.
    Weblogic gives two tags "jndi-name" & "local-jndi-name" to specify JNDI names of remote & local respectively.
    Orion has only one 'location=' attribute to specify JNDI location for a bean, for Entity beans presumably it takes for remote-beans, even if I don't specify any remote home/interfaces.
    OC4Js 'How-To: Implement Local Interfaces' says that we need to have 'ejb-local-ref' in each referring ejb. In that case I've to create atleast 50 'ejb-local-ref' tags in each of my 7 session beans. Is that really OK?.
    I would like to know whether there is any way of specifying JNDI names for local CMP's in one place, not in all other referring EJBs.
    Please advise.
    Thanks,
    Sasikumar.

    Hi Sasikumar,
    In order to fully understand your situation, please answer the following
    questions:
    1. Are you using the latest, standalone, production version of OC4J
    (version 9.0.2.0.0)?
    2. Are you using Java 2 SDK version 1.3.1_02?
    3. Are you using Windows2000?
    4. Are you using the latest, production version of JDeveloper 9i?
    5. Have you read the documentation for OC4J -- available from
    http://tahiti.oracle.com
    6. Do you know about the "BEA to Oracle Migration Kit"?
    http://www.oracle.com/consulting/start/BEAmigration/intro.html?src=1260040&Act=8
    and
    http://technet.oracle.com/products/ias/pdf/weblogic_migration.pdf
    7. Do you know about these other, OC4J related web sites:
    http://www.orionserver.com
    http://www.orionsupport.com
    http://www.atlassian.com
    http://www.elephantwalker.com
    8. Do you know about these tools for automatically creating EJB related
    files (including XML deployment descriptors)
    http://beust.com/cedric/ejbgen/
    http://opensource.itplus.dk/EJBCreator/index.html
    http://www.myhtg.com/product.html
    So if you haven't exhausted all of the above, I suggest you do so
    before throwing a tantrum about OC4J. If you have exhausted the above,
    and you still can't work with OC4J, then I suppose you could always
    just stick with BEA (couldn't you :-)
    Good Luck,
    Avi.

Maybe you are looking for