How to Connect to the Visibroker Naming Service using the Servlet

Hi
I am facing Problem in finding the Initial JNDI Context.
It is giving me ClassCastException.
In our Application the Tomcat is Integrated with One of the Partitions. And the EJB' are registered on Visibroker Naming Service (on the same machine).
I want to Access one of the EJB's.
Following is my Client Code in the Servlet.
==============================================================================
public void doPost(HttpServletRequest request, HttpServletResponse res)
throws IOException, ServletException
res.setContentType("text/html");
PrintWriter pw = res.getWriter();
pw.println("<html>");
try{
Enumeration e= super.getInitParameterNames();
while(e.hasMoreElements())
String paramName= (String)super.getInitParameterNames().nextElement();
String paramValue=super.getInitParameter(paramName);
pw.println("paramName="+paramName);
Context ic;
java.util.Properties props = new java.util.Properties();
props.putContext.INITIAL_CONTEXT_FACTORY, "com.inprise.j2ee.jndi.CtxFactory");
props.put(Context.URL_PKG_PREFIXES, "com.inprise.j2ee.jndi");
ic = new InitialContext();
pw.println("Initial Context"+ ic);
========================================================================
And I am getting following Error while getting the Inital Context.
============================
ERROR - javax.naming.NoInitialContextException: Cannot instantiate class: com.inprise.j2ee.jndi.CtxFactory [Root exception is java.lang.ClassCastException]
2006-09-30 05:16:27,461 ERROR - at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
2006-09-30 05:16:27,461 ERROR - at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
2006-09-30 05:16:27,461 ERROR - at javax.naming.InitialContext.init(Unknown Source)
2006-09-30 05:16:27,461 ERROR - at javax.naming.InitialContext.<init>(Unknown Source)
2006-09-30 05:16:27,461 ERROR - at com.lucent.omcran.servlet.OmcRanTpuGuiReDirectServlet.doPost(OmcRanTpuGuiReDirectServlet.java:56)
2006-09-30 05:16:27,461 ERROR - at com.lucent.omcran.servlet.OmcRanTpuGuiReDirectServlet.doGet(OmcRanTpuGuiReDirectServlet.java:33)
2006-09-30 05:16:27,461 ERROR - at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
2006-09-30 05:16:27,461 ERROR - at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
2006-09-30 05:16:27,461 ERROR - at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:248)
2006-09-30 05:16:27,461 ERROR -
===========================================
Below are the Parameters that I use to Start my Partition
=============================================================================
-Diems.locator.localzonetype=presentation -Diems.arm.context=presentation -XX:+DisableExplicitGC= -XX:+UseCMSInitiatingOccupancyOnly= -DAPPNAME=appl1 -DContextId=1 -DCOMMONPATH=/omcsw/common -DIEMSPATH=/omcsw/28.0.1.22.00 -Djava.util.prefs.PreferencesFactory=com.lucent.iems.platform.util.prefs.spi.IEMSPreferencesFactory -Dcom.lucent.iems.prefs.PrefsDirectory=/omcsw/28.0.1.22.00/data/registry -Dorg.omg.CORBA.ORBClass=com.inprise.vbroker.orb.ORB -Dorg.omg.CORBA.ORBSingletonClass=com.inprise.vbroker.orb.ORBSingleton -Djavax.rmi.CORBA.StubClass=com.inprise.vbroker.rmi.CORBA.StubImpl -Djavax.rmi.CORBA.PortableRemoteObjectClass=com.inprise.vbroker.rmi.CORBA.PortableRemoteObjectImpl -Djavax.rmi.CORBA.UtilClass=com.inprise.vbroker.rmi.CORBA.UtilImpl -Diems.arm.factory=com.lucent.iems.platform.util.arm.impl1.ARMFactoryImpl1 -Dcom.lucent.iems.platform.util.intfc.maxnumofobjects=25 -DGUMDBPOOLNAME=GUMdb -Dvbroker.orb.enableKeyId=false
==============================================
Does Any one have Idea what is going wrong..
Ankit

