Do not hard code the connection

I trying to seperate the web container and ejb container into two machines
for an existing application.
It works in one machine, and it works on two machinese if I hard code the
JNDI factory, the provider_URL.
My question " Is it possible to do this without hardcoding the URL".
I am running two windows NT boxes for this.
thanks.

To use 2 different WL servers, one as EJB container and one as web
container, you have to create or edit your jndi.properties file (in your
jre/lib directory) and add two lines to it that specify
t3://<servername>:<port> ... unfortunately I don't have the information here
at home but I think that I have posted it before on one of these WL
newsgroups.
Cameron Purdy, LiveWater
"Dave Read" <[email protected]> wrote in message
news:[email protected]...
I may be missing it, but in this and another thread, I don't see where the
host is specified (where the EJB has been bound to a JNDI name)? I'vebeen
able to do this standalone using the -Djavax.naming.provider.url property.
However, I don't see how to tell an instance of a WL server that's just
running web-apps, where (on what machine) to find the JNDI tree that
contains the EJB Homes?
The code in this post seems to help when an EJB wants a simple way to get
it's own properties. I need to deploy the web-app and EJBs on separate
(non-clustered) systems.
Bottom line ... how to externalize the provider URL.
Thanks!
Cameron Purdy <[email protected]> wrote in message
news:[email protected]...
Beautiful.
Cameron Purdy, LiveWater
"Tom Preston" <[email protected]> wrote in message
news:[email protected]...
Here is an example:
Using 5.1.0 xml dd's, you can specify an <env-entry> which is
associated
with
your ejb:
<env-entry>
<env-entry-name>poolName</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>myPool</env-entry-value>
</env-entry>
file://now put this code into your Bean class
private String getPoolName( ) {
try {
// Obtain this enterprise bean's environment naming context.
Context initCtx = new InitialContext();
m_envCtx = (Context)initCtx.lookup("java:comp/env");
String poolName = (String) m_envCtx.lookup("poolName");
return poolName;
catch (Exception e) {}
return null;
Alexandre POLOZOFF wrote:
Is there an example of how to do this somewhere?
-Alex
"Tom Preston" <[email protected]> wrote in message
news:[email protected]...
You can put this info into your EJB deployment descriptors (xml if
5.1.0)
and
access them as environment variables.
xinguang sheng wrote:
I trying to seperate the web container and ejb container into
two
machines
for an existing application.
It works in one machine, and it works on two machinese if I hard
code
the
JNDI factory, the provider_URL.
My question " Is it possible to do this without hardcoding the
URL".
I am running two windows NT boxes for this.
thanks.

Similar Messages

  • Where to Hard Code the Connection String.....

    Hi,
    We just give the url to the user and when the user clik it.
    The Application form login will appear and user should login before they
    can use the system.
    When our DBA setup in the production they give us the url and
    when I click it the Database login screen appear before it goes to
    the Application form login.
    My problem is how to bypass that Database Login Screen and where to hardcode
    the connection string in which file in the server.
    Thanks.
    Regards,
    Jun

    We are hardcoding the userId (Connection) details in the formsweb.cfg, wil it create any issues to our security system.
    From the application link, i couldnt get the userid details, as all the other
    details like
    serverArgs="escapeParams=true module=frm_login.fmx userid= sso_userid=%20 sso_formsid=%25OID_FORMSID%25 sso_subDN= sso_usrDN= debug=no host= port= buffer_records=no debug_messages=no array=no obr=no query_only=no quiet=yes render=no record= tracegroup= log= term=D:\Applns\OracleForms\forms\fmrweb_.res"
    separateFrame="true"
    splashScreen="no"
    background="no"
    lookAndFeel="Oracle"
    colorScheme="blue"
    serverApp="default"
    logo="false"
    imageBase="codebase"
    formsMessageListener=""
    recordFileName=""
    EndUserMonitoringEnabled=""
    EndUserMonitoringURL=""
    heartBeat=""
    were visible (view Source) but userid= sso_userid=%20, i think this points to
    basejini.htm, which doesnt contain the userid details ..
    am i correct .. please render your thoughts over this.
    Many Thanks
    Deepa
    Message was edited by:
    Deepa.ibs

  • Not hard coding the iexplorer path

    Hi
    I was looking around and saw this piece of code posted by Cotton.m:
    public class IETest{
      public final static String browserPath ="C:\\Program Files\\Internet Explorer\\iexplore.exe";
      public static void main(String args[])throws Exception{
        String[] urls = {"http://forum.java.sun.com","http://www.cnn.com","http://www.google.com"};
        for(int i=0;i<urls.length;i++){
          launchPage(urls);     
    public static void launchPage(String pageName)throws Exception{
    String[] launchPath = new String[2];
    launchPath[0] = browserPath;
    launchPath[1] = pageName;
    Runtime.getRuntime().exec(launchPath);
    Does anyone know how to not hardcode the browserPath? or is that impossible... I'm doing something similar but I open files... is there a way that I don't need to hard code the path name? or am i asking too much?
    Cheers>

    **  Here is a pure Windows solution
    **  Run the code and you will be taken to a tutorial that may provide
    **  a more generic solution
    public class WindowsProcess
         public static void main(String[] args)
              throws Exception
              String[] cmd = new String[4];
              cmd[0] = "cmd.exe";
              cmd[1] = "/C";
              cmd[2] = "start";
              cmd[3] = "http://www.javaworld.com/javaworld/javatips/jw-javatip66.html";
    //          cmd[3] = "notepad";
    //          cmd[3] = "will.xls";
    //          cmd[2] = "a.html";
    //          cmd[3] = "file:/c:/java/temp/a.html";
              Process process = Runtime.getRuntime().exec( cmd );
    }

  • How to hard code the values in XI for the synchronous scenario?

    Hi All,
    Actual Scenario : Webservice - XI - Any of the Receiver Adapter(RFC/JDBC) .
    The receiver adapter setup will take some more days to complete. So, time being I would like to hard code the response values in XI according to the webservice request and send the response back to webservice. Is it possible?
    If it is possible, could you please tell me how to go about for this?
    Regards
    Sara

    Hey
    >>So, time being I would like to hard code the response values in XI according to the webservice request
    if ur response is based upon the request,then how can u hard code any value?when u hard code any element.it will always display the hard coded value irrespective of the request.
    in case u want to hard code something which does not depends on response or which will always stay the same in ur scenario,then just use the constant function of message mapping to do that
    thanx
    ahmad
    Message was edited by:
            Ahmad

  • Windows Phone Emulator is unable to connect to the Windows Phone operating system: The phone did not respond to the connect request. Some functionality might be disabled

    We are receiving following error, while trying to deploy the application on Win Phone emulator. “Windows Phone Emulator is unable to connect to the Windows Phone operating system: The phone did not respond to the connect
    request. Some functionality might be disabled.”
    I have tried all possible ways that we found on blogs. We are still not able to solve this issue

    I have had a lot of issues with the emulator in the past.
    Check out this troubleshooting guide. It might help:
    https://msdn.microsoft.com/en-us/library/windows/apps/jj681694(v=vs.105).aspx
    Also, I find that if I cancel my build/deploy while it is stuck on booting the OS and then wait a short while the phone OS will complete booting, and from that point I can deploy to the emulator. It's a workaround, but it works well for me.
    I need to do that on Windows 10 tech preview, which may or may not be simply an incompatibility with the beta OS.
    I'm a self-taught noob amateur. Please take this into account when responding to my posts or when taking advice from me.

  • Surfing the web I constantly get a dialog box popping up that says "The connection was rest" or " Server not found" or "The connection has timed out"

    Surfing the web I constantly get a dialog box popping up that says "The connection was rest" or " Server not found" or "The connection has timed out". The panel gives me three possible causes, none of which are correct and tells me to "Try again". Sometimes when I try again the site appears, sometimes it does after several tries and sometimes it never does. I called my IP, Cox and they told me it is a result of something Microsoft put out in their updates to IE (presumably to discourage people from using Firefox). Can you help me get rid of this problem?

    Surfing the web I constantly get a dialog box popping up that says "The connection was rest" or " Server not found" or "The connection has timed out". The panel gives me three possible causes, none of which are correct and tells me to "Try again". Sometimes when I try again the site appears, sometimes it does after several tries and sometimes it never does. I called my IP, Cox and they told me it is a result of something Microsoft put out in their updates to IE (presumably to discourage people from using Firefox). Can you help me get rid of this problem?

  • Indesign does not automatically find the connections

    indesign cs 6 does not automatically find the connections..
    I can only manually update links
    can you help me?

    Choose Edit > Preferences > File Handling > Links and review the settings "Check Links Before Opening Document" and "Find Missing Links Before Opening Document"

  • Message says: "can not get mail, the connection to the server failed" . Now I'm confused because all the mail shows up perfectly.

    I just upgraded to the 5s. I have several mail accounts and I'm getting a message that says: "can not get mail, the connection to the server failed" . Now I'm confused because all the mail shows up perfectly.

    Well it does it every time I go to mail and is driving me nuts. It never happened on my iPhone5, just on this 5s.

  • My ipad can not get mail. the connection to the server failed. Even I follow ipad2 help and check everything.

    my ipad2 can not get mail. the connection to the server failed. even I follow ipad2 help and check everything

    Well it does it every time I go to mail and is driving me nuts. It never happened on my iPhone5, just on this 5s.

  • My iPhone will not get past the connect to iTunes screen. I tried downloading iOS 8.0.2 and it downloaded but then cancelled because of an error. My iPhone will not do anything at all.

    So my iPhone 5s will not let me get past the connect to iTunes page.
    Thursday night I went to go download iOS 8.0.2 and it said I needed to connect to iTunes. So I plugged my cord into my laptop and it opened up iTunes and proceeded to tell me that I needed to update and restore. So I clicked it and it began updating. After over a day, and many different attempts, it finally downloaded all the way through and then said it was processing the item. After this, there was a said error and I had to restart the update. I haven't been able to use my phone at all and it will not let me get past the connect to iTunes page. Please help.

    I was able to restore my phone!!!
    I called Apple and they said there was nothing more I could do. I called my carrier Verizon and was able to get my computer to recognize my device after trying this-
    Solution:
    After trying EVERYTHING this is the ONLY thing that worked-
    I took the USB connector cable out of the USB port it was in, and tried another one on the otherside of my laptop and iTunes was able to discover my phone in recovery mode. My phone was reset and everything is fine ( thank gosh for backup copies!)

  • "USB device not recognized." "The connection between your device and the desktop could not be established. Please check your setup and try again." Tungsten E2, Outlook 2007

    Hi,
    I am running XP SP 2, on a Dell Vostro 1000, Palm OS Garnet v5.4.7 on a Tungsten E2. I have worked though issues relating to synchronization, Outlook 2007, Docs to Go, etc., in the past.  Thank you board members! 
    Once I worked thru all the initial problems, my Tungsten E2 was sync' ing beautifully to my laptop until a few days ago.  There have been no changes (I know of) to the configuration, but now I receive  "The connection between your device and the desktop could not be established.  Please check your setup and try again."  On the laptop I sometimes get  "USB device not recognized."  I am unclear why I get the PC message sometimes and not others.   
    I have tried the following: (not necc exactly in this order)
    Double checked Hot Sync Mgr settings: Local USB (ver. 6.0.1)
    Reset the Palm (multiple times)
    Rebooted the laptop  (multiple times before and after the Palm resets)
    Went to Support Libraries including http://kb.palm.com/SRVS/CGI-BIN/WEBCGI.EXE/,/?St=57,E=0000000001060189973,K=9550,Sxi=3,Case=Obj(3695...)
    and http://kb.palm.com/SRVS/CGI-BIN/WEBCGI.EXE?New,Kb=PalmSupportKB,ts=Palm_External2001,Case=obj(1409) 
    Followed the steps in "Start Here" found at  http://forums.palm.com/palm/board/message?board.id=windows_hotsync&thread.id=26057 
    Moved Backup directory as per a post on this forum
    Looked for a deleted a file called "Graffiti_ShortCuts_____________" per a post on this forum
    Followed the steps in HotSync troubleshooter guide you can run through located on
    http://kb.palm.com
    Went into Device Manager - found it shows no yellow ! 's
    Followed Device Mgr Troubleshooter - went all the way thru with no solution 
    Tried all four USB ports - the PC's bell-like tone does not sound when I disconnect or reconnect the Plam's cradle like it does when I conn/disconnect other USB devices -I think that is a clue.    ...? 
    Cleaned the Palm's contacts (and cradle's contacts with a old, dry toothbrush)
    Read all the posts under "USB device not recognized." 
    OK, I'm at a loss, can anyone help me?  Many thanks in advance! 
    ~Bob
    Post relates to: Tungsten E2

    Hello!
    Using a cradle with the Tungsten E2?  Tried bypassing the cradle and just use the hotsync cable?  Tried a different computer yet?  Somehow, the PC is having problems getting a signal from the device.  I assume you have the laptop charger plugged into the laptop during this?  Not going through a docking station or port-replicator.
    One crazy thing you can try is unplug the charger from your laptop, remove the battery from the laptop and leave it out for like 10mins and put it back in and reboot the laptop.  This should not cause side effects but still contact your OEM to make sure that nothing else is needed after leaving the battery out for extended period of time.  Keep me posted.
    Post relates to: Treo 650 (Unlocked GSM)

  • ITunes store can not open because the "connection was reset"

    I keep getting this message when I try to access the store. It says that the connection was reset and to make sure my internet connection is active. My internet IS active and I have downloaded the latest version of iTunes. Please help.
    Thanks,
    Caroline

    Okay here it is, thanks for the help!
    Microsoft Windows Vista Home Premium Edition Service Pack 1 (Build 6001)
    Gateway M-6816
    iTunes 9.2.1.5
    QuickTime 7.6.6
    FairPlay 1.8.20
    Apple Application Support 1.3
    iPod Updater Library 9.2d4
    CD Driver 2.2.0.1
    CD Driver DLL 2.1.1.1
    Apple Mobile Device 3.1.0.62
    Apple Mobile Device Driver 1.49.0.0
    Bonjour 1.0.5.11 (214.3)
    iTunes Serial Number
    Current user is not an administrator.
    The current local date and time is 2010-08-09 17:24:46.
    iTunes is not running in safe mode.
    WebKit accelerated compositing is enabled.
    HDCP is not supported.
    Video Display Information
    Intel Corporation, Mobile Intel(R) 965 Express Chipset Family
    Intel Corporation, Mobile Intel(R) 965 Express Chipset Family
    ** External Plug-ins Information **
    No external plug-ins installed.
    iPodService 9.2.1.5 is currently running.
    iTunesHelper 9.2.1.5 is currently running.
    Apple Mobile Device service 3.1.0.0 is currently running.
    ** Network Connectivity Tests **
    Network Adapter Information
    Adapter Name: {9A3FCC4C-2719-4A50-8C7D-CE45E2EC7898}
    Description: Intel(R) PRO/Wireless 3945ABG Network Connection
    IP Address: 10.0.0.5
    Subnet Mask: 255.255.255.0
    Default Gateway: 10.0.0.1
    DHCP Enabled: Yes
    DHCP Server: 10.0.0.1
    Lease Obtained: Mon Aug 09 16:58:11 2010
    Lease Expires: Tue Aug 10 09:14:29 2010
    DNS Servers: 10.0.0.1
    10.0.0.1
    Adapter Name: {4D02B4E3-A221-4A85-9C6E-2C9F603265F5}
    Description: Realtek RTL8101 Family PCI-E Fast Ethernet NIC (NDIS 6.0)
    IP Address: 0.0.0.0
    Subnet Mask: 0.0.0.0
    Default Gateway: 0.0.0.0
    DHCP Enabled: Yes
    DHCP Server:
    Lease Obtained: Wed Dec 31 18:00:00 1969
    Lease Expires: Wed Dec 31 18:00:00 1969
    DNS Servers:
    Active Connection: LAN Connection
    Connected: Yes
    Online: Yes
    Using Modem: No
    Using LAN: Yes
    Using Proxy: Yes
    HTTP Proxy: 127.0.0.1:5555
    SSL 3.0 Support: Enabled
    TLS 1.0 Support: Enabled
    Firewall Information
    Windows Firewall is on.
    iTunes is enabled in Windows Firewall.
    Connection attempt to Apple web site was unsuccessful.
    The network connection was reset.
    Connection attempt to iTunes Store was unsuccessful.
    The network connection was reset.
    Secure connection attempt to iTunes Store was unsuccessful.
    The network connection timed out.
    Secure connection attempt to iPhone activation server unsuccessful.
    The network connection timed out.
    Last successful store access was 2010-06-18 17:01:11.

  • Dont want to hard code the -Djava.class.path...notation question

    Hello everyone,
    I have a c++ program that is compiled into a DLL file. It calls the JNI_CreateJavaVM. I have the whole thing working but now I need to port it and the jar file to another machine.
    right now i am setting the options this way:
    #define USER_CLASSPATH "c:\\javaClasses\\intec.jar.zip" /* where PRLocalBridge.class is */
    #define PRCLASS "com/intec/intecapi/PRLocalBridge"
    bool PRLocalBridgeMain(){
         JavaVMOption options[1];
         options[0].optionString = "-Djava.class.path=" USER_CLASSPATH;
         vm_args.version = JNI_VERSION_1_4;//0x00010002;
         vm_args.options = options;
         vm_args.nOptions = 0;
         vm_args.ignoreUnrecognized = JNI_TRUE;
        /* Create the Java VM */
        res = JNI_CreateJavaVM(&jvm, (void**)&env,&vm_args);
        if (res < 0) {
         return (bool*)errorHandler('b', CANT_INVOKE_JVM);
        cls = env->FindClass(PRCLASS);
    }where USER_CLASSPATH is hardcoded directly to where the jar
    file is located. in other machines, it may not be loaded
    in that file structure. how do i softcode the path?
    ive put the jar in my classpath but that doesnt seem to work
    (unless i didnt have USER_CLASSPATH set properly). Thanks
    in advance :)
    txjump

    hi bschauwe,
    thanks for the suggestions! i was hoping you would reply. You have helped some others with classpath questions. :)
    since its a dll, can you pass it values?
    we do have an ini file that is already created but the file parser is in java so i would have to write another one in c. id like to stay away from that though. cause if it gets messed up or goes missing, clients wont be able to reach the java program, and in turn the database.
    the classpath environment variable sounds like a good idea...will check into that. eventually we plan to wrap our software up in installshield so that would really be nice. clients could be ignorant of environment variables and still be able to run everything.
    my solution for now has been to find my jar file by recursively searching the c drive. and use GetFilePath() to get the full path and pass that to JNI_CreateJavaVM. i did get it to work...just wondering if this is a good idea.
    i was thinking that if the dll is in the same folder as the jar file i could just use dot notation but that just doesnt seem like a good idea to make that assumption. but i think java does something similar 'cause Sun says not to move the java.dll file.
    thanks for your input,
    txjump

  • My emails on my mac and macbook will not send but the connection doctor confirms connection to the server.  Any ideas???  Thank you

    I am unable to send emails on my imac and macbook.  They go straight to my outbox.  The connection doctor comes up with green lights.  Any ideas?  Hopeing someone out there can help me - thank you.

    EA68, who is your broadband provider, if it is Sky then they have recently merged with Yahoo, and there have been similar problems with people who use Mail to access their emails.
    If this is the case you will need to remove your SKY account from Mail and then set it up again.
    Make sure you clear your inbox, and back up any important emails you have.
    IN MAIL go to prefrences and accounts. Highlight SKY account and select the MINUS or delete sign.
    Now select the PLUS or add button and type in your sky email address, and then your sky password. Follow on screen instructions, and your emails should then work.
    Hope this solves your problem.

  • Run Into Problem When Trying Not To Hard Code the Host Name

    My code (using the JavaMail API) works fine when the SMTP host name is hard coded in the program:
           props.put( "mail.smtp.host", "TheHostName" );Then, I tried to put the host name in a properties file (smtpServer.properties). The properties file is in the $TOMCATHOME\webapps\AppName\WEB-INF\classes\resources directory. And the properties file has this one single line:
    smtpServer = TheHostName     //Note: The host name has only alpha characters, dots, and dashesIn my program, I did:
       private final String PROPFILE = "resources/smtpServer.properties";
       private Properties oProp = null;
       public SendBatchMails()  // this is the constructor in my class
          try
             oProp = new Properties();
             oProp.load ( getClass().getClassLoader().getResourceAsStream( PROPFILE ) );
          catch( IOException oEx )
             System.out.println("Unable to load the Properties " + PROPFILE + oEx );
           String smtpServer = oProp.getProperty( "smtpServer" );
           Properties props = System.getProperties();
           props.put( "mail.smtp.host", smtpServer );And, I got this runtime error:
    java.lang.IllegalArgumentException: argument type mismatch
         sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:324)
         org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1789)
         org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.java:1684)
         org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:1713)
         org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:1019)
         org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
         org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)
         org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
         org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

    I would agree with Reply 1. From the stack trace it is apparent that it comes from Struts, where it is failing to set some kind of property in a bean. However the code that you posted doesn't seem to have anything to do with that. Check your Struts configuration.

Maybe you are looking for