ClassCastException - App Client

Hi, I'm running an application client to test a program, but I keep getting a java.lang.ClassCastException.
Error message:
java.lang.ClassCastException at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemotObject.java:293)
at javax.rmi.PortableRemoteObject.narrow(PortableRemotObject.java:134)
at VehicleClient.main(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflec......
The client program is named VehicleClient. I'm able to deploy the application in deploytool and verify with no failures. But when I run my client application, I get the above error.
VehicleClient.java codes:
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import java.util.*;
import javax.ejb.*;
public class VehicleClient {
public static void main(String[] args) {
boolean results = false;
try {
Context initial = new InitialContext();
Object objref = initial.lookup("java:comp/env/ejb/MyVehicleManagerHome");
VehicleManagerHome home=
(VehicleManagerHome)PortableRemoteObject.narrow(objref,
VehicleManagerHome.class);
VehicleManager VM = home.create();
/********ERROR in following statement*******************/
results = VM.selectVehicleByPrimaryKey("123");
if (results == true)
System.out.println("The Vehicle exists");
else
System.out.println("The Vehicle does not exist");
System.exit(0);
} catch (Exception ex) {
ex.printStackTrace();
Any help is much appreciated! Either reply to this message or email me at [email protected]
Thanks!

You need to populate your InitialContext object with the values for the URL of the container on which your bean is deployed and the JNDI service provider's factory class name like this -
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
    <JNDI provider's factory class name>);
env.put(Context.PROVIDER_URL, <container_url>);
Context ctx = new InitialContext(env);Then use this context object to perform your bean lookup.
Hope this helps.

Similar Messages

  • Access denied report App\Client SDK

    Server crashed, therefore I reinstalled Crystal Reports 9 & Crystal Enterprise 9 and attempting to rebuild the ASP pages which pass report parameters. The error received is:
    Technical Information (for support personnel)
    Error Type:
    webReporting.dll (0x80004005)
    Access denied. Please check directory setting for files you can access.
    /HTMLViewers/reportgenerator.asp, line 31
    Browser Type:
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 2.0.50727)
    Page:
    GET /HTMLViewers/reportgenerator.asp
    Line 31 on the page reads:
    .processHttpRequest Request, Response, Session
    Running the registry moniter I receive an access Denied for hklm\software\Crystal Decisions\9.0\report App\client SDK
    This is my first time on the forum, hope I explained myself properly.

    Thanks Shaun, I appreciate your link for the process monitor application. This replaces my older seperate reg mon & file mon apps.
    I have now been able to determine that my application is getting to where it is calling  the cachemanager.dll and it is experiencing the problem. I tried manually registering this dll and receive the error Loadlibrary("cachemanager.dll")failed. GetLastError Returns 0x00000007e.
    If I change the ASP pages to a very simple process, it will run the demo report, and my report. Once I attempt to use the ASP page with the login requesst, and parameter call I receive this error.
    Error Type:
    webReporting.dll (0x80004005)
    The system cannot find the path specified.
    /HTMLViewers/reportgenerator.asp, line 31
    Browser Type:
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 2.0.50727)
    Page:
    GET /HTMLViewers/reportgenerator.asp
    The reportgenerator ASP page which is causing this error is:
    trace.write(category,message)
    trace.warn(category,message)
    <%@ Language="VBScript"%>
    <%
    'Declare variables for the report viewer and the ObjectFactory objects, and create the ObjectFactory object.
    Dim ObjectFactory, userName, password
    dim clientid
    dim reportid
    clientid = request.querystring("Clientid")
    session("Clientid") = clientid
    reportid = request.querystring("reportid")
    ' open a report
    ' copy this report to "Report Directory" in RAS Configuration Manager
    Session("ReportName") = "C:\Program Files\Crystal Decisions\Report Application Server 9\Reports\logonparm\" & reportid
    userName = "SYSDBA"
    password = "masterkey"
    'Create the ObjectFactory for use in creating other Crystal Objects
    Set ObjectFactory=CreateObject("CrystalReports.ObjectFactory.2")
    'Instantiate the Server Control object which allows us to collect information about the required
    'inputs to run the report
    Set ServerControl = ObjectFactory.CreateObject("CrystalReports.CrystalReportServerControl")
    With ServerControl
       .ReportSource = Session("ReportName")
       .EnableLogonPrompt = False     ' Set this to false so that we can override the controls prompting for logon
       .processHttpRequest Request, Response, Session
    End With
    Set Session("ReportParameters") = ServerControl.ParameterFields
    ' Set Login info for all connections
    ' ***************** Added to logon using Viewer SDK *****************************
    Set connectionInfos = serverControl.databaseLogonInfos
    For x=0 To connectionInfos.count - 1
         Set connInfo = connectionInfos.Item(x)
        connInfo.UserName = CStr(username)
         connInfo.Password = CStr(password)
    Next
    For each parameter in Session("ReportParameters")
              Set parameterField = parameter
              paramName = parameterField.Name     
              if paramName = "INTERFACE ID" then
                   Dim paramValue
                   Set paramValue = ObjectFactory.CreateObject("CrystalReports.ParameterFieldDiscreteValue")
                   paramValue.Value = session("Clientid")
                   parameterField.CurrentValues.RemoveAll
                   ' Add this value to current value list
                   parameterField.CurrentValues.Add paramValue 
              end if
    Next
    Set clientDoc = CreateObject("CrystalClientDoc.ReportClientDocument")
    clientDoc.Open session("ReportName")
    set session("oclientdoc")=clientdoc
    Session("pathReport") = pathReport
    Set Session("connectionInfos") = connectionInfos
    Response.Redirect "Viewer.asp"
    %>
    My appologies if I do not explain my problem well. I am not an ASP programmer, and am desperatly looking for assistance to resolve this problem. If anyone can refer a contract programmer that would be interested and capable of assisting me, that would be appreciated. I believe I am close to resolving this problem. I purchased a support session only to find out that this version is no longer supported.

  • Can't run app-client example (cont.)

    I added an application-client.xml file in src\client:
    <?xml version="1.0"?>
    <!DOCTYPE application-client PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.2//EN" "http://java.sun.com/j2ee/dtds/application-client_1_2.dtd">
    <application-client>
    <display-name>WS Application Client</display-name>
    <web-service>
    <display-name>A Basic Hello World Web Service </display-name>
    <description>A webservice that takes a string input and returns one</description>
    <wsdl-input url="http://localhost:8888/hello/HelloService?WSDL">
    </wsdl-input>
    <source-output-dir>build/src/client</source-output-dir>
    <proxy-gen>
    <package-name>oracle.demo.hello</package-name>
    <output>build/classes/client</output>
    <http-proxy>www-proxy.us.oracle.com:80</http-proxy>
    </proxy-gen>
    </web-service>
    </application-client>
    No longer have the complaint about that file. The error changes to:
    assemble:
    is-remote-ws-up:
    [get] Getting: http://localhost:8888/hello/HelloService?wsdl
    run:
    [echo] invoking webservice application client..
    [java] ServiceConsumerAppClient:consumeService() invoked
    [java] javax.naming.NameNotFoundException: hello/HelloService not found in Application
    Client
    [java] at com.oracle.naming.J2EEContext.getSubContext(J2EEContext.java:101)
    [java] at com.oracle.naming.J2EEContext.lookup(J2EEContext.java:84)
    [java] at com.evermind.naming.SubFilterContext.lookup(SubFilterContext.java:59)
    [java] at javax.naming.InitialContext.lookup(InitialContext.java:347)
    [java] at oracle.ServiceConsumerAppClient.consumeService(ServiceConsumerAppClient.j
    ava:38)
    [java] at oracle.ServiceConsumerAppClient.main(ServiceConsumerAppClient.java:24)
    [java] result from service :hello/HelloService not found in Application Client
    all:
    BUILD SUCCESSFUL
    Out of the box, the app-client is trying to connect to:
    Service service = (Service)ic.lookup("java:comp/env/service/MyHelloServiceRef");
    The complaint is that:
    hello/HelloService not found
    So which should it be? 'service/MyHelloServiceRef' or 'hello/HelloService'
    And which source and config files need to be modified.
    Also notice that i don't have any client stub files in my build\classes directory. That seems a bit odd. Do I need to gen-stubs as part of the build process?
    -David

    Hi David,
    Not sure if you are still facing the issue .
    Just wanted to point out a couple of things which might becausing your app-client demo to fail .
    1. The remote webservice application which this client is trying to consume , the helloservice,application is not deployed .
    2. The packaged application-client.xml is fine , this is a special demo showing how you can invoke a webservice if you are interested in doing only certain things and not others .Look inside the client code of this demo and compare it with client of say the web-client/ demo .The different invocation styles .
    3. The 'result.wsdl' that you see is just a copy of the remote ws's wsdl , that gets saved as a result of the ant tasks which checks to see if the remote ws is up .
    4. Do an ant clean and run the tests again and let us know if the error's persists in your environment .

  • Multiple GET will cause "Add Azure API App Client" to fail

    Hi,
    I'm just playing around with the new Azure App Service API Apps. I've followed the documentation and created the contact list API. I've added to that and created a second GET method with an integer parameter. This works well on the local machine and when
    deployed to Azure. However, when I try to add an App Client I get an enormous error. The important bit, I think, is the message 'Invalid swagger: the operation \"Contacts_Get\" is defined multiple times.' If I remove the second GET message and republish
    then adding an App Client works again.
    Is this a bug or is it a limitation of Swagger. The Swagger UI seems to cope with it effectively.
    Cheers,
    W

    It has to do with how Swashbuckle is auto-generating the operation ids that appear in swagger. The Logic App designer only wants to have 1 operation for each operation id -- it doesn't like ambiguity.
    I built out a library to help cope with this and other issues
    over here, if you use that you can provide a unique "friendly name" for each action (which will then generate a title cased operation id for each).
    In the alternative, you could write a custom operation filter to feed to Swashbuckle to override the operation ids that it is generating for you in the background. You can see how to do that
    over here.

  • Running an Enterprise App Client

    Hi,
    I am using the J2EE Reference Implementation (1.4) and am trying some examples from the J2EE 1.4 Tutorial.
    I am able to successfully deploy and run examples. As per the tutorial the Client apps are run by the command
    $ appclient -client MyClientJar.jarIn this case my App Server and client are on the same machine.
    Could you please help me so that I can run the Client Apps using java rather than the RI specific appclient command.
    I suppose this involves some JNDI settings.
    Thanks
    Rahul

    Take a look at Chapter 8, Developing Application Clients, in the Developer's Guide. It describes how to write app clients that use the app client container and Java clients that do not.
    Note that app client containers are discussed in the J2EE spec. The implementation is left to the app server vendors. So, although the appclient command itself may be specific to Sun's product, the idea of an app client container is definitely not.
    - Tim
    Sun's app server engineering team

  • Do app-clients always need a user specified.

    I have a app client that I start manually. It receives a message (MQSeries/non JMS), calls some ejb's, processes the transaction and is done.
    I also have a web tier that provides a gui front end to the same process mentioned above.
    Here is the situation: If someone uses the web tier first after OC4J starts up, everything works fine.
    If after OC4J starts up, a transaction hits the app-client first (a MQSeries message/non JMS) and uses the ebj, when a user attempts to use the web tier (and same ejb's), I get a "guest is not allowed to call this EJB method, check your security settings (method-permission in ejb-jar.xml and security-role."
    Is there something I am missing? Should I be at least specifying a user for my client in my application.xml even though I am not setting auto-start="true"? We never had a problem like above until I started using app-clients, so I tend to belive that we had it all set up correctly for the web-tier. I could be wrong though.
    There is another thread sort of related to this. How Are Application Clients Run By OC4J? in orion-application.xml)" error.

    When looking up the EJB are you have to specify the
    java.naming.security.principal=SCOTT     
    java.naming.security.credentials=TIGER
    when looking up the EJB. This user specified while looking should have permission to execute the ejb method.
    anyway what version are you using ?
    regards
    Debu

  • Calling EJB from app client

    Hello, everybody,
    I'm very new at EJB and I'm trying to learn it.
    I have created Enterprise Application using Netbeans IDE, I have EJB and APP client. What I want is to connect to my MySql database and get some info from table.
    For e.g. Login and Password.
    How can I call EJB from my client app which connects to my database and gets information I need?

    What server you are using?
    if you use jboss AS ,here is a simple Main class how to connect EJB and access ejb methods:
    package com.david.ejb.client;
    import java.util.Properties;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.rmi.PortableRemoteObject;
    import com.david.ejb.domain.Person;
    import com.david.ejb.domain.PersonRemote;
    public class Main {
         public static void main(String[] args) {
              try {
                   Context ctx = getInitialContext();
                   Object obj = ctx.lookup("PersonSessionRemote/remote");
                PersonRemote pr=(PersonRemote)PortableRemoteObject.narrow(obj, PersonRemote.class);
                Person p=new Person();
                p.setName("david");
                pr.addPerson(p);
                pr.findPerson(1);
                   // System.out.print(br.find(pk).getAuthor_name());
              } catch (Exception ex) {
                   ex.printStackTrace();
         private static Context getInitialContext() throws NamingException {
              Properties p = new Properties();
              p.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.NamingContextFactory");
              p.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
              p.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099");
              return new InitialContext(p);
    }Person is ant @Entity and PersonRemote is remote interfaces, to connect database you have to make datasource file at jboss-4.2.3.GA\server\default\deploy
    simle mysql-ds.xml looks like this:
    datasources>
       <local-tx-datasource>
          <jndi-name>some name</jndi-name>
          <connection-url>jdbc:mysql://localhost:3306/dbname</connection-url>
          <driver-class>com.mysql.jdbc.Driver</driver-class>
          <user-name>root</user-name>
          <password>root password</password>
          <min-pool-size>5</min-pool-size>
          <max-pool-size>100</max-pool-size>
          <idle-timeout-minutes>15</idle-timeout-minutes>
          <exception-sorter-class-name>com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter</exception-sorter-class-name>
          <valid-connection-checker-class-name>com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker</valid-connection-checker-class-name>
       </local-tx-datasource>
    </datasources>also at resources/META-INF directory you must have persistence.xml like this
    <persistence>
         <persistence-unit name="SimpleEjb">
              <jta-data-source>java:/some name</jta-data-source>
              <properties>
                   <property name="hibernate.hbm2ddl.auto" value="update" />
                   <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
                   <property name="hibernate.show_sql" value="true"/>
                   <property name="hibernate.format_sql" value="true"/>
              </properties>
         </persistence-unit>
    </persistence>

  • Trouble with deploying a standlone Java app/client that calls an EJB

    Hey guys,
    I am well aware that there are many topics that are quite similar to this topic that I am posting but the fact of the matter is I have failed to procure a satisfactory answer.
    So a bit of background about the environment I am using. I am using Netbeans 5.5 development build, today's version, JDK 6 Build 77, and Sun Application Server 8.2 to create, run and learn J2EE 1.4 based apps following the Sun J2EE 1.4 tutorial pdf and the Netbeans 4.1 tutorial pdf which I realize is a bit outdated but it gets the job done for the most part.
    I have satisfactorily created and built the Converter application as described in the above mentioned tutorial pdfs. For memory refreshment purposes, it is the simple session bean example where it is stateless and remote and has 2 business methods:
    dollarToYen(BigDecimal dollar)
    yenToEuro(BigDecimal yen)So I have this EJB being called, for learning purposes, by both a JSP and a Servlet as well as a standalone Java client. Now since the development machine is where I am deploying and running the enterprise application, everything works without a hitch. Once I have the Application server up and running I am able to access and execute the EJB's methods through JSP and Servlet even from remote machines on my home LAN. I realize that since the JSP and Servlet are in the same application context as that of the EJB I am not requiring the client jar which is where my confusion starts coming in. I know I need the client jar when I try to run the standalone java client from a different machine because it simply cannot access the EJB I have written.
    Now I found this link below and I read it and sorta understand it. I also found that under C:\AppServer\domains\domain1\applications\j2eeapps\ConverterApp I see a file called ConverterAppClient.jar. Is this the so called client jar? If so how do I go about using it?
    Before I end my rather long post, let me detail the steps I used to create the standlone Java client. I selected java application in the new menu of Netbeans and gave it the name ConverterClient and the IDE then proceeded to create a main class for me with a main method where I stuck in the following code:
    try
                Context c = new InitialContext();
                Object remote = c.lookup("ejb/ConverterBean");
                ConverterRemoteHome rv = (ConverterRemoteHome) PortableRemoteObject.narrow(remote, ConverterRemoteHome.class);
                ConverterRemote converter = rv.create();
                BigDecimal param = new BigDecimal(100);
                System.out.println(param + " Dollars are  " + converter.dollarToYen(param) + " Yen.");
                System.out.println(param + " Yen are " + converter.yenToEuro(param) + " Euro.");
            catch (RemoteException ex)
                ex.printStackTrace();
            catch (ClassCastException ex)
                ex.printStackTrace();
            catch (NamingException ex)
                ex.printStackTrace();
            catch (CreateException ex)
                ex.printStackTrace();
        }and that code works when I call it from the same machine that the Application Server is running with the EJB deployed. I also added in the classpath of the client application, the j2ee.jar and the other appserv-rt.jar as well. Have I missed anything?
    I even tried using the deploytool but to no avail as all it generated for me was the same jar file that I found underneath the Application server application directory as I mentioned earlier.
    If anyone is willing to help me, I will upload my Netbeans project files and all you have to do is open it through Netbeans 5.5 to recreate the exact scenario I am talking about.
    Thanks in advance. I apologize for the rather long post but I thought it would be best to provide as much details as was possible.
    Cheers,
    Surya

    hI,
    Pls, I'm happy to know u r using application server. I have just started reading enterprise bean.
    But I could not set the path and some other configurations for it to start working.
    Pls, I would be most grateful, if u could put me through on how to configure application server.
    Right now, I'm in the state of dilemma due to the insufficient knowledge in it.
    My email is [email protected]
    Remain blessed

  • SP is undefined in sharepoint hosted app client Webpart

    Hello All,
    For a client web part in sharepoint hosted app, I am getting the following error
    "SP is undefined".
    My code is bel0w
       <script
     type="text/javascript"
     src="//ajax.aspnetcdn.com/ajax/4.0/1/MicrosoftAjax.js">
    </script>
        <script type="text/javascript" src="../Scripts/jquery-1.9.1.min.js"></script>
         <script  type="text/javascript" src="/_layouts/sp.core.js"></script>
        <script type="text/javascript" src="/_layouts/15/sp.runtime.js"></script>
            <script type="text/javascript" src="/_layouts/15/sp.js"></script>
        <script type="text/javascript">
            'use strict';
            $(document).ready(function () {
                        ExecuteOrDelayUntilScriptLoaded(loadConstants, "sp.js");
                    var  clientContext = SP.ClientContext.get_current();
                   var  web = clientContext.get_web();
    </script>     ....
    I am getting the error ExecuteOrDelayUntilScriptLoaded is undefied. This script is in client Web part
    Any help is appreciated.
    Vishnu

    Thanks for the reply Geetanjali.
    var  clientContext = SP.ClientContext.get_current();
     var  web = clientContext.get_web();
    These two lines of code is supposed to be inside "loadConstants" method.
    After changing the code as below, I am able to get SPClientContext and SPWeb.Also, host and appweb url as well
    <script
    type="text/javascript"
    src="../Scripts/jquery-1.6.2.min.js"></script>
     <script
    type="text/javascript"
    src="//ajax.aspnetcdn.com/ajax/4.0/1/MicrosoftAjax.js"></script>
     <script
    type="text/javascript"
    src="../Scripts/App.js"></script>
    $(document).ready(
        function () {
    var spHostUrl = decodeURIComponent(getQueryStringParameter('SPHostUrl'));
          var appWebUrl = decodeURIComponent(getQueryStringParameter('SPAppWebUrl'));
    var layoutsRoot = spHostUrl + '/_layouts/15/';
            $.getScript(layoutsRoot +
    "SP.Runtime.js",
    function () {
                $.getScript(layoutsRoot +
    "SP.js", loadConstants);
    function loadConstants() {
                context =
    new SP.ClientContext.get_current();
                web = context.get_web();
    Thanks
    Vishnu
    dfd

  • __REQUESTDIGEST is undefined in sharepoint hosted app ( Client WebPart ) but its working in full page app

    I have found the answer in below url. but howerver i am not sure from where the "accessToken" coming.
    Any idea?
    http://social.msdn.microsoft.com/forums/windowsapps/en-us/816291e7-8081-46e0-8ec3-e67613d1621f/requestdigest-is-undefined-in-sharepoint-hosted-app?forum=appsforsharepoint
    Navaneeth

    Okay. Finally i found solution after 2 weeks :)
    Below is the way to use. Note its working in both Single Page App and Client App Part as well
    var formDigest; //Declare the variable
    //Document Ready
    $(document).ready(function () {
        hostweburl = decodeURIComponent(getQueryStringParameter('SPHostUrl'));
        appweburl = decodeURIComponent(getQueryStringParameter('SPAppWebUrl'));
        scriptbase = hostweburl + '/_layouts/15/';
        CharacterAnimation();
        $.getScript(scriptbase + 'SP.Runtime.js', function ()
            $.getScript(scriptbase + 'SP.js', function ()
                $.getScript(scriptbase + 'SP.RequestExecutor.js', getFormDigest);
    //Get  Form Digest Value
    function getFormDigest() {
        var appweburl = decodeURIComponent(getQueryStringParameter('SPAppWebUrl'));
        $.ajax({
            url: appweburl + "/_api/contextinfo",
            type: "POST",
            headers: {
                "accept": "application/json;odata=verbose",
                "contentType": "text/xml"
            success: function (data) {
                requestdigest = data;
                var formDigest = data.d.GetContextWebInformation.FormDigestValue;
                DoSomething(formDigest);
            error: function (err) {
                alert(JSON.stringify(err));
    //Do Something Method
    function  DoSomething(formDigest) {
    var urltest = appweburl + "/_api/SP.AppContextSite(@target)/web/lists/getByTitle('List1')/getitems(query=@v1)?@v1={\"ViewXml\":\"<View><Query><Where><BeginsWith><FieldRef Name='Title'/><Value Type='Text'>A</Value></BeginsWith></Where></Query><RowLimit>1</RowLimit></View>\"}&@target='"
    + hostweburl + "'";
            $.ajax({
            url: urltest,
            type: "POST",
            headers: {
                "Accept": "application/json; odata=verbose",
                "Content-Type": "application/json; odata=verbose",
                "X-RequestDigest": formDigest
            contentType: 'application/json',
            success: function (data) {
                alert(data); // Finally found [Object][Object] :)
            error: function (data) {
                alert(data.responseText);
    Navaneeth

  • WebLogic app client PKI (CAC ) authentication

    Has anyone done the client CACed (Common Access Card) Weblogic app? Can anyone point me to document?
    We have a Weblogic app which is authenticated by LDAP. I have the requirement for enabling PKI client authentication.
    Edited by: user12220476 on May 8, 2010 9:37 AM

    PKI Based authentication if I am not wrong is Certificate Based Authentication.
    You can achieve it by configuring 2 Way SSL with Weblogic Server.
    Weblogic Server will validate the certificate presented by the client.
    To know what configurations are reqd on WLS, go through this post.
    http://secure-zone.blogspot.com/2009/10/configuring-two-way-ssl-between-client.html
    You will get some idea.

  • Does JMS support reliable messaging (store-and-forward) for app clients?

    I need to write an enterprise application client (launched with Java web start or packaged with a tool like Sun's package-appclient) that can send messages reliably from Linux to Windows. JMS seems like the obvious solution, so I deployed an EAR file with an MDB and an application client on a Windows machine (running SJSAS 9). I was able to download the client jar file onto Linux and send JMS messages successfully. However, if the Windows machine is not available, the Linux client immediately throws exceptions and fails. Are there any JMS providers that provide a store-and-forward mechanism for enterprise clients, so that if the remote server is not available immediately, messages are delivered later? (Note that the client can't be a servlet or other server-managed component.)
    I'd prefer an open-source solution, but this requirement has an extremely high priority for my customer, so I'll use a commercial product if necessary. And if there's something other than JMS that works, that would be fine. (In my case, the messages on the remote side ultimately go to a .NET service, so WS-ReliableMessaging would be ideal, but it looks WS-RM won't be integrated into .NET until Vista, and the current WS-RM implementation is a beta, etc., etc.)
    Thanks,
    Mike

    You could use Apache ActiveMQ
    http://incubator.apache.org/activemq/
    which supports embedded brokers inside each JVM which can be networked together in a store-forward mechanism so that each application keeps working and store-forwarding messages.
    http://incubator.apache.org/activemq/networks-of-brokers.html
    or you can use failover transport to handle automatic reconnection...
    http://incubator.apache.org/activemq/how-can-i-support-auto-reconnection.html
    If you need to communicate with some .Net you can use the NMS - the .Net Messaging API which has a client for ActiveMQ as well...
    http://incubator.apache.org/activemq/nms.html
    James
    http://logicblaze.com/
    Open Source SOA

  • NameNotFoundException in JNDI lookup in for stand alone App client in EJB3

    I created an ejb module in netbeans 5.5 added a session facade (SavingsaccountFacade) and downloaded it to SunAppServer 9 (java EE 5). When I try and access the JNDI name in a stand alone java application client using the following code
    Context initial = new InitialContext();
    Object objref = initial.lookup("ejb/SavingsaccountFacade");
    I get the following errors:
    javax.naming.NameNotFoundException: SavingsaccountFacade not found
    at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:203)
    I have added j2ee.jar, appserv-rt.jar, and the dist/SavingsAccount.jar to the library. When I do a similar thing in J2EE1.4 it worked fine.
    Can somebody help please.
    Thanks

    Hi Dave,
    Here's our EJB FAQ entry that explains how EJB Global JNDI names are set in the
    Java EE 5 SDK and Glassfish. The most likely explanation is that the name used
    in the client does not match the one assigned to your EJB in sun-ejb-jar.xml.
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#SessionBeanGlobalJNDINameAssignment
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • App client can't instantiate the initial context factory

    hi
    i wrote an application client and a stateless session bean that i deployed with the deploytool from sun to the j2ee application server. now when i start my application client i get the following message:
    NoInitialContextException: Cannot instantiate class: COM.sun.enterprise.naming.SerialInitContextFactory. Root exception is java.lang.ClassNotFoundException: COM.sun.enterprise.naming.SerialInitContextFactory
    at java.net.URLClassLoader$1.run
    my jndi.properties looks like this:
    java.naming.factory.initial=COM.sun.enterprise.naming.SerialInitContextFactory
    java.naming.factory.url.pkgs=COM.sun.enterprise.naming
    and my server runs on the same computer as the client. the classpath variable is set to the j2ee.jar file ( and this file contains the selected initial factory ). i could not understand why i get this errormessage. has anyone a idea?

    thanks to all
    now i got it working. i'm using the orion application server and to get access from a remote computer ( outside the application server ) i have to set the environment properties in the following way:
    Properties prop = new Properties();
                        prop.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.rmi.RMIInitialContextFactory");
                        prop.put(Context.PROVIDER_URL,"ormi://localhost/TestBean02");
                        prop.put(Context.SECURITY_PRINCIPAL,"admin");
                        prop.put(Context.SECURITY_CREDENTIALS,"123");
    InitialContext initial = new InitialContext(prop);
    Object objref = initial.lookup("MyBeanel");
    home = (TestBeanHome)PortableRemoteObject.narrow(objref, TestBeanHome.class);
    this works, the client needs only the j2ee.jar and the orion.jar in the classpath.

  • Enterp App Client Packaging Error

    Hello,
    I'm trying to make work this simple example:
    https://glassfish.dev.java.net/javaee5/ejb/examples/Sless.html
    Basically it's this:
    1) A Stateless Session bean that has a Remote business interface with a single business method.
    package ejb30;
    import javax.ejb.Remote;
    @Remote
    public interface Sless {
    public String hello();
    2) a bean implementation :
    package ejb30;
    import javax.ejb.Stateless;
    @Stateless
    public class SlessBean implements Sless {
    public String hello() {
    return "hello, world!\n";
    3) An Enterprise Application Client:
    package ejb30;
    import javax.ejb.EJB;
    public class SlessAppClient {
    @EJB
    private static Sless sless;
    public static void main(String args[]) {
    System.out.println("Sless bean says : " + sless.hello());
    If you build these files in Netbeans (one projet for the EJB and another for the AppClient) it doesn't work.
    The AppServer (SunJavaSystemAppServer 9.01) issues the folloing exceptions:
    "Class [ Lcom/sun/tutorial/javaee/ejb/ConverterRemote; ] not found. Error while loading [ class com.sun.tutorial.javaee.ejb.ConverterClient ]"
    "Error in annotation processing: java.lang.NoClassDefFoundError: Lcom/sun/tutorial/javaee/ejb/ConverterRemote;"
    The Application Client "run" tab window shows the following exception:
    "java.lang.NullPointerException"
    Comparing the generated files, we see that the Netbeans doesn't include the business interface ".class" in the Jar file, although it's listed and checked for packaging in the project's Properties/Libraries.
    Is this a bug in Netbeans 5.5? Is there some workaround? How can we force to package something in the resulting Jar?
    By the way, I can't find an official forum to discuss Netbeans. Does anyone knows if there is such forum?
    Thanks in advance,
    Marcos

    It really seems to be a bug in Netbeans.
    The workaround is to add the Remote Interface .class file in the sources listing:
    Right click the AppClient project, Properties, Sources and click on the "Add Folder..." button to add a new "Source Package Folder"

Maybe you are looking for

  • Switch phone numbers between 2 different sized SIM Cards?

    I have an HTC One and my dad has an iPhone 5. I want to switch phones with him but the iPhone 5 has a nano sim and the HTC One has a micro sim. Is their a way i can just switch phone numbers on the sim card? for example I have my phone number on my c

  • Creation Application System

    I installed Designer & createrd repository without any problems but when I tried to run designer I did not see any application system and when I tried to create new I got error could not find PL/SQL module. What shoul I do?

  • ORG model transfer

    Hai Michael Van Geet and Swathi, I wnat to transfer the org model from one crm client to other crm client(dev to production).As you said Org model is msater data and it is possible to extract HRMD_ABA idocs and import to prod client. how to extract H

  • GZIP compressing input stream?

    I have an API which takes an InputStream for feeding in large binary data. Suppose I want to write a wrapper around that API which GZIPs the data on the fly. This would require some kind of InputStream which will compress the data with GZIP on the fl

  • Importing old old logic environments

    Hi, I'm one of those people who are generally resistant to change. I've been using Logic for years on a PC and finally switched to Mac. I used to have Logic Audio Platinum 4.8 running on a windows 98 PC. Now I have Logic Express 7.2 running on an int