Get URL for J2EE client application

Please forgive me if this question has an obvious answer, but I can't see it.
Once Web Start has downloaded and started my J2EE Swing application client, how can my client get the name of the host (or entire URL) from which the client was downloaded?
I would rather not have to hard code this into my client, so that the WAR file I deploy to the server is platform independent.
bobj5000

Use the JNLP BasicSevice API getCodeBase() to get the URL of the server.
BasicService bs = (BasicService)ServiceManager.lookup("javax.jnlp.BasicService");
URL url = bs.getCodeBase();
Hope this helps
Jeff

Similar Messages

  • Help:How can I run the J2EE Client Application? Thanks

    Help:How can I run the J2EE Client Application that will access the remote J2EE1.4 application server which runs on another host computer?
    I have developped a stateles senterprise java bean name converter and deloyed it in the j2ee1.4 application server on the host machine A. The converterbean provides the remote home interface and remote interface. At the same time I have developped the j2ee application client named convertappclient. When I access the conveter bean at host computer A through the script 'appclient.bat' as 'appclient -client convertappclient.jar', the client can access the bean sucessfully. Now I want to access the bean through the script 'appclient.bat' at host computer B,what files should I copy from host computer A to host computer B;and what the command line should be like? Thanks!
    The following are the code of the enterprise java bean and it's home interface .
    The client code is also provided.
    The enterprise java bean:
    package converter;
    import java.rmi.RemoteException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    import java.math.*;
    public class ConverterBean implements SessionBean {
    BigDecimal yenRate = new BigDecimal("121.6000");
    BigDecimal euroRate = new BigDecimal("0.0077");
    public ConverterBean() {
    public BigDecimal dollarToYen(BigDecimal dollars) {
    BigDecimal result = dollars.multiply(yenRate);
    return result.setScale(2, BigDecimal.ROUND_UP);
    public BigDecimal yenToEuro(BigDecimal yen) {
    BigDecimal result = yen.multiply(euroRate);
    return result.setScale(2, BigDecimal.ROUND_UP);
    public void ejbCreate() {
    public void ejbRemove() {
    public void ejbActivate() {
    public void ejbPassivate() {
    public void setSessionContext(SessionContext sc) {
    The bean's remote home interface :
    package converter;
    import java.rmi.RemoteException;
    import javax.ejb.CreateException;
    import javax.ejb.EJBHome;
    public interface ConverterHome extends EJBHome {
    Converter create() throws RemoteException, CreateException;
    The bean's remote interface:
    package converter;
    import javax.ejb.EJBObject;
    import java.rmi.RemoteException;
    import java.math.*;
    public interface Converter extends EJBObject {
    public BigDecimal dollarToYen(BigDecimal dollars) throws RemoteException;
    public BigDecimal yenToEuro(BigDecimal yen) throws RemoteException;
    The j2ee application client:
    import converter.Converter;
    import converter.ConverterHome;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    import java.math.BigDecimal;
    public class ConverterClient {
    public static void main(String[] args) {
    try {
    Context initial = new InitialContext();
    System.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
                   System.setProperty("java.naming.provider.url","jnp://10.144.97.250:3700");
    Context myEnv = (Context) initial.lookup("java:comp/env");
    Object objref = myEnv.lookup("ejb/SimpleConverter");
    ConverterHome home =
    (ConverterHome) PortableRemoteObject.narrow(objref,
    ConverterHome.class);
    Converter currencyConverter = home.create();
    BigDecimal param = new BigDecimal("100.00");
    BigDecimal amount = currencyConverter.dollarToYen(param);
    System.out.println(amount);
    amount = currencyConverter.yenToEuro(param);
    System.out.println(amount);
    System.exit(0);
    } catch (Exception ex) {
    System.err.println("Caught an unexpected exception!");
    ex.printStackTrace();
    }

    Surprisingly I find an upsurge in the number of posts with this same problem. I recently found a post which gave a nice link for this. Follow the steps and it should help:
    http://docs.sun.com/source/819-0079/dgacc.html#wp1022105

  • Get HTTPS URL for Web dynpro application

    We are using SSL. By default the URL generated for the Web dynpro application is HTTP.
    We went to SICF, and deactivated the HTTP service. That made the URL point to HTTPS.
    But few problems started coming because of it:
    - Our Content server became inaccessible.
    - Every time server is re-started, we need to manually go and de-activate HTTP Service.
    We even tried to set the parameter icm/icm/HTTP/redirect_0. But problem is not solved.
    I know this question is asked before, but every time the answer is to read the help document on ICM.
    What's the correct way for any webdynpro application to point to HTTPS? I don't think de-activating HTTP service is the right way.
    Any suggestions please?
    Thanks in adv.

    Thanks a lot Thomas. I'd ask the Portal Admin to try it out.
    There is another similar problem we are facing: I have embedded Webdynpro in R/3 screen. Then used the cl_gui_wdr_viewer class's load_application method passing HTTPS protocol.
    It returns HTTPS URL only, but is not showing up on users' laptops.
    Earlier we were not passing HTTPS protocol, so generated URL was HTTP, and it was not showing on users' screen (can show in ours). Reason we found out is that users' site has HTTP port blocked. They cannot show any HTTP url.
    So we changed to get HTTPS URL, but that also gives the same problem. It is still trying to get HTTP url.
    Here is the URL that the users got: (when they right click to see the URL generated)
    res://ieframe.dll/dnserrordiagoff_webOC.htm#http://abc.def.jil:8000/sap/public/myssocntl?sap-client=220
    Can give any clues on why this is going wrong? Cannot raise OSS as I know embedding Webdynpro in R/3 is not supported
    Thanks in adv.

  • Constantly getting "Reopen for Clustered Client Failover registered application has failed for FileObject " error in CCFilter eventlog.

    Hi everybody.
    Hope somebody will be able to help me with the following issue.
    I have the following environment configuration:
    1. WFC cluster (cluster1) contains 3 nodes - sql1,sql2,sql3
    2. sql1 and sql2 can run single shared instance SQL server
    3. Node sql3 is a standalone SQL server.
    4. AlwaysON is turned on shared instance and standalone SQL servers and availability group have been configured for multiple DBs. So sql3 is a replica of shared instance.
    5. All this runs on Vmware as a virtual machine.
    I'm  constantly getting following error in Microsoft-Windows-CCFFilter/Operational logfile when I execute SQL DB/Transaction log backup maintenance plan on my shared instance SQL server (sql1 or sql2):
    Log Name:      Microsoft-Windows-CCFFilter/Operational
    Source:        Microsoft-Windows-CCFFilter
    Date:          10/24/2014 6:00:12 AM
    Event ID:      2000
    Task Category: None
    Level:         Error
    Keywords:      
    User:          DOMAIN\wfcsqlsvc
    Computer:      SQL1
    Description:
    Reopen for Clustered Client Failover registered application has failed for FileObject 0xfffffa801cbb08a0 to \SQL3\Backups\Logs\DB1\DB1_backup_2014_10_24_060003_3960528.trn with status 0xC0000034
    Getting multiple mentioned errors for every single DB I'm running my backup maintenance plan against. The maintenance plan gets executed on SQL1 which is shared instance machine.
    Any ideas of what can cause this and how to fix it.
    Thanks in advance.

    Yes. I'm doing backup on primary replica in the AlwaysOn Availability Group. And this primary replica itself is a WFC shared SQL instance.
    I've double checked Maintenance Plan's History and Agent's logs. No Error, no warning, nothing. And by the way DB full and transaction log backups gets created as they should. By that I mean that 'For availability databases, ignore Replica Priority for Backup
    and Backup on Primary Settings' property is turned on and this allows me to do backups from primary replica.
    As you've written I've clear the maintenance plan setting ''For availability databases, ignore Replica Priority for Backup and Backup on Primary Settings.', and configure the availability group's AUTOMATED_BACKUP_PREFERENCE setting to allow backup from any
    replica for certain availability group. But still nothing. Getting the same error.
    This is how AVG1 are configured regarding Backup preferences:
    For example this subplan from Maintenance plan cause mentioned errors:

  • Using a variable to insert into a URL for redirecting clients

    I got a good one, can anyone help on this?
    Using RoboHelp Version 8.02.208.
    My company uses MicroStrategy to deploy several web-based data analysis products.
    Each of these data products (there are 5) are deployed on different servers.
    I have set up a single source WebHelp project and use build tags for product specific help output.
    (I also have to modify the Start Page, TOC and Default Topic settings prior to generating each product help)
    Everything on this works fine and is not a problem.
    We have just implemented an Excel add-in for one of the products.
    That add-in uses a locally installed CHM file for its help.
    In order to provide customized help that can be updated without forcing the clients to reinstall the CHM help file locally, the source for the CHM file has one dummy topic. In that topic, I have used HTML code to redirect the client to the WebHelp for the product and have integrated the Excel add-in help to that product’s customized help. The result is that the CHM file is opened locally in the HTML help viewer. Inside the HTML help viewer window, I open the WebHelp.
    The redirect HARD CODES the URL with the product specific server name and Start Page help topic.
    That works fine and is not a problem for ONE PRODUCT.
    We are in the process of adding this Excel add-in to other products.
    Now here is where I cannot get this to work with my implementation.
    The URL for each product is different and to make matters worse, the Start Page is different for each product as well.
    So, I am working on options for implementation of multiple products and here is my question:
    (1)    The following is an example of the redirect in the single topic of the CHM file:
    <meta http-equiv="refresh" content="0;URL=https://server.com/ProductName/WebHelp/StartPage.htm#mergedProjects/ExcelPlugIn/ Overview.htm" />
    (2)    The red portion of the URL above will need to be modified to support each individual product with a custom server, product name and start page HTM file name.
    Is there a way to:
    (1)    Add a variable in this HTML code
    (2)    Once the product is identified, update the variable with the product specific URL content
    (3)    Integrate the variable into the target URL of the HTML code that does the redirect
    I think this is either not possible or more work than needed. My other option is to provide standalone Excel add-in help on a server and just have the Excel plug-in go to that (right now it is integrated into the product specific help and the client has access to the plug-in help AND the application help all at the same place).
    Thanks to all in advance for any help/suggestions.
    Michael F Weart
    [email protected]

    Thanks for the feedback - here is more informtion on the challenges of this implementation:
    I can only distribute one CHM file to cover all 5 web-based products that can be accessed through the Excel plug-in.
    Regardless of which of our 5 products is used to install the plug-in on the client's local hard drive, the same installer is used.
    That one CHM file is installed locally on the client's hard drive.
    (The out of the box CHM file for the plug-in only has general plug-in help content the locl install causes problems for updating the content).
    We needed to be able to easily update the help without inconveniencing the clients.
    So, I am not creating 5 different CHM files for each installer, since there is only one installer regardless of how many of the 5 products they have.
    The plug-in has a server setting and web service setting for each product and the client must choose which they are accessing when they fire up the plug-in.
    They may be accessing the plug-in for any of our 5 web-based products they have subscriptions for.
    Which means, the one CHM file must be able to:
    (1) determine the product they are accessing
    (2) direct to one of the 5 servers with the online help.
    Each of the 5 online helps are deployed on separate servers with different URL links (and the helps have all different URL links as well).
    These online webhelp outputs have some identical content but also some customized content for the specific product they are actually accessing.
    My original approach was pretty much the same as William's above. Have a variable in the CHM help, determine the server they are accessing from the plug-in and insert the customized portion of the URL to access the appropriate webhelp.
    Keep the ideas/suggestions coming.
    I also have a development person looking into how to update a variable on the CHM side to populate the URL.
    Michael F Weart
    [email protected]

  • J2EE Client Application (weblogic.ClientDeployer)

    Hello,
    I'm experimenting with the ClientDeployer utility as described in the 6.1
    documentation, and I face some odd behavior.
    I created a jar file (cli.jar) containing the class files of my client application,
    and a META-INF/application-client.xml file.
    This jar file then gets stored in an ear file, together with a cli.runtime.xml
    file
    and a META-INF/application.xml file.
    Afterwards, I tried running this client application by using
    java weblogic.ClientDeployer clients.ear cli
    Now, all of this works, as long as I leave the cli.runtime.xml file in the
    current directory. But as soon as I remove this file from the current
    directory, it stops working. This means that ClientDeployer doesn't read
    the cli.runtime.xml file from the ear file, but only from the current directory.
    Is that the way it is supposed to work ? I would expect it to read the
    runtime file form the ear file ?
    Thanks,
    Francois Staes.

    Hi Sandy,
    If I understand you correctly, then you are asking how to make
    a stand-alone java client, right? According to the J2EE spec, a
    stand-alone java client also needs to be deployed to a container.
    A long time ago (before OC4J, when there was only OrionServer)
    I struggled for about a week before finally figuring out how to
    do this.
    However, I then discovered that, with OrionServer (and therefore
    also with OC4J), your stand-alone java client does not have
    to be deployed to a container and can be launched from the command
    line with the "java" command.
    If you do want to deploy your java client, then the only way
    I know to launch it is by using the "applicationlauncher.jar"
    file. This file was part of the first OC4J (version 1.0.2.2).
    It disappeared in the next version (9.0.2) and now has reappeared
    in the latest version (9.0.3) -- go figure! Like I said, by the
    time I started using OC4J, I was only using non-deployed clients,
    so I had no need for "applicationlauncher.jar", so the fact it
    was missing from version 9.0.2 didn't affect me.
    In any case, I recall information on how to use the "applicationlauncher.jar"
    file on the following web sites:
    http://www.orionserver.com
    http://www.orionsupport.com
    http://www.atlassian.com
    http://www.elephantwalker.com
    I also recall answering similar questions several times previously
    on this forum, so a search of the forum archives may also help.
    I hope I have correctly interpreted your question and given you
    a helpful answer.
    Good Luck,
    Avi.

  • Get URL for List and ListItem

    Hi,
    I have a SharePoint List (SPList) and need to provide the URL for the list. It should be possible to copy this URL to the browsers address field and navigate to the corresponding Details or Overview View (or default view) of the list.
    Additionally, I have a List Item object (SPListItem) and need the URL to directly navigate to the DispForm.aspx of this item.
    I tried it like this:
    string listURL = ... + "/Lists/" + myList.Title;
    string itemURL = listURL + "/DispForm.aspx?ID=/" + id;
    The URLs are correct as long as the "Internal Name" of the list is the same as the displayed name of the list. But in SharePoint it is possible to add a List-Template with no blanks in the name (e.g. 'MyList'), but later rename it and include a blank (e.g. 'My List'). In this case the listURL I retrieve with the above code snippet does not work anymore! For SharePoint only a URL with the list name without blanks is existent. In short: the URL does not include the blank for the list in the url but myList.Title does!!
    So my question is, how can I get a URL that directly leads to my list's Details view (or default view) and the URL that leads directly to the list items "DispForm.aspx"??

    Hi,
            It seems you need to get correct ListItem URL from ListItem’s property, and thanks for all helpful suggestions.
            In this situation, would you please try using List’s Form property instead of “SubString”, code like this:
            string itemURL = yourweb.Url+"/"+yourlist.Forms[PAGETYPE.PAGE_DISPLAYFORM].Url + "?ID=" + item.ID;
           Then  you will actual retrieve the correct path to the DispForm.aspx page.
           Hope this sample can help.
    Best Regards,
    -Aaron

  • Trying to get URL for my photos for Mac 10.9.3

    Have never been able to get a URL for one of my photos. How do I do that? Do I need to download a program to do so?  (I am a participant at FSM Film Score Monthly, and wanted to post some of my photos there.) Thanks.

    Looking now
    The site here is making answering this very difficult
    OK made an account and looked at the instructions for posting. As andy surmised the image you want to have in your post at that site must already be on the web somewhere.
    You could try one of the links andy posted, photobucket might be the easiest for a new user to use\
    Once you have an account there and you upload your images you can post them to the FSM site
    by using the code
    [iimg]URL from photo bucket[/img]
    OK finally got that all posted, good luck
    regards

  • Using flex for thik client application

    My application is an C++ thik client application. It uses
    some king of lib (called zaf) for the UI.
    Can Flex be used for handling the UI of desktop application
    ?

    You could use AIR (Adobe Integrated Runtime), in which most
    of the app is created in Flex, and some in AIR extensions, but
    there would be limitations. You can't execute native applications
    from AIR applications, so you can't execute Perl scripts, Java
    apps, etc. from your AIR app. You can of course use FDS (Flex Data
    Services) to connect to POJO, EJB, JavaBeans, SOAP and other web
    services, etc.

  • Jar for weblogic client applications?

    I am developing a client applications that accesses some session beans from
    WLS 6.1 SP1.
    I am currently putting the weblogic.jar file in the classpath in order to
    be able to access the WLS JNDI server using T3/T3S.
    This weblogic.jar file is very large (about 25MB) and includes many things
    I am not using.
    Is there a way to make a client applications that accesses EJBs in a
    weblogic server without using that large file?
    Regards,
    Vegeta

    Please don't cross post. see my reply in weblogic.developer.interest.ejb.
    thanks,
    Michael
    Vegeta wrote:
    I am developing a client applications that accesses some session beans from
    WLS 6.1 SP1.
    I am currently putting the weblogic.jar file in the classpath in order to
    be able to access the WLS JNDI server using T3/T3S.
    This weblogic.jar file is very large (about 25MB) and includes many things
    I am not using.
    Is there a way to make a client applications that accesses EJBs in a
    weblogic server without using that large file?
    Regards,
    Vegeta--
    Michael Young
    Developer Relations Engineer
    BEA Support

  • .jar file for wls client application

    Is there a .jar file include files when client app needs at runtime

    You need weblogic jar file and if its ejb client application you might need client
    file that can be produced by ejbc.
    S
    "Wei Li" <[email protected]> wrote:
    >
    Is there a .jar file include files when client app needs at runtime

  • Get URL for WDJ application

    Hi guys!
    Deployed an application (ear file) on server.
    URL is: http://<server ip>:50000/webdynpro/dispatcher/sap.com/jaswd/JCaptcha?SAPtestId=2&answer=init&guid=4C19CB2279C6019DE10080000A0FF2AC
    Is there any class (like CL_WD_UTILITIES=>CONSTRUCT_WD_URL) to get this link from abap?
    Thanks!

    Hi,
         Is this a static link ? You can directly copy & paste the link and hardcode it.
    Thanks & Regards
    Umang

  • How to set up use of relative URLs for a BSP application

    Dear all,
    I need to access a BSP application through our external portal.
    This is failing because generated URLs are absolute URLs (they mention physical server name, not known of course on the internet) where they should be relative URLs (they use external portal URL as prefix).
    How to set this up?
    I'm logged on http://myportal.com/irj/portal and want to call a BSP application. To build this page, my internet client (Internet Explorer) tries to get elements from the server. Looking at HTTP trace, I can see that my IE is trying to reach the physical server, not known on internet of course, then page loading fails.
    Ex absolute URL : http://myservername.domain.com/sap/bw/[...]/image1.gif
    This is the behavior I can see at the moment.
    Relative URL : http://myportal.com/sap/bw/[...]/image1.gif
    This is what I'd like to see.
    Many thanks in advance for your help.
    François

    Any idea ?

  • Getting Pernr for WebDynpro ABAP application

    I am building a new WebDynpro ABAP application and I want to be able to get the PERNR for the user logged into the portal and this application.
    I have read some information on this forum about getting the URL or application parameters in order to get the userid or similiar parameters and to handle this within the Window in the HANDLEDEFAULT method of a WebDynpro ABAP application.
    I have looked into this and I don't think pulling information from the application parameters will work.  For example, I checked one of our current services for "Personal Data"  and when I go to the portal content administration,  application parameters, I don't see any reference to userid..etc.  I see Property ID, Property Category, Inheritance, End-User Personalization, and Property Description.  In addition, I do not see any information from the URL itself that I could use. 
    Here is the scenario.  The user logs into the portal using the 3 character Network id which in turn, I assume, gets their SAP userid and PERNR in order to retrieve all the HR infotype information for each service.  By the way, the service I mentioned above, "Personal Data", is written in JAVA, so I am not able to see how this particular service works or handles getting the userid and PERNR.
    Has anyone come across this scenario before and how was it handled in terms of getting the userid and PERNR?

    I was thinking that SY-UNAME would be available, but was not sure.  For some reason, I was thinking I was going to have to pass something from the applicaton parameters or some other method to my WebDynpro ABAP program..
    I am not the portal administrator so I have not yet added my WebDynpro ABAP program to the portal yet.  Once, it's added, I will check out the availablility of sy-uname.
    Thanks.

  • User wants individual url for each deployed application

    We have about 20 j2ee applications deployed on iAS, using separate oc4j containers. They have been accessing the applications with the contextroots. Now, our users would like to access the individual applications with a unique URL. ie, instead of server:port/app01, they would like app01-server:port.
    I managed to use apache rewrite to make it work for 1 application, but it would be a mess to do it for 20+ applications. Does anyone know of a better way?
    Thanks.

    hi
    the table where d i s c o unt is XXNP_OPN_JOBLOG_001 here there is a primary key opn_joblog_001_id(data block xxnp_jl_001)
    the table where slurry is XXNP_OPN_JOBLOG_SLURRY_003(data block XXNP_SLURRY_OO1) here apart from its primary key opn_joblog_007_id the same column opn_joblog_001_id is also presentkindly guide
    thanking in advance
    Edited by: makdutakdu on Dec 18, 2011 2:47 PM
    Edited by: makdutakdu on Dec 18, 2011 2:47 PM

Maybe you are looking for

  • Can't reduce iPod Classic's volume

    I have just bought my first iPod (classic model, 80GB) and I'm experiencing a lot of problems for adjusting it's volume. The minimum default volume seems to be set at a really loud level, so I can't reduce it or silence it at any time, it only lets m

  • Why won't digital editions recognise a fulfillment server when I am connected to the internet?

    Hi Digital editions has always worked well but now when I try to download a book it tells me it cannot find the fulfillment server and make sure I am connected to the internet. I have tried reloading it but still get the same response.

  • Consolidation made thousands of duplicates

    I have never had problems with consolidation until today. But today I clicked the consolidate button and after about a minute of watching the blue bar, I realised that something was wrong, as I thought there were only about 100 songs or so to move. I

  • [solved] Pacman seems to think i have nothing installed

    ok im quite new to arch linux and ive been attempting to get to grips with it quickly so i may have done something stupid here... i installed arch with kde and have switched recently to the ice kernel, due to tryingto get compiz running and needing t

  • Wscompile, error: the following naming conflicts...

    Hi, I am stuck with a naming conflict in some wsdl that I cannot change. The issue is apparently related to the names of types that differ only by the case of the first letter, one is upper, the other is lower. wscompile apparently tries to fix that