EJB Client JAR project produces empty JAR

I've built an EJB module in WorkSpace Studio using the "WebLogic EJB Project" type, which is part of an EAR. I created a couple stateless session beans within this project, and then created an EJB Client JAR project using the "EJB Client JAR-->Create EJB Client Jar" menu item on the EJB project's hidden menu.
According to the documentation, exporting an EAR file from the EAR project will cause the client JAR to be generated. I exported the EAR file from the EAR project, and sure enough, it included the client JAR (in /APP-INF/lib/). I extracted the client JAR from the EAR and opened it up to make sure it contained all of the client-side classes. I discovered that the client JAR was empty, the only contents being the MANIFEST.MF file. The interface classes were instead contained in the EJB JAR itself.
How can I get the EJB client code to actually be included in the EJB client JAR?
Thanks,
Eric

Well I have tried this with 6.1 and first
1. One would expect the jar name to be the name in the ejb-jar.xml -
ejb-client-jar section
2. It outputs the file XXXEJB_Compiled.jar but it is same size as base jar
this is 6.1 sp3
whats up?
Matthew Shinn wrote:
Hi Sanjay,
There is a bug in the documentation. The client-jar name should never be part of the
ejbc command line. Step 3 below should be something like:
java weblogic.ejbc xxxEJB.jar xxxEJB_Compiled.jar
If you have an ejb-client-jar entry in your ejb-jar.xml, the client jar should be placed
in the directory from which you ran ejbc. Make sure that the classes that you want to be
put in the client-jar are not loaded from the classpath. This is very important or your
client-jar won't be created correctly. The client-jar will only contain classes loaded
from the input jar to ejbc. A bug for the incorrect documentation has already been filed
and should be fixed soon.
- Matt
Sanjay Dwivedi wrote:
Hi,
I am trying to use the
<ejb-client-jar> sub-element of the Sun's <ejb-jar> (EB 2.0 DTD) element of the
ejb-jar.xml to generate the ejb-client.jar. I followed the step as documented
by WebLogic but the files in EJB jars and ejb-client jars are identical. Here
is what I am doing:
1. Build the xxxEJB.jar for my EJB by running the WebLogic.ejbc on the standard
EJB jar file.
2. My ejb-jar.xml file has following line:
<ejb-jar>
<ejb-client-jar>xxxEJBClient.jar</ejb-client-jar>
</ejb-jar>
3. Next I used the following command to generate the ejb-client.jar file
java weblogic.ejbc xxxEJB.jar xxxEJBClient.jar
My xxxEJBClient.jar files consists of exactly same files (with same sizes) as
the xxxEJB.jar file. Only difference is that the xxxEJB.jar file includes generated
java source files for the bean implementation class and home/remote classes.
In my opinion the xxxEJBClient.jar should not contain the EJB implementation classes.
Any experience using the ejb-client-jar for generating the ejb-client.jar?
Thanks,
Sanjay.
[att1.html]

