How to access contextRoot in Servlet deployed in an ear in Weblogic 81

Hi,
I need to access the contextRoot or webapp name from a startup servlet deployed in WebLogic. I've tried the following;
getServletContext().getRealPath("/") return null.
getServletContext().getServerInfo() returns Weblogic 8.1 service pack 3...
getServletContext().getServletContextName() display the <display-name> value from my web.xml.
What I want is the <context-root> value in the EARs application.xml.
I tried the following JNDI lookup and the lookup failed but the error message contained the contextRoot.
String name = (String) jndiContext.lookup("java:/comp/env/namespace");
log.info("jndiContextlookup namespace = "+name);
Any help would be GREATLY appreciated. This should be easy!!
Shane

Hi VR
From Weblogic Admin Console, Deployments, on right side click on the link named with your EAR Application. It opens detailed page with more tabs. Click on the tab named Targets. Here select your WebService module and click on Change Targets button. Uncheck the server where it is targetted (Deployed), click on Yes. And activate the changes.
Thanks
Ravi Jegga

Similar Messages

  • How to access to Business Components deployed to Oracle 8i

    Hi,
    I succeded in deploying an Application Module to Oracle 8i and publishing it through JNDI.
    The test wizard is also ok.
    Now I obviously want to access the module from a client.
    The lookup phase is successful, but what I get back is a oracle.jbo.common.remote.corba.RemoteApplicationModuleHome, and I suppose I have to invoke its create() method to get some actual Module object reference.
    The proble is that the create() method wants a strange SessionInfo parameter, that seems undocumented.
    Does anyone know how to solve the problem ?
    Or where is the necessary documentation ?
    Thanks in advance
    Giuseppe Tanzi

    Hello!
    Sorry for the delayed response...
    Here is an EJB client for a BC4J-EJB in 8i:
    package tester;
    import java.lang.*;
    import oracle.jbo.*;
    import oracle.jbo.JboContext;
    import java.util.Hashtable;
    import javax.naming.*;
    /*This project properties should include:
    JBO EJB Runtime, JBO EJB Client and User created Library .
    public class BC4J_EJB_test extends Object {
    static Hashtable env = new Hashtable(10);
    public static void main(String[] args) {
    // set up variables for environment settings
    // Modify User, Password, HostName, SID and DeployedMod
    String User = new String("BUD");
    String Password = new String("SPUD");
    String DeployedMod = new String("BC4J.BC4JModule");
    String HostName = new String("jtora815.us.oracle.com");
    String ConSid = new String("ORCL");
    //IIOP Port MUST BE A STRING!!!!!!!!!!
    String ConPort = new String("2481");
    String ApplicationPath = new String("test/ejb");
    String Conn = new String("jdbc racle:kprb:");
    try {
    // set variables in hashtable to be used as the environment
    env.put(Context.INITIAL_CONTEXT_FACTORY, JboContext.JBO_CONTEXT_FACTORY);
    env.put(Context.SECURITY_PRINCIPAL, User);
    env.put(Context.SECURITY_CREDENTIALS, Password);
    // only difference other than libraries from 8i Corba
    env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_EJB);
    env.put(JboContext.APPLICATION_PATH, ApplicationPath);
    env.put(JboContext.HOST_NAME, HostName);
    env.put(JboContext.CONNECTION_PORT, ConPort);
    env.put(JboContext.ORACLE_SID, ConSid);
    // setup application module variable
    ApplicationModule appMod = null;
    javax.naming.Context ic = new InitialContext(env);
    ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup(DeployedMod);
    appMod = home.create();
    //connect application module
    appMod.getTransaction().connect(Conn);
    /* At this point you have the application module connected, now do what you want
    here. This example just iterates through the dept table and prints each row */
    ViewObject deptVo = appMod.findViewObject("DeptView");
    Row r = deptVo.first();
    do{
    System.out.println(r.getAttribute("Deptno")+" "+
    r.getAttribute("Dname") +" "+
    r.getAttribute("Loc"));
    r = deptVo.next();
    }while( deptVo.getCurrentRowSlot()!= deptVo.SLOT_BEYOND_LAST );
    catch(Exception Oops) {
    Oops.printStackTrace();
    System.out.println(Oops.getMessage());
    Hope this helps.
    Regards,
    Arun

  • How to Access the Remote Servlet through a JSP Page

    Hi ,
    I wrote a servlet in my local system and It is running very well in my tomcat server5.5. Now I write a JSP code an another one system. Now I don't know how to call my servlet when Click a submit button. I need a small example or idea about this. Help me
    Thanks in advance,
    Maheshwaran Devaraj

    Just like any other servlet or form-processing script. What would a mere HTML page know about "systems"? Put the URL into the form destination attribute and be done.

  • Error while deploying Web Service EAR to weblogic 10.3

    Hello All,
    I am getting the following errors when I "Activate changes" on the console after deploying the EAR file.
    An error occurred during activation of changes, please see the log for details.
    Error weblogic.application.ModuleException:
    Error port component:"StockQuotePortImpl" - wsdl port:{http://sun.com/stockquote.wsdl}StockQuotePortImplPort is not found in wsdl.
    The stack trace in the Workshop has the following:
    Caused by: weblogic.wsee.ws.WsException: port component:"StockQuotePortImpl" - wsdl port:{http://sun.com/stockquote.wsdl}StockQuotePortImplPort is not found in wsdl.
    I don't understand the problem. Is it something to do with the contextPath of the WS. If so, I have the <WLHttpTransport> element as a child of <jws> element and that has teh contextPath, port seviceURI etc.
    The WS builds fine and WAR/EAR created fine but I get this exception when I deploy.
    Any clues as to what is going wrong will be very helpful..
    Thanks much.

    Nevermind, I figured it out.
    I had to change the name of my JWS class (the one that implements the web service methods) and then it worked fine.
    Thanks to all who responded.

  • How to access the archive folder in jive forums programiticaaly

    hi
    how to access the archive folder in jive forums programitically using weblogic 10.3
    Thanks
    Rani

    Ah, I'm sorry - I thought it was the private folder in C drive that I had managed to get into the previous week but it was the private folder in mass storage ...
    If you want to thank someone, just click on the blue star at the bottom of their post

  • How to access  j2ee servlet directly?

    Hi All,
    I have a question about Doc 333862.1
    My customer wants to follow test case in the CAUSE section.
    He wants to call SimpleServlet with bellow URL.
    http://hostname:port/j2ee/servlet/SimpleServlet
    When I execute it in our test instance, I can't access j2ee servlet directly and faced bellow HTTP 403 Forbidden warning.
    "You don't have permission to access /j2ee on this server."
    How to access the SimpleServlet?
    If you have any solution or advice, please give me the feedback freely.
    Regards,

    <i>how to create a new project of type J2EE -> EJB Module Project.</i>
    First of all u need to have NWDS.
    There go to File -> New -> Project -> Select J2EE -> Select EJB Module Project
    <i>any prerequisites required to create this apart from the java gui</i>
    None. U may create the project here in NWDS and can deploy on XI server.
    <i>all in all i want to find how to access J2EE explorer.</i>
    J2EE Explorer can be seen under Windows -> Show View -> J2EE Explorer
    Regards,
    Prateek

  • How to access deployed J2EE Web application ?

    Hi,
    I am new to J2EE Web Application. I have created a Web Module project and in that I have created a servlet. I did a build for WAR file. I have created an Enterprise Application Project and included this WAR file. I built  the EAP and deployed it to J2EE engine. I am successful till here.
    I am not sure how to access this deployed application and thus this servlet.
    I tried to access the following way :
    http://<hostname>:<portnumber>/<EAPName>/<ServletName>
    However, I receive the error no such location.
    In the web.xml file, in the servlet-mapping section, I have mentioned the servletname and urlpattern.
    I have mentioned the urlpattern as MyServlet and not /MyServlet. Notice the 'backslash'.
    Could this be an issue ?
    Regards,
    Subramanian V.

    Hi
    See this Thread
    Re: servlet ----->url association ?
    Re: Servlet not getting loaded when put in a jar file
    Re: I just want to run a simple servlet. No EJBs, no Web DynPro...
    /message/610344#610344 [original link is broken]
    Kind Regards
    Mukesh

  • How to access XM attribute name in servlet ?

    Hi All,
    Anybody please tell me how to access attribute name in servlet ?
    Thanks

    Hi All,
    I have modified the source code of af:showDetailItem as following:
    <af:forEach items="#{bindings.VerticalAppMenus.children}" var="globalMenu" varStatus="globalMenuVarStatus">
               <af:showDetailItem text="#{globalMenu.MenuLabel}" id="sdi1" disclosureListener="#{pageFlowScope.globalMenus.refreshLineMenus}"
                 disclosed="#{(pageFlowScope.globalMenus.currentVerticalMenuId == globalMenu.MenuId) ? true : false}">
                  <f:attribute name="currentVerticalMenuId" value="#{globalMenu.MenuId}"/>
    </af:showDetailItem>
    </af:forEach>For the code *disclosed="#{(pageFlowScope.globalMenus.currentVerticalMenuId == globalMenu.MenuId) ? true : false}"*, at runtime it is giving the following error:
    *java.lang.IllegalArgumentException: Cannot convert 32 of type class oracle.jbo.domain.Number to class java.lang.Long*.
    Is there any way to cast the long to number or number to long in EL?
    Any help will be highly appreciated
    Thanks ... Best Regards
    Bilal
    Edited by: Bilal on 04-Apr-2012 19:32

  • How to access a view object under a nested appmodule in servlet

    Hi,
    Can anyone tell me how to access a view object under a nested appmodule in a servlet?
    I know that I can use
    ApplicationModule app = Configuration.createRootApplicationModule(amDef, config);
    ViewObject vo = app.findViewObject(viewObjectName);
    to get hold of an appmodule and view object.
    But in a nested appmodule, for example, I have am0 as root, am1 as child, and voZ within am1, what should I use for this amDef? config? and viewObjectName?
    Your help would be much appreciated.

    Hi,
    http://radio.weblogs.com/0118231/stories/2005/07/19/nestedApplicationModules.html
    Frank

  • How to access attribute name (xml) in Servlet ?

    Hi All,
    Anybody please tell me how to access attribute name in servlet ?
    Thanks

    Parser.java
    public class Parser
    public static String getAtt()
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              factory.setNamespaceAware(true);
              DocumentBuilder parser = factory.newDocumentBuilder();
              Document doc = parser.parse("customer.xml");
              Element root = doc.getDocumentElement();
    return root.getAttribute("name");
    public static void main(String [] argc)
    Parser p = new Parser();
    p.getAtt();
    Servlet.java
    Parser p1 = new Parser();
    String att1 = p1.getAtt();
    Hope this will help u.
    ....yogesh

  • How to access dataTable1Model/row-set in a Servlet???

    Hi,
    Does any one know how to access a rowset / dataTable(of page 1) in a servlet?? Basically I want to access to data in rowset/dataTable.
    Here is what I am doing,
    page bean generates Excel file and servlet downloads the generated excel file to clients PC.
    Ideally I should access the rowset/dataTable in a servlet, generate Excel file and download to clients PC.
    Any ideas????
    Cheers
    kush

    Helloooooooo!!
    Any Clues?????????
    Cheers
    kush

  • Deploying EAR, how to access ?

    I've already deployed and enabled ear files. How can I access it, if the ear file is called bapp.ear, which is correctly listed in Application Server as deployed app ?

    If your app has a web component then you cann access the components through http://<hostname>:8080/<context-root>. If it is a pure EJB app, then you can have an app client access the EJBs. What is your exact scenario ?

  • How to access .html in tomcat

    I am very new to programming. I have created an html file (ThreeParamsForm.html) and placed it in development directoy. I am unsure of how to access that file. When i am typing http://localhost/ThreeParamsForm.html it is giving me HTTP Status 404 error. I have tried using servlets but they seem to be working fine. It is only htmls which i am unsure how to access. please help

    I think it may be considered bad practice to include all your web applications in the root directory.
    Instead, why don't you deploy each web application in it's own directory with a deployment descriptor.
    Your directory structure should look like this:
    [TOMCAT_HOME]
    --|\webapps
    ----|\MyWebApp
    ------|index.html
    ------|\WEB-INF
    --------|web.xmlYou'r web.xml file might read like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app>
         <context path="/MyWebApp" />
    </web-app>This so when you browse to your web site, you will go to http://localhost/MyWebApp

  • How to access a  web service(.wsdl) from portal component.

    Hi ,
    Is there any document/tutorial available on how to access a webservice from portal component ?
    I have found this linkhttps://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/ep/g-i/how to access a web service.htm...
    but the urls in the link are not working...
    i want  to know the steps to access webs service and sample code if some body has already done that..
    Thanks for the help.
    Lakshmi

    Hi Lakshmi,
    See the links below:
    http://help.sap.com/saphelp_nw04/helpdata/en/f0/581140d72dc442e10000000a1550b0/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/a3/918340d990ce62e10000000a155106/content.htm
    Hope this helps.
    Regards,
    Pooja.

  • How to access and display a Web Service from a WSDL in JSP or JSTL ?

    Dear All,
    We need to access a Web Service which is hosted as WSDL How to access a WSDL file from JSP or JSTL, parse and display the SOAP response in JSP page.
    Any simple example or URL as reference to an example will be useful for me.
    It seems io tags of jakarta is able to send soap message, but how to display it in JSP.
    Yours,
    Sankar.B

    Dear Sir,
    Yes. I would like to know more about the Forte and how to consume WSDL file from JSTL. The following are my querirs.
    1. How to connect the declared JNDI from a JSP page. i.e: the Datasource - ex: booksDS
    2. We connect the Tomcat server using JNDI as jdbc/scott. But, if I give jdbc/scott in JSTL as datasource={jdbc/scott}, we could not able to connect. We use the following code in a JSP page to connect the DB from a JSP page. (Its quite easy to modify, so we use the connection in a JSP page.)
    3. How to Consume a WSDL url from JSTL. Ex: If there is a URL : http://localhost/ws/MathService.asmx?wsdl OR http://www.xmethods.com/test/BabelFish
    4. How to display the result. We tried via SOAP from io taglib of Jakarta, but gives us an SOAP (it also looks like xml) response. But, how to use the value from that soap response in IE client thru JSTL/JSP.
    5. Whether this JSTL tool will be available with Forte Enterprise/Community Edition. If so EE, whats the price.
    Please Reply Immediatly. We tried, trying, going to try to display a wsdl response, but not able to display in IE thru JSP/JSTL. But, weve tested the www.gotdotnet.com examples of asp.net web services, we are thru. Its quite easy it seems in .NET. But, we feel whether even there is not even one example in JSTL/ Java Web Services Dev. Pack to utilise a web service in full cycle. The example which uve given is thru servlets. We dont use servlets. Cos, its very easy to edit JSP pages, instead of compiling the serv. and using it.
    I hope ull reply for all the above queries, since ur from SUN.
    Expecting your fav. reply.
    Yours,
    Sankar.B

Maybe you are looking for

  • How to get all values in the range of select option into internal table?

    Hi, I need to capture all entries coming in the range of select option into one internal table. How to do get that? For E.g select-options: matnr for mara-matnr.(select option) IF I enter G0100013507892 as lower value of matnr and G0100014873947 as h

  • XP, Vista and Dual Core

    I have a Lenovo N500 (Pentium duel core T3400 2.16, 3GB) Vista and my hard disk has failed (After 18 months!!!!). The only recovery disks I have are XP Recovery/Downgrade. I have put a new hard drive in and used the XP recovery disk, after the instal

  • Problem with L193pC display: not coming on intermitently

    Hi, I have a problem with my new L193pC ThinkVision display. My setup is this: - Lenovo laptop 3000 N200 0769-A8U with Windows XP and all the latest updates installed - Lenovo L193pC display hooked up to the laptop's analog output This is a work envi

  • How to gradually change the brightness in a movie

    Hi I have done a lipdub in my school last week and i have a problem when i view the movie: The light is very bright in some places and some other places are too dark. I found a way to change the lighting but it's not gradual. It's very brief and it c

  • Failed to fetch a list of all custom record types

    Hi, I tried to fetch a list of all custom record types. I tried with below piece of code, but failed with below error message. Can anybody help me to resolve this issue: CustomRecordTypeReadAll_Input cusRecTypeAllIn = new CustomRecordTypeReadAll_Inpu