You can check whether any cookies were sent in the request to your servlet:
Cookie cookies[] = request.getCookies();
if cookies is not null (cookies != null) then the browser sending you the request suppoerts cookies.
If it is null then you would need to do a little extra work. Basically add a cookie to the response going back to the browser. Then send a redirect back to this same servlet. You then would have to add code to check to see whether the cookie was sent back.
// Servlet named myServlet
String test = request.getParameter("TEST");
Cookie cookies[] = request.getCookies();
if (test == null || !test.equals("TRUE")
if (cookies == null)
response.addCookie("testCookies","testCookies");
response.sendRedirect("myServlet?TEST=TRUE");
else
// cookies were sent in the initial request, so
// browser supports cookies
else
// This is the redirect. Check the for the presence of
// our testCookie
Hope this helps.

Similar Messages

  • How to connect to database in web service??

    Hi all,
    How to connect to database in web service ? Can anyone give some advice what kind of database should i use? thanks

    No difference. Just connect as usual!
    Let me give you an example:
    Code to connect to postgresql db ...
    public Connection connectPostgresql(String servername, String dbname, String username, String password)
              Connection conn = null;
              try
                        // Load the JDBC driver
                        String driverName = "org.postgresql.Driver";
                        Class.forName(driverName);
                        // Create a connection to the database
                        String url = "jdbc:postgresql://" + servername +  "/" + dbname;
                        conn = DriverManager.getConnection(url, username, password);
                        return conn;               
              catch (ClassNotFoundException e)
                        // Could not find the database driver
                        return conn;
              catch (SQLException e)
                        // Could not connect to the database
                        return conn;
    }Code for an axis web service ...
    public Element[] updateProfile(Element[] params)
              String message = "";
              // get str 1
              Node node1 = params[0].getFirstChild();
              String str1= node1.getNodeValue();
              // get str 2
              Node node2 = params[1].getFirstChild();
              String str2= node2.getNodeValue();
              Connection conn = connectPostgresql ("localhost","myDatabase","myUsername","myPassword");
              // there is a method to insert these params to db
              boolean isInserted = insertParams(conn, str1, str2);
              if(isInserted )
                        message = "OK";
              else
                        message = "Not OK";
              // constructs an array of DOM Elements for message to send back to client
              SOAPBodyElement[] response = new SOAPBodyElement[1];
              response[0] = new SOAPBodyElement(XMLUtils.StringToElement("urn:foo", "e1", message));
              return response;
    }Gokce.

  • Does anyone know how to connect an older 20" cinema display with the (ADC) adapter end and connect it to a MacBook Pro 17" 2008 model (DVI) ?????

    Does anyone know how to connect an older 20" cinema display with the (ADC) adapter end and connect it to a MacBook Pro 17" 2008 model (DVI) ?????

    I believe you naeed the Apple ADC to DVI adapter.

  • How can I convert .pdf file to .doc using the free adobe reader app? when I try to convert the .pdf file it asks me to sign in. when I click on "sign in", I am taken to a service subscription page. So, no free conversions using free adobe reader app?

    how can I convert .pdf file to .doc using the free adobe reader app? when I try to convert the .pdf file it asks me to sign in. when I click on "sign in", I am taken to a service subscription page. So, no free conversions using free adobe reader app?

    As has been mentioned Adobe Reader cannot export PDF page content. Nor can it create PDF or manipulate PDF page content.
    What you can do is use one of Adobe's online subscription services. Two provide for PDF  to Word export.
    There's ExportPDF and PDF Pack.
    Be well...

  • HT204387 Hello!  Can anyone teach me how to connect iphone 4S to ipad retina using bluetooth. I tried, but the devices won't discover each other at all. I just wanted to connect to share contact details so I don't have to key in one by one.   Many thanks

    Hello!
    Can anyone teach me how to connect iphone 4S to ipad retina using bluetooth. I tried, but the devices won't discover each other at all. I just wanted to connect to share contact details so I don't have to key in one by one.
    Many thanks
    Injin

    You need to go to the App stores and find compatible apps. iOS device do not natively have to ability to transfer info to a computer via BT to a computer.
    With iOS 8 you can use AirDrop

  • The Remote Desktop Connection Broker server could not enumerate the targets for the provider named NULL from the database.

    When I try to install Connection Broker on a Windows 2012 R2 Server in a Windows 2003 domain I get this error:
    The Remote Desktop Connection Broker server could not enumerate the targets for the provider named NULL from the database.
    Pooled virtual desktop collection name: NULL
    Error: Logon to the database failed.
    I have added both the Connection Broker server and the 2 remote desktop servers (also Windows 2012 R2 Servers) to the "Windows Authorization Access Group" in the domain according to this: http://support.microsoft.com/kb/331951
    But it still does not work :-(
    I keep getting same error....
    Any idea what I might be missing ?

    Hi,
    Thank you for posting in Windows Server Forum.
    Firstly please let us know by which method you have setup RDS role. You can have more advantage and feature when you will install with Standard deployment instead of Quick start deployment. So if you have setup with quick start option then you can try installing
    with standard type and check the result.
    In addition, please check SQL server database is properly configured for RDS server. Also check that domain controller properly communicates. Kindly go through below thread for more information.
    Server 2012 RDS - Remote
    Desktop Connection Broker Client failed to redirect the user domain\username. Error: NULL
    Hope it helps!
    Thanks.
    Dharmesh Solanki

  • Could not connect to DbaaS Service using the given user name and password.

    I'm not able to create Java Cloud Service (Oracle Java Cloud - Virtual Image Services) for my newly created Oracle Database Cloud Service instance. It fails with
    "Incorrect values entered
    Could not connect to DbaaS Service using the given user name and password.
    Verify that the user name and password are correct and the user name has SYSDBA privileges."
    I'm using SYSTEM user and the password I used during Oracle Database Cloud Service instance creation. I've verified them with sqlplus and also by connecting remotely.
    Java Cloud Service wizard doesn't allow me to proceed to instance creation.

    Hi Alexander,
    Maybe you'll find useful the document from Oracle docs specified bellow regarding Creating an Oracle Java Cloud Instance:
    http://docs.oracle.com/cloud/latest/jcs_gs/JSCUG/GUID-31F00F2C-221F-4069-8E8A-EE48BFEC53A2.htm#JSCUG3128
    Thanks,
    Cristiana.
    #OracleCloud

  • How can I use my previews as "masters", wen the masters are irretrievably lost? My idea is to at least be able to save the lost pictures by using the Previews as the new "originals".

    So, yes. Most of my master pictures are gone, long story - please don't ask why. The question now is whether I can use the previews (which are still there) which is surely better than nothing. But except for browsing, there's nothing I can do with them, unless they have a master file connencted. Has anyone got a clue how I could make Aperture treat these remaining preview as master files as well as previews, or in some way make this files useable.
    Thank you very much for your help, if anybody out there has a clue how

    So, yes. Most of my master pictures are gone, long story - please don't ask why.
    I assume, your library is referenced? And the versions are now pointing to missing original master image files?
    Then try the following - for each project separately.:
    Select all images in a  project and drag them from the Bowser to a folder outside the library. This will export the previews as jpegs.
    Now - with the images in the project still selected - use the command "File > Locate Referenced Files" to open the "reconnect" window. In the upper part of the reconnect Window select the first of your images that needs to be reconnected, and in the lower part point it to the corresponding  jpeg you exported. Hold down the alt/options-key⌥ to force the connect-buttons to appear. Press "Connect all".
    Regards
    Léonie
    P.S: If the reconnect buttons refuse to become active, even with the⌥-key held down, check the filenames. The previews should be named exactly like the missing originals. I tried this in Aperture 3.4.5, but I am not sure, if it will work in all Aperture versions the same.

  • How do i figure it out what app use the cellular data in standby mode?

    How do i figure it out what app use the cellular data in standby mode? I disabled the cellular data for 3 days, and my battery last longer. I don't use push notifications, neither location services. I'm not signed in in skype or any IM app.

    Do you use push email?  Do you have accounts that have synchronized calendars associated with them?  Those features will still use cellular data in the background as the receive mail and send or receive calendar updates.
    Some notifications, like push notifications from Facebook and other social networking sites may use cellular data in the background.  Basically, any automated data task like those may use cellular data when the phone is in standby (note that wifi would be used if available when the phone is active, but wifi turns off in standby and all data goes through the cellular data connection).

  • When I connect my iPad2 to my tv using the AV adapter I can hear sound for everything else except for my movies. I can hear tv shows, music, videos off YouTube, etc. I just can't hear the movies. Any ideas of what may be wrong?

    When I connect my iPad2 to my tv using the AV adapter I can hear sound for everything else except movies. I can hear tv episodes, music, YouTube videos, etc. anyone have an idea of how to fix this issue? Thank you for your help in advance.

    Just connect the new iPod to your computer and setup the iPod via iTunes (instead of via wifi).
    If you want to copy all the infor from an old iPod touch to the inew iPod see:
    iOS: Transferring information from your current iPhone, iPad, or iPod touch to a new device

  • Can't connect to a majority of webpages using the RG54gs residential gateway

    I'm stumped with the MSI Residential Gateway.
    We primarily got it as a gift for my father-in-law who had just aquired a centrino laptop.  He started complaining that he was not being able to download his e-mails.  Found out later, it was because the gateway shuts off the connection after some time of inactivity and on occassion after a few minutes.  There was some improvement after I installed the new firmware (feb release) but it was still there.
    I decided to bring it home and test it on my network.  I immediately noticed that I couldn't visit all the sites I used to.  It seemed that all the secondary sites were no longer available.  An example is, opened google (can connect), google searched for RG54gs and come up with the msi website but when I click on the link to the msi website, I get a page not available error.  This is also the same thing that happens to the rest of the links.  I hooked all connections back to my accton router and I'm able to access all site again.
    Can't  figure out what the problem is?
    There was a suggestion that for Ppoe connection you're suppose to leave the "connect on demand" button disabled.  I found a little improvement when it was enabled. All this is using the wired part. Using the wireless is totally useless with almost everything unaccessible even though the signal is excellent.
    Sorry for the long story but it's really got me to a point where I don't know what else to do.  

    Are you sure that this did not happen on the morning of June 15th when the major web sites were actually unavailable due to Akami problems?
    Check the RG54GS configuration and see what DNS server it is using. Check the configuration of the PC and make sure it is using the RG54GS as the DNS server.
    You don't mention if you are ADSL or cable. An incorrect MTU length (guess at 1400 if your service does not tell you) can cause connections to be dropped.
    I use ADSL and could not connect at all until I got the new firmware, since then things have been OK. I am on a very marginal ADSL connection.

  • I  have a new Mac Pro computer and have migrated my files from my older computer to the new computer. In trying to open a Lightroom catalog on an external hard drive  I keep on getting the message "lightroom cannot use the catalog named " " because it is

    I  have a new Mac Pro computer and have migrated my files from my older computer to the new computer. In trying to open a Lightroom catalog on an external hard drive  I keep on getting the message "lightroom cannot use the catalog named " " because it is  not writable and cannot be opened. I have fixed all the "permissions" and yet it will still not open. How do I fix this?

    Hello Forum Members,
    I figured it out. You have to select  the actual logo of the Lightroom catalog and then click on  "get info" and allow what ever your new user name to "read and write". That worked!
    Henri Silberman

  • I updated my LG G3 this week and now it SUCKS!  When I'm connected to WIFI, nothing on Facebook works.  The photos and videos won't populate.  I have to turn off the WIFI and only use the mobile data. Not to mention, I really hate the way it looks now.

    I updated my LG G3 this week and now it SUCKS!  When I'm connected to WIFI, nothing on Facebook works.  The photos and videos won't populate.  I have to turn off the WIFI and only use the mobile data. Not to mention, I really hate the way it looks now.   Before I updated my phone, I really liked it, now I don't like my phone at all!  When will this be fixed? I hope it's soon.  I'm thinking of changing providers now.

    Does the iOS device connect to other networks? If yes that tend to indicate a problem with your network.
    Does the iOS device see the network?
    Any error messages?
    Do other devices now connect?
    Did the iOS device connect before?
    Try the following to rule out a software problem:                
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Power off and then back on your router
    .- Reset network settings: Settings>General>Reset>Reset Network Settings
    - iOS: Troubleshooting Wi-Fi networks and connections
    - Wi-Fi: Unable to connect to an 802.11n Wi-Fi network      
    - iOS: Recommended settings for Wi-Fi routers and access points
    - Restore from backup. See:
    iOS: How to back up
    - Restore to factory settings/new iOS device.
    If still problem and it does not connect to any networks make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar

  • How Can You Track Your Ipod If Lost Using The Serial Number

    How Can You Track Your Ipod If Lost Using The Serial Number?

    The find my iphone app has nothong to do with it.
    That app simply allow you to find other devices using your ipod.  It has nothing to do with fining the device on which it is installed.
    If you set up the find my ipod feature that is built into your ipod and the ipod is on and it is connected to wi-fi and it has not been restored, then you may be able to get an approximate street address using icloud.
    Othrewise, it cannot be tracked.

  • I have changed my Apple ID on my iPad, but my iPhone keeps popping up with the old ID.....how do I get all my devices to use the same ID?

    How can I get all my devices to use the same Apple ID?

    Different services on your iOS device (iMessage, Facetime, iCloud, iTunes and App Store) can be signed into with an Apple ID of your choice. Make sure you verify the settings for each device and that you are signed in to each service with the correct Apple ID.
    I'll do an example for iMessage:
    1) Go to settings on your iOS device
    2) Select "Messages"
    3) Select "Send & Receive"
    4) At the very top you will see "Apple ID", by selecting your Apple ID, you will now have the option to sign out of messages with the current Apple ID, and sign in with the new one.
    The steps for changing your Apple ID for other services will be very similar.
    tHIS SHOULD BE VERY HELPFUL TOO YOU.

Maybe you are looking for