Similar Messages

  • EJB Client JAR Creation - Workspace Studio (ALSB 3.0/WLS 10)

    hi
    I'm trying to create an EJB Client JAR for an 2.1 Session Bean EJB Created in a WLS 10 domain using BEA Workspace Studio (i.e. this is the Aqualogic Service Bus 3.0 Product install).
    I'm doing this in preparation for testing the ALSB EJB Transport which requires a client JAR.
    I simply can't get a useful JAR from the facility provided in the Workspace IDE. The Workspace help is pointing to an IBM generated page and I'm following the procedure there.
    I have configured the EJB for an EJB Client Project.
    If I export an EAR from the Application containing the EJB, the EAR only contains the EJB JAR (with a Manifest entry to a non-existent Client JAR).
    If I export the EJB Client Project to a JAR the JAR is simply empty i.e. contains some descriptor type artefacts but no classes.
    I have tried this quite a few times with the same outcome. Can anyone from BEA or the user community confirm whether or not this facility actually works!
    Thanks
    Jim Nicolson

    http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/ejbTransport/ejbtransport.html#wp1079062 . This is document for OSB 10xx and yours is a a version or two older than this (So it will be applicable).
    Can you please check if your EJB are complying to 2.1specification?
    However the latest version of service has support for both EJB 2.1 and EJB 3.0 specification
    http://download.oracle.com/docs/cd/E14571_01/doc.1111/e15866/ejb.htm#CCGIFFCI
    Thanks
    Manoj

  • Using JarSettings to generate EJB client jar, but supported classes missed

    Appreciated for any comments in advance.
    I am using @jarSetting to generate EJB client jar file from workshop 9.2. The remote method of EJB has one input parameter that is defined as an interface. The interface is included in client jar, but the implementation of this interface is not.
    Please advise how I can add the implementation of this interface to client jar?
    Best Regards,
    James

    Hi James,
    I believe the algorithm for creating the client jar is to simply inspect the EJB interfaces using reflection and to include all user defined classes and exceptions that are referenced by the interfaces. In your case, it sounds like a class is not being included because it is not directly referenced by one of the EJB interfaces.
    I think the client jar creation algorithm can be described as "best effort" and unfortunately, it does not always end up including all classes needed by the client. I would recommend you add the additional classes manually using the jar tool.
    - Matt

  • EJB client needs both source and generated jars?

    From within JDeveloper, I created a basic EJB with a default package called EJBHello. Here is my directory structure after building and deploying this EJB:
    h:\EJBHello\EJBHello\EJBHome.java, etc.
    h:\EJBHello\EJBsource.jar
    h:\EJBHello\EJBgenerated.jar
    h:\EJBHello\EJBClient.java
    With only EJBgenerated.jar in the classpath, the client ran fine in this environment. However, when I renamed h:\EJBHome\EJBHome to h:\EJBHome\temp, the client would no longer run - java said it could not find EJBHello\EJBHome.class. I then added EJBsource.jar to the classpath, and the client would once again run. Does this mean that, in general, I must ship both the source and generated jars with the client classes?

    You need to deploy the class files specific to your client as well as the generated stubs for the EJB.

  • Ejb-client.jar

    Hi,
    I've got an EJB system that until now have been packaging as just a
    bean jar and not bothering with a ejb-client.jar. I now want to
    package as follows
    a). A bean EAR file (containing bean jar, and dependency jars) - for
    deploying on EJB server.
    b). An app EAR file (containing WAR, containing ejb-client.jar).
    The first part is done. The second raised questions about the contents
    of the ejb-client.jar. I have packaged the Home/Remote interfaces and
    all necessary utility classes (i.e omitting the Local/LocalHome/EJB
    classes). What I need to know is what goes in there in terms of
    descriptors.
    Do I just package the exact same ejb-jar.xml, jboss.xml,
    jbosscmp-jdbc.xml, weblogic-ejb-jar.xml, weblogic-cmp-rdbms-jar.xml ?
    or do I have to change these in some way ?
    Do I also add the ejb-client-jar tag to the ejb-jar.xml ? (would this
    also go in the ejb-jar.xml that goes in the bean jar ?) ... and indeed
    what would I put in there ... just the name of ejb-client-jar file
    even though its only being packaged into any application WAR (what
    purpose does it serve) ?
    TIA

    The ejb-link value should include pathnames relative to the top level of the EAR
    file.
    <ejb-link>../my_beans-client.jar#CurrencyExchange</ejb-link>
    Andy Jefferson <[email protected]> wrote:
    Deepak Vohra wrote:
    An ejb-client.jar contains the class files, the home and remote interfaces
    and the primary key class, a client program needs to call the EJBs
    contained in the ejb-jar file.
    Also, ejb-client.jar contains a copy of any classes from the ejb-jarfile
    that
    are referenced by the home and remote interfaces and the primary key
    class. Deployment descriptors are not required in the ejb-client.jar.
    ejb-client-jar element is not a required element in ejb-jar.xml. If
    ejb-client-jar.xml is specified in ejb-jar.xml ejbc generates the
    ejb-clent.jar file.
    Thx. I'm not interested in using any server-specific tools (like ejbc)
    since
    I'm deploying to multiple servers and so am generating the ejb-client
    jar
    myself in my build process. In this context, what purpose does the
    <ejb-client-jar> tag in the ejb-jar.xml descriptor have ? Why does the
    beans jar need to know anything about where the client stubs are ?
    As far as I can tell I'm including the right things in my ejb-client.jar,
    and I've tried deploying my web-app EAR to WebLogic 7.0 and I always
    get
    that it can't find the ejb-link elements. What i've got in my EAR is
    my_app.war
    META-INF/application.xml
    and in the WAR
    my JSP files
    WEB-INF/web.xml
    WEB-INF/jboss-web.xml
    lib/my_beans-client.jar
    In the WEB-INF I have ejb-ref's like the following
    <ejb-ref >
    <ejb-ref-name>ejb/CurrencyExchangeHome</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>my_domain.CurrencyExchangeHome</home>
    <remote>my_domain.CurrencyExchangeRemote</remote>
    <ejb-link>my_beans-client.jar#CurrencyExchange</ejb-link>
    </ejb-ref>
    Should I be putting the my_beans-client.jar in the EAR and not the WAR
    Seems I am missing something, but not sure what exactly.

  • Two web apps using the same EJB client jar

    I am currently deploying two web apps on a server. Both web apps use an EJB client
    jar (the same jar) to access EJB's and both apps work when tested independently.
    The problem arises when I log into app A and then log into app B. As soon as
    I do app A loses it's references to the EJBHomes, and other classes.
    It seems a classloader is unloading the first classes and instances loaded by
    the first app and then loading them from app B's client.jar.
    If I put the client.jar in the system classpath everything is fine, but that's
    just a hack.
    Is it not possible to deploy two web apps on a server using the same client.jar's
    in their own WEB-INF/lib's?

    Joe,
    As Pravin mentions, the checking of those boxes in Workbench triggers scheduled jobs within the EAC that kicks off the scripts at the appropriate time/day. But as you've noticed, there's not a ton of flexibility and you don't get cron or Windows Scheduler-type capabilities.
    If you need to do something special, you can manually kick off the report generation scripts from your control directory using the runcommand.bat (or sh) script or place the command into a cron/Windows Scheduler job:
    For example, to kick off the WeeklyReports job, you would do this:
    runcommand.sh WeeklyReports runSo, assuming you go down the route of creating multiple ReportGenerators and scripts, you would create a job to kick off the new script you've created at the appropriate time.
    Hope that helps,
    Patrick
    http://branchbird.com

  • ejb-client-jar example from the core specification

    Hello all,
    the ejb3.0 specification says (chapter 60 page 241):
    the jar file that contains the client should contain one of the following: 
    • a reference to the ejb-client JAR file 
    • a reference to the ejb-jar file that contains the client view classes 
    • a copy of the client view classes  There is also an example on page 242:
    In this example, the Bean Provider has chosen to package the enterprise bean client view classes in a
    separate jar file and to reference that jar file from the other jar files that need those classes. Those classes
    are needed both by ejb2.jar, packaged in the same application as ejb1.jar, and by ejb3.jar,
    packaged in a different application. Those classes are also needed by ejb1.jar itself because they
    define the remote interface of the enterprise beans in ejb1.jar, and the Bean Provider has chosen the
    by reference approach to making these classes available.
    The deployment descriptor for ejb1.jar names the client view jar file in the ejb-client-jar
    element. Because ejb2.jar requires these client view classes, it includes a Class-Path reference to
    ejb1_client.jar.
    The Class-Path mechanism must be used by components in app2.ear to reference the client view jar
    file that corresponds to the enterprise beans packaged in ejb1.jar of app1.ear. Those enterprise
    beans are referenced by enterprise beans in ejb3.jar. Note that the client view jar file must be
    included directly in the app2.ear file.
        app1.ear:
            META-INF/application.xml
            ejb1.jar Class-Path: ejb1_client.jar
                deployment descriptor contains:
                    <ejb-client-jar>ejb1_client.jar</ejb-client-jar>
            ejb1_client.jar
            ejb2.jar Class-Path: ejb1_client.jar
        app2.ear:
            META-INF/application.xml
            ejb1_client.jar
            ejb3.jar Class-Path: ejb1_client.jarNow finally my questions are:
    1. Why did we need to include the ejb1_client.jar in app2.ear (or even in app1.ear), wasn't it enough to deploy the ejb1_client.jar separately then refer to it (using class-path in Manifest, or may be just by using <ejb-client-jar>) as the bullets quoted first suggest?
    2. How come we didn't need to use <ejb-client-jar> for ejb2.jar
    3. Since both of ejb1.jar and ejb2.jar are packaged in app1.ear couldn't we simply refer to the ejb1_client.jar in the Manifest file of app1.ear?
    Please, I appreciate your input on this

    I am guessing here and please correct me if I am wrong:
    ejb1.jar uses interfaces in ejb1_client.jar as the interface for some of the beans so we needed to use ejb-client-jar and we needed a reference in the manifest file.
    ejb2.jar uses some of the claess/interfaces as may be a return type but not as an interface for one of its beans so we didn't need to use ejb-client-jar but we needed an entry in the manifest file.
    regarding app1.ear, we can put the ejb1_client.jar in the META-INF/lib app1.ear without the need for any entries in the manifest files.
    Edited by: malrawi on Jun 14, 2009 11:59 PM

  • Manifest to ejb-client-jar ??

    Hi,
    I have an EAR with an EJB module. Into the EJBmodule.jar my Manifest.mf lists many jars in "Class-path:".
    In EJB1.1 it's deprecated (if I understood it well...), can I specify many jars in the ejb-jar.xml <ejb-client-jar> element?? (If yes, how to write them??)
    Example:
    -- Manifest
    Class-path: myjar1.jar myjar2.jar
    --> <ejb-client-jar>myjar1.jar myjar2.jar</ejb-client-jar> ?

    I realized that class-path has not to do with ejb-client-jar... but is this a kind of filter on the client view of beans (i.e. another jar with only stubs and interfaces?? this should be a deploy-tool yield..)?

  • Generate Ejb client Jar

    Hi,
    I m working with Jdeveloper 10G and oracle 9IAS 9.0.3.
    I ve deployed an Ejb module on 9IAS
    I m now wondering how generate the EJB client jar (Stubs and interfaces )to access my EJB module from anywhere.
    Any Idea?

    I found the answer.
    specify the client jar name in the jar settings and the workshop will generate the client jar for you.
    inlcude the client jar and the wlclient.jar in the remote client application.

  • Jar file is empty

    Hi,
    I am trying to package a small application into a jar file, but besides the manifest, the jar comes out empty.
    My directory structure is a s follows
    /mydir/src/ [java files and manifest.txt]
    /mydir/bin/[compiled java classes in packages]
    I run the following command from /mydir/src/: jar cmf manifest.txt ../bin/MyJar.jar ../bin
    I understood that the last argument - ../bin should tell the utility to include all the contents of the bin directory - where my class files are. But they are not in the jar.

    alexxzius wrote:
    jarring might not work on some computers (it doesnt on my XP). What you do is create a zip file, add all the files/folders with a META-INF folder with a MANIFEST.MF file in it and then rename it with a .jar extension.Well, IMHO what you do is fix your configuration so you can use the jar command. But to each his own.

  • Using a Jar file into my jar project (Applet)

    Hy,
    I would like to know how I have to do to put a jar library in my jar file (containing my classes) ?
    I use only 2 classes of that particular jar library (Regex.class & RegRes.class), and when I only put the jar file (patbinfree153.jar), the applet stops when its reaches the first line where i use this class.
    this line :
    Regex Mon_Regex = new Regex("(([<][iI][mM][gG][^>]+)[sS][rR][cC][=][\"]{0,1}([^\"> ]*))");However, it works when I launch the applet in AppletViewer, but doesn't work anymore when I create a jar file, and open it through my web browser. (I signed already my jar file, and it works until it reaches this line). That it to say that the jvm can find the 2 external classes when I run the program trough Eclipse, but can't find them when I create my package .jar. (I hope I am clear)
    Do I need to extract the folders of this jar file ? Because I dont think the import works with those two classes. Or can I just put those 2 classes like my own classes, in this case, what to write for the import line ?
    the import I do :
    import com.stevesoft.pat.*;Thanks ^^

    I think I found a beginnig of solution, but I still have trouble.
    In the tutorial you gave me, it is said to add the following line in the manifest file to use jar in jar :
    Class-Path: JAR-FILE.jar(here is the source : http://java.sun.com/docs/books/tutorial/deployment/jar/downman.html)
    I did it, it works fine locally, but when i put my html, jar, files on my web site, my applet seams not to find the other jar file again.
    Locally, the architecure is the following :
    \upload4.html
    \upload4.jar (its manifest have the class-path line linking with patbinfree153.jar)
    \patbinfree153.jar (contains 2 classes I need)I uploaded the same architecture on my web site, but it doesn't work. The applet stops when it reaches the 1st line where I need one of the patbinfree153 classes.
    Any idea ? :-)

  • EJB Client Access From JDeveloper9iR2

    I seem to be running into a lot of problems when trying to get a simple EJB client to talk to an EJB on our 9IAS platform. I have developed a simple session bean (just to test) which simply returns a string. When I create the default client code this works fine using the embedded OC4J server in Jdeveloper but I can't run a similar client against 9IAS when I deploy the code. When I go through the client wizard it seems to produce the same code as the standalone EJB OC4J client. I simply changed the name of the server (Context.PROVIDER_URL, "ormi://pe2500/). This is the parameter code I use:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.SECURITY_PRINCIPAL, "admin");
    env.put(Context.SECURITY_CREDENTIALS, "welcome");
    env.put(Context.PROVIDER_URL, "ormi://pe2500:23891/MyEJBs");
    This is the output I receive:
    D:\jdeveloper9ir2\jdk\bin\javaw.exe -ojvm -classpath D:\javadev\ejbservlet\ejbservlet\WEB-INF\classes;D:\jdeveloper9ir2\jdev\lib\jdev-rt.jar;D:\jdeveloper9ir2\j2ee\home\lib\ojsp.jar;D:\jdeveloper9ir2\j2ee\home\jsp\lib\taglib\ojsputil.jar;D:\jdeveloper9ir2\j2ee\home\oc4j.jar;D:\jdeveloper9ir2\j2ee\home\lib\servlet.jar;D:\jdeveloper9ir2\jdev\lib\ojc.jar;D:\jdeveloper9ir2\j2ee\home\lib\activation.jar;D:\jdeveloper9ir2\j2ee\home\lib\ejb.jar;D:\jdeveloper9ir2\j2ee\home\lib\jaas.jar;D:\jdeveloper9ir2\j2ee\home\lib\jaxp.jar;D:\jdeveloper9ir2\j2ee\home\lib\jcert.jar;D:\jdeveloper9ir2\j2ee\home\lib\jdbc.jar;D:\jdeveloper9ir2\j2ee\home\lib\jms.jar;D:\jdeveloper9ir2\j2ee\home\lib\jndi.jar;D:\jdeveloper9ir2\j2ee\home\lib\jnet.jar;D:\jdeveloper9ir2\j2ee\home\lib\jsse.jar;D:\jdeveloper9ir2\j2ee\home\lib\jta.jar;D:\jdeveloper9ir2\j2ee\home\lib\mail.jar;D:\jdeveloper9ir2\j2ee\home\oc4j.jar;D:\jdeveloper9ir2\lib\xmlparserv2.jar;D:\jdeveloper9ir2\lib\xmlcomp.jar;D:\jdeveloper9ir2\j2ee\home\oc4j.jar;D:\jdeveloper9ir2\j2ee\home\lib\servlet.jar Samplemypackage6.ctejb1Client3
    javax.naming.NamingException: Lookup error: java.net.ConnectException: Connection refused: connect; nested exception is:
         java.net.ConnectException: Connection refused: connect
         java.lang.Object com.evermind.server.rmi.RMIContext.lookup(java.lang.String)
              RMIContext.java:134
         java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
              InitialContext.java:350
         void Samplemypackage6.ctejb1Client3.main(java.lang.String[])
              ctejb1Client3.java:18
    Process exited with exit code 0.
    Can anyone tell me if this is the correct communication method for client EJB's talking to the 9IAS server?
    Any help really appreciated.
    Chris Taylor

    hi Chris Taylor, did you find the solution for this error. i too get this error and i am looking for the answer. if you find any answer please share with me too. if i get any answer for this i will reply you too.

  • Ejb client error

    Hi, I use jdev 10g. I created a session bean with wizards and after that I created I Ejb client for that bean. When I start the embedded server and run the client java file I get the following error :
    com.evermind.server.rmi.OrionRemoteException: jazn.com/admin is not allowed to call this EJB method, check your security settings (method-permission in ejb-jar.xml and security-role-mapping in orion-application.xml).
         at denemeSessionHome_StatelessSessionHomeWrapper1.create(denemeSessionHome_StatelessSessionHomeWrapper1.java:41)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:124)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    at connection to localhost/127.0.0.1 as admin
         at com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMIConnection.java:1527)
         at com.evermind.server.rmi.RMIConnection.invokeMethod(RMIConnection.java:1480)
         at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:55)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:22)
         at __Proxy0.create(Unknown Source)
         at ejbpackage.denemeSessionClient.main(denemeSessionClient.java:21)
    Process exited with exit code 0.
    all settings are the default ones.
    Anyone has any idea???

    hi
    There was no problem with that... the AdviceClient is not in the package... I needed j2ee.jar and AdviceAppClient.jar to run the client and hte AdviceClient is in C\java\Projects\Advice directory.... can anyone help me with what is wrong with my first command which didnt work ...
    java -classpath c:\Sun\AppServer\lib\j2ee.jar;c:\java\Projects\Advice;c:\java\Projects\AdviceAppClient.jar AdviceClient
    This one worked though....
    java -cp {$CLASSPATH}:"C:\java\Projects\Advice";AdviceAppClient.jar;c:\Sun\AppServer\lib\j2ee.jar; AdviceClient
    I dont know what makes the difference...
    vidhya

  • Applicate Remote EJB Client

    Hello,
    I am getting to know EJB and have started with it from a Pocket Book and has started to implement and example suggested by this website: http://www.laliluna.de/articles/ejb-3-tutorial-jboss.html.
    Coming to the client part, maybe incorrectly by my part or particular to the cited website's example, I see a strong coupling on the EJB client to the Remote Interface and the actual SessionBean which I could only see sufficed by having the client on the same "project" of the EJB. Therefore I ask you, is there a way to have the EJB client on a different project, even on a different app. server than the Session Bean?
    Thank you for your help,
    TS

    the only thing you need in the client is the remote interface.
    So to share this interface between a client and a server application, you could put those interfaces in a separate library jar and share that between the two projects.

  • Building an EJB Client

    I'm completely confused on how to build an EJB client automagically using Ant.
    I have a simple EJB, which I compile using the wlwBuild Ant task. If I set the "ejbgen.jar-settings.ejb-client-jar" property in the project's build.properties, the client jar gets built, but it then ends up in the application EAR file. Worse yet, the generated application.xml descriptor includes the client module. Deploying the ear file fails since WebLogic tries to deploy both modules, and it blows up on NamingExceptions.
    I've kludged the process by using wlwBuild and then 'fixing' the resulting EAR file, but that's far from ideal. It works for simple projects, but not Integration projects with the auto-generated very ugly EJB names.
    I've looked at wlappc, but the documentation is so scarce I can't tell if this is the tool to use, or how to make it work. Trial and error has gotten me nowhere...:(
    So the question is: how can I build the EJB client through Ant without having it end up in the application EAR?
    thanks
    mike

    I'm looking for too and there isn't any.
    Here is an example. I hope it could be helpful.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <HEAD>
    <%@ page import="javax.naming.*" %>
    <%@ page import="javax.rmi.*" %>
    <%@ page import="java.rmi.*" %>
    <%@ page import="javax.ejb.*" %>
    <%@ page import="modelo.ejb.*" %>
    <%@ page
    language="java"
    contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"
    %>
    <%!
    Fachada sbFachada = null;
    public void jspInit() {
         String sJNDI = "ejb/modelo/ejb/FachadaHome";
         try{          
              Context ejbCtx = (Context) new InitialContext();
              System.out.println("Obteniendo la referencia JNDI: " + sJNDI);
              Object oRef = ejbCtx.lookup(sJNDI);
              FachadaHome home = (FachadaHome) PortableRemoteObject.narrow(oRef, FachadaHome.class);
              try {     
                   sbFachada = home.create();
              } catch (CreateException ce){
                   System.out.println("Error en la creaci�n");          
              } catch (RemoteException re) {
                   System.out.println("Error remoto en creaci�n");
         } catch (NamingException ne){
              System.out.println("NamingException " + ne.toString());
    %>
    <TITLE>InvocarEJB2.jsp</TITLE>
    </HEAD>
    <BODY>
    <%
         out.println(sbFachada.contador());
    %>
    </BODY>
    </HTML>
    Salu2.
    V�ctor.

Maybe you are looking for