JSP use EJB's Client.jar

There's a Client.jar fater deployed an EJB.
I can do it like this:
D:\>java -classpath %classpath%;Client.jar MyClient
My question is:
How can I run JSP with the EJB?
Thank you!

i thing right now your are accesing the ejb through comand prompt.first create a jsp then create *.war file by uing deployment tool.for forther help refer j2ee doc.
call the jsp from browser.

Similar Messages

  • Problem with JSP using bean packaged in jar file

    Hi,
              I am trying to use a java bean in a jsp file. The java bean is packaged
              into a jar file. I am getting class not found compilation error. If the
              bean remains to be a seperated class file, everything work well.
              Does anyone know how I can use bean in a jar file within jsp , i.e. to
              allow the bean to be found during compilation ?
              Thanks,
              Terence.
              [email protected]
              

    Jacek,
              Thanks for replying.
              My JSP's are just files in my document root . However, I found a solution to
              my
              problem. That is to have the jar file defined in my weblogic.class.path. I may
              have missed some files in my original jar file which causes my problem.
              Mayby I should package everything into a web application for deployment. That
              will be my next step.
              Thanks anyway.
              Terence.
              Jacek Laskowski wrote:
              > Terence Lai wrote:
              > >
              > > Hi,
              > >
              > > I am trying to use a java bean in a jsp file. The java bean is packaged
              > > into a jar file. I am getting class not found compilation error. If the
              > > bean remains to be a seperated class file, everything work well.
              >
              > How do you use the JSP file ? Is it a part of web application ? If so,
              > the bean jar package should be located in WEB-INF/lib directory. It's
              > also recommended to put the bean class into a package, so it's not in
              > 'unnamed' package, and <jsp:useBean> can find it.
              >
              > >
              > > Does anyone know how I can use bean in a jar file within jsp , i.e. to
              > > allow the bean to be found during compilation ?
              >
              > see above.
              >
              > > Terence.
              >
              > Jacek Laskowski
              > HP Consulting
              

  • Question : JSP use EJB

    I write a stateful Session Bean,and I want to use the same instance of this Stateful Session Bean in two JSP file(in a session). How can I do with it?
    I try to use the same JavaBean in two JSP page,and through this javaBean invoke the EJB instance,it can work. But is it a good method?

    You can pass to the second JSP page in the same session using the object HttpSession the Stateful Session Bean instance.
    e.g.
    FirstJSPPage
    HttpSession mySession = request.getSession();
    mySession.put("mySessionBean",mySessionBean);
    SecondJSPPage
    HttpSession mySession = request.getSession(false);
    MySessionBean mySessionBean =
    (MySessionBean)mySession.get("mySessionBean");

  • 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

  • Using the SAF client from the wlfullclient.jar in Tomcat or Jetty?

    I'm trying to use the SAF client in Tomcat and Jetty and if I use the wlfullclient.jar I get the following error when I start the application:
              java.lang.InternalError: error initializing kernel caused by: java.lang.AssertionError: Duplicate initialization of WorkManager
              If I use the "thin" client jars everything works fine. Unfortunately I need to be able to use the full client in some cases. Is there some way to get this to work or is there a conflict between the Weblogic classes and the other Servlet containers?
              Edited by mhellkamp at 08/30/2007 3:42 PM

    I believe the conflict here is with the Tomcat/Jetty WorkManager. I don't think the client was inteneded to run insides another container. That's why you're getting that error of duplicate initialization of WorkManager.
              Why not replace the Tomcat/Jetty with another WebLogic instance? :)

  • Error encountered while trying to use EJB control in a Platform Domain

    Hi,
    I've configured a Weblogic Platform domain and installed all the application EJB's
    thru a JAR file. When I try to access these EJB's from within Web Logic Workshop
    using the EJB Control, I am able to find the Home and the Remote interfaces and
    those boxes are populated correctly when I select the JNDI name from the Browse
    button. But when I click on the "Create" button in EJB Control dialog box, I get
    the following error
    "The EJB Home interface selected in Step 3 cannot be loaded. The client interfaces
    for the selected EJB must be present as individual classes in the WEB-INF\classes
    directory of this project or the EJB's client JAR file must be present in the
    WEB-INF\lib directory".
    I copied my EJB Jar file to the WEB-INF\lib folder also. But still it gives the
    same error message. Please let me know if I am missing something. Your help is
    greatly appreciated.
    Thanks
    Vikram

    Hi Pat,
    I've restarted the complete Platform Domain Weblogic instance and it worked.
    Thanks for your help.
    Vikram
    "Pat Bumpus" <[email protected]> wrote:
    >
    Hi,
    I'm using a workshop domain from WebLogic Platform 7.0 SP1.
    When you move the EJB classes (as a jar file) into the WEB-INF/lib directory,
    then you need to redeploy the web application. In your last note you
    mentioned
    redeploying the EJB, but not the web app. Have you tried redeploying
    the web
    app, after you move the EJB jar file into WEB-INF/lib?
    pat
    "Vikram" <[email protected]> wrote:
    Hi Pat,
    Thanks for replying back immediately. I tried to redeploy the EJB and
    copy the
    client EJB classes to the WEB-INF\lib folder but still it doesn't work.
    I've also
    tried using some of the standard EJB's like "BEA_commerce.CategoryManager"
    which
    are part of the Platform domain and I am still getting the same error.
    Are you working on a Weblogic Platform Domain or Weblogic workshop domain.
    Just
    wanted to confirm. Appreciate your help.
    Thanks
    Vikram
    "Pat Bumpus" <[email protected]> wrote:
    Hi,
    After you copied the EJB into the WEB-INF/lib directory, did you redeploy
    the
    web application? I got a similar thing to work. Instead of movingthe
    whole
    EJB into WEB-INF/lib, I had ejbc create an EJB client jar and I moved
    that into
    my WEB-INF/lib directory. Then I redeployed the web application toload
    the classes
    and it worked.
    pat
    "Vikram" <[email protected]> wrote:
    Hi,
    I've configured a Weblogic Platform domain and installed all the application
    EJB's
    thru a JAR file. When I try to access these EJB's from within Web
    Logic
    Workshop
    using the EJB Control, I am able to find the Home and the Remote interfaces
    and
    those boxes are populated correctly when I select the JNDI name from
    the Browse
    button. But when I click on the "Create" button in EJB Control dialog
    box, I get
    the following error
    "The EJB Home interface selected in Step 3 cannot be loaded. The client
    interfaces
    for the selected EJB must be present as individual classes in theWEB-INF\classes
    directory of this project or the EJB's client JAR file must be present
    in the
    WEB-INF\lib directory".
    I copied my EJB Jar file to the WEB-INF\lib folder also. But stillit
    gives the
    same error message. Please let me know if I am missing something.
    Your
    help is
    greatly appreciated.
    Thanks
    Vikram

  • Can't compile client with client.jar

    I am unable to compile a static client using the standard client.jar produced by
    Weblogic. I am trying to do this in a minimal DOS environment as shown below:
    set PATH=d:\jdk1.3.1\bin
    set classpath=.;client.jar
    javac OssNodeWeblogicClient.java
    The compiler gives me the following error:
    client.jar(com/nyiso/oss/ossnode/OssNode.java):2:
    class OssNode is public, should be declared in a file named ossNode.java
    (source unavailable)
    1 error
    I was surprised to find two java files in client.jar (OssNode.java and OssNodeFactory.java).
    These files seem to confuse javac. If I remove these files from client.jar, the
    compilation completes without errors and the client runs without any problems.
    Has anyone seen this problem?

    Naresh,
    Just a quick follow-up. I used the -verbose option with
    javac and saw that when my compile failed, and I saw the same
    error message that you saw, javac was pulling the .java file
    from the jar file and trying to compile it. In the example I
    did that worked, the javac compiler was pulling the .class file
    from the jar file instead.
    Basically the javac compiler will fail trying to compile
    the .java file located in a jar file, probably because it can't
    write the .class file to the same (compressed) location. The
    reason that the javac compiler is trying to recompile the .java
    file, even though the .class file is also in the jar file, is
    that it has determined that the .java file is more up to date.
    So two questions for WebLogic:
    1) Why does WebLogic include the .java files in the jar
    file?
    2) Why doesn't the .java file match with the .class file?
    I'll let you know if/when I hear more. Rob
    "Naresh Bhatia" <[email protected]> wrote:
    >
    I am unable to compile a static client using the standard client.jar
    produced by
    Weblogic. I am trying to do this in a minimal DOS environment as shown
    below:
    set PATH=d:\jdk1.3.1\bin
    set classpath=.;client.jar
    javac OssNodeWeblogicClient.java
    The compiler gives me the following error:
    client.jar(com/nyiso/oss/ossnode/OssNode.java):2:
    class OssNode is public, should be declared in a file named ossNode.java
    (source unavailable)
    1 error
    I was surprised to find two java files in client.jar (OssNode.java and
    OssNodeFactory.java).
    These files seem to confuse javac. If I remove these files from client.jar,
    the
    compilation completes without errors and the client runs without any
    problems.
    Has anyone seen this problem?

  • Q: Anonymous user and thin client jars

    Hi all. I've recently upgraded from WLS 7.0 to WLS 8.1. One of the changes I
    did with this was update my java client from using weblogic.jar to wlclient.jar
    and wljmsclient.jar (the thin client jars). When I do this and attempt to connect
    to my WLS instance anonymously, I get the following message:
    SubjectManager not installed
    If I either use the 8.1 weblogic.jar or use the thin client jars with JAAS, everything
    works.
    I'd still like to be able to have anonymous connections to my instance and use
    the thin client jars. Is there an additional jar I need to include?
    Thanks,
    Ed

    Hi all. I did some more digging, and it looked like our client code was using
    some class wrappers which assumed a JAAS Subject was being used, when it wasn't.
    The end result was we were calling into an empty Subject instance. This is what
    was causing the error. Pilot error on our part. :)
    Ed
    "Ed Hillmann" <[email protected]> wrote:
    >
    Hi all. I've recently upgraded from WLS 7.0 to WLS 8.1. One of the
    changes I
    did with this was update my java client from using weblogic.jar to wlclient.jar
    and wljmsclient.jar (the thin client jars). When I do this and attempt
    to connect
    to my WLS instance anonymously, I get the following message:
    SubjectManager not installed
    If I either use the 8.1 weblogic.jar or use the thin client jars with
    JAAS, everything
    works.
    I'd still like to be able to have anonymous connections to my instance
    and use
    the thin client jars. Is there an additional jar I need to include?
    Thanks,
    Ed

  • 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

  • How to use client.jar generated by deploytool for a EJB web service

    Hello!
    Could anyone help me?
    I use Sun Application Server to deploy my EJB module and expose it as a web service. Then I open deploytool tree and select localhost under Server branch. In the right panel it shows a list of web services deployed. I chose recently deployed service and press "Client Jar..." button to get generated client stubs.
    Good.
    Could anyone tell me how I should use this jar file? It does not contain ..._Service_Impl.class that is usually used to get service port and call service methods.
    Please, explain me.
    Thank you much

    try
    jar tf Client.jar and look at what is inside.
    Usually you run the client to connect to the server -- (java -classpath blah pack.age.name.Client)
    Dont know how its being done over there.

  • 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.

  • To use JSP or EJBs

    Hi,
    We plan to develop a product on java which was earlier developed on VC++. This is a Client/server project containing User Interaction GUI screens to enter,modify & delete data. This exisiting system is a 2-tier model developed for intranet environment. Now to make the same application using java, which will be more efficient and fast. EJBs or JSPs ?? what are the factors that should be considered before one decides whether to use EJBs or JSPs ?

    Hi,
    From the way u asked the question...it seems that u will still need a beter understanding of EJBs and JSPs.
    U need to understand J2EE properly then, EJBs, JSPs, e.t.c will become clearer.
    Try this sun site technologies->J2EE there are lots and lots of tutorials and begineer tools and utilities to understand the working of J2EE in Building Enterprise applications. In some cases u need to employe both technologies. (EJBs JSPs).
    Cheers.

  • 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

  • Question on EJB, JNDI and client jars

    Hi,
    This is a very fundamental question on EJBs and their clients - what
    all should go into the client jar of an ejb?
    I know for sure that just the remote and home interface classes of the
    ejb are sufficient on the client's classpath to work with an EJB on a
    totally different server, but I dont understand the logic behind it.
    If the client has to pass its object parameters over the network to
    the server where the ejb bean is located, should the container
    generated stub not be present on the client's classpath? After the
    client does the JNDI lookup of the ejb home on the server, how does it
    serialize and pass the parameters over the network if the container
    generated stub is not present?
    Any help would be greatly appreciated. Pointers to material on the
    internet which explain this/related things in detail would be a great
    help.
    Thank you,
    Anoushka

    "Anoushka" <[email protected]> writes:
    I know for sure that just the remote and home interface classes of the
    ejb are sufficient on the client's classpath to work with an EJB on a
    totally different server, but I dont understand the logic behind it.
    If the client has to pass its object parameters over the network to
    the server where the ejb bean is located, should the container
    generated stub not be present on the client's classpath? After the
    client does the JNDI lookup of the ejb home on the server, how does it
    serialize and pass the parameters over the network if the container
    generated stub is not present?Most protocols (IIOP, T3, JRMP) provide a slot for encoding a codebase
    in RMI requests. The codebase is usually an http URL that specifies
    where to get classes that are not currently available to the
    client. This URL is used to construct a java.net.URLClassLoader which
    then downloads classes on demand. These classes can include stubs,
    object arguments - pretty much anything you like. There are certain
    security restrictions on the URLClassLoader which is why you sometimes
    have to specifiy a security manager in a client. T3 will for
    preference generate stubs in the client rather than download them,
    however this is not allowed in an applet - and so in this case T3 will
    also download stubs from the server.
    The net of this is that you don't have to put very much at all in a
    client jar UNLESS you can't use the URLClassLoader. In that instance
    you have to put EVERYTHING you need in the client jar.
    HTH
    andy

  • 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]

Maybe you are looking for

  • Error while executing a report : Time limit exceeded

    Hello Experts, i have executed a report  and it took long time and finally throw an error saying that time limit is exceeded , please suggest how to resolve the problem Thanks in Advance Nitya

  • Scheduling Agreement - Automatic Release Individual Schedule Lines

    Dear all. I've create a "LPA" scheduling Agreement and its release type is "JIT". So, I use to ME38 to maintain the individual JIT delivery schedule lines. The problem I have is this method requires the person to manually release each individual deli

  • Retrieve Java Employee Selection for use in ABAP

    Hi Experts I have a case where I need to retrieve the PERNR from the Java Employee Selection iView for use within an ABAP WD iview. I'm assuming that this can be handled from FPM... Could someone help me in the right direction to get this done? Thank

  • JAVA_HOME and JDK

    Hi, I installed the Java SDK a while ago, how do I check that I have the JDK with it? The reason why I ask is because I want to set the JAVA_HOME variable and not sure where I must map it to? When I installed the SDK it installed everything under C:\

  • Dynamic mail message's through Alert

    Hi All, We have a requirement to send dynamic mail messages based on the alert output's. like if the output value is NULL then i need to send different message and if it is not null then another message has to go to the user. is this possible through