Ejb, servlets, & customer libraries

Hello,
I'm in the process of upgrading from 5.1 to 6.1 and having some
interesting issues regarding the various interdependent chunks of code.
In 5.1 I have most of my shared code under <server>/serverclasses, and
the servlet code under <server>/servletclasses. I've also got an EJB
that uses some of the code in the serverclasses directory, and its being
there seems to make it available at runtime to the EJB's classloader.
Meanwhile, in order to make the EJB's home interface available to the
servlet code at run time, the only solution I found was to include the
jar file in the classpath handed to the java runtime in the startup
shell script.
Now, in 6.1 things have changed somewhat and i'm frankly not sure what
the hell to do. I found someone had posted an article talking about
bundling things in a .ear file. Honestly, I didn't really get it. I
don't see why changing the extension on the jarfile is going to help at
all.
Anyway, this is my question: How can I make code available as a custom
library that is available to the servlet run time, and to my EJB
deployments?
Here's my other question: If the EJB code is only in the .jar ( or
whatever ) file that the EJB is packaged in, how exactly does the
servlet runtime know about the home interface? Just deploying the bean
doesn't seem to do the trick. Honestly, this seems like a pretty big
design flaw in the EJB spec to me.
thanks
noah

You may find these 2 articles helpful:
http://www.onjava.com/pub/a/onjava/2001/06/26/ejb.html
http://www.onjava.com/pub/a/onjava/2001/07/25/ejb.html
Noah Couture <[email protected]> wrote:
Hello,
I'm in the process of upgrading from 5.1 to 6.1 and having some
interesting issues regarding the various interdependent chunks of code.
In 5.1 I have most of my shared code under <server>/serverclasses, and
the servlet code under <server>/servletclasses. I've also got an EJB
that uses some of the code in the serverclasses directory, and its being
there seems to make it available at runtime to the EJB's classloader.
Meanwhile, in order to make the EJB's home interface available to the
servlet code at run time, the only solution I found was to include the
jar file in the classpath handed to the java runtime in the startup
shell script.
Now, in 6.1 things have changed somewhat and i'm frankly not sure what
the hell to do. I found someone had posted an article talking about
bundling things in a .ear file. Honestly, I didn't really get it. I
don't see why changing the extension on the jarfile is going to help at
all.
Anyway, this is my question: How can I make code available as a custom
library that is available to the servlet run time, and to my EJB
deployments?
Here's my other question: If the EJB code is only in the .jar ( or
whatever ) file that the EJB is packaged in, how exactly does the
servlet runtime know about the home interface? Just deploying the bean
doesn't seem to do the trick. Honestly, this seems like a pretty big
design flaw in the EJB spec to me.
thanks
noah--
Dimitri

Similar Messages

  • Custom Libraries sadly needed in iTunes

    Custom Libraries: iTunes can be greatly improved if the user could create different libraries, instead of all the song being lumped into one large library to develop playlists from. That way iTunes would not become confused with song that labelled Track_1 etc... and screw up your playlists, and iTunes would not lost track of which tracks belong with which playlists. The user would have more control over how to customize iTunes. It's really dumb to force all the tunes into one large cumbersome error prone library. You label each library based on the content, and know where the songs in that library originated much better than the current design.

    Oliver,
    I think your ideal solution would be to get yourself an iPod and then just keep all you music on the external drive.
    Short of that you could try iTunes Library Manager. It's not quite the functionality you seek but might be useful.
    Finally, you could choose to not have iTunes keep your Music Folder organized and not copy songs to the Music Folder when you add them to your Library.
    This way your Library could be split between the two drives but still all show up in iTunes. I think this option would be kind of a pain to maintain though. Especially when you move something from the external to the iBook. You'd have to manually find it for iTunes after it's moved so it would know where to look.
    Matt

  • Best way to call EJB - Servlet or Tag Library

    Hi,
    What is the best way to call an EJB from a JSP? We are using Weblogic 7.0(moving to 8.1 beta). WE have a form on a JSP that needs to get data from an EJB. Our flow goes from JSP --> Controller servlet or tag library -->EJB "Bean" Controller ---> EJB. The specfic EJB we need to populate drop downs and fields will be called by a bean controller. Is it better to call the bean controller using a tag library in the jsp or go to the controller servlet to get the data? If servlet is the answer, where do I lookup the EJB Home and call the create from within the servlet? Any help would be greatly appreciated!!
    Thanks!

    IMO, if you are following some design patterns, like the MVC framework, the best thing is to populate the model(entities that contain the business data) and call the respective getXX methods from the model on the JSP page. The reason for doing so is to keep JSP pages away from any other work other than to just display the business data contained in the respective business entities.
    The model can be populated in the servlet and either set in the request or session attribute as per the requirement.
    The EJB can be looked up in the servlet as and when required. I would suggest to make use of the Service Locator Pattern to do a look up for the EJB Remote Interface and accordingly make the business calls.
    Hopefully this answers some of your questions.

  • How to debug with EJB+Servlet+J2ME at the same time?

    I am setting up an environment to compile Sun's Smart Ticket J2ME application. However, it run with application exception in the servlet or EJB. I tried to debug. But if I debug the servlet with Embedded AS in JDeveloper, I cannot debug the EJB since the EJB cannot deployed to the embedded AS. (EJB and Servlet must be co-existed in the same AS, at least using same JNDI)
    So is there any good approach to debug?
    email: [email protected]

    Hi Marvin,
    If the EJB cannot be deployed to the embedded AS, then you should probably use remote debugging to debug the servlet and EJB in the stand-alone AS.
    Look in the Help for topics about remote debugging the OC4J application server. (I'd give you the exact topic title, but I'm at home for the holidays and I don't have the latest JDev on this machine.)
    The Help topic describes it in more details, but the basic steps are as follows:
    1. Launch the AS in debug mode by inserting some debugging options on the command line used to start up the AS.
    If you are using OJVM, then the debugging options are
    -XXdebug,port4000,detached
    If you are using another JVM (for example HotSpot), then the debugging options are
    -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=4000,suspend=n
    2. Set your project for remote debugging by checking the Remote Debugging checkbox on the Debugging - Remote panel of the Project Settings dialog. Also you should select the "Attach to OJVM" radio button if you are using OJVM or the "Attach to JPDA" radio button if you are using another JVM (for example HotSpot).
    3. Click the debug button in JDev and enter the host and port where the AS is running (leave host blank if the AS is on the same machine as J[i]Long postings are being truncated to ~1 kB at this time.

  • Best IDE to develop EJB/Servlet development with WebLogic

    Hi,
    I am prepearing a recommendation for our company's standard Java development
    environment. I would appriciate any comment you guys might have on the best
    IDE that supports J2EE and EJB and Servlet development that integrates with
    WebLogic. I guess the best are Visual Age or Visual Cafe, anybody have any
    experince/comment on any of those ?
    Thanks
    Farhang

    I would recommend the products coming from Webgain. They offer the product
    suite surrounding visual cafe.
    Thanks,
    Michael
    Michael Girdley
    Product Manager, WebLogic Server & Express
    BEA Systems Inc
    Farhang Kassaei <[email protected]> wrote in message
    news:8fs706$643$[email protected]..
    Hi,
    I am prepearing a recommendation for our company's standard Javadevelopment
    environment. I would appriciate any comment you guys might have on thebest
    IDE that supports J2EE and EJB and Servlet development that integrateswith
    WebLogic. I guess the best are Visual Age or Visual Cafe, anybody have any
    experince/comment on any of those ?
    Thanks
    Farhang

  • Ejb servlet application

    i am using orion.
    i have an ejb app running.. i can connect to it from an external client.
    however, as soon as i turn the client into another ejb app that is just a servlet, i get ClassCastException when getting the remote interface.
    any ideas?

    i think it's due to the fact that your Home is not only in the classpath of the container but in the classpath of the servlet engine too. so when you're trying to get the home, a ClassCastException is thrown bcz the home you got has not the same version as the home in servlet engine (uid).
    hope it helps.

  • EJB Servlet Bridge

    I've come across suggestions a couple of times to use a Servlet bridge to an
    EJB. One such situation was invoking an EJB running in WebLogic 6.1 from an
    application running in WebLogic 5.1. Other situations have been for applets
    invoking EJB's.
    Two questions. When should you implement a Servlet bridge rather than using
    RMI over HTTP or some other method? Are there other situations where a
    Servlet bridge would be useful?
    In the case of applets, it seem like a Servlet bridge would be nice because
    you wouldn't need to provide the EJB client classes to the applet. For
    example the InitialContext class wasn't included in the standard edition
    until 1.3.
    Thanks,
    Bob

    Bob Lee <[email protected]> wrote:
    I've come across suggestions a couple of times to use a Servlet bridge to an
    EJB. One such situation was invoking an EJB running in WebLogic 6.1 from an
    application running in WebLogic 5.1. Other situations have been for applets
    invoking EJB's.
    Two questions. When should you implement a Servlet bridge rather than using
    RMI over HTTP or some other method? Are there other situations where a
    Servlet bridge would be useful?
    In the case of applets, it seem like a Servlet bridge would be nice because
    you wouldn't need to provide the EJB client classes to the applet. For
    example the InitialContext class wasn't included in the standard edition
    until 1.3.You wouldn't need to provide WebLogic classes - you need several megabytes of them
    on the client side in order to use T3.
    Thanks,
    Bob--
    Dimitri

  • Workshop 8.1 Calling EJB from Custom Authentication Provider

    I am writing a custom authentication provider that runs on Weblogic Server 8.1 and also on Workshop 8.1. Everything is packaged into a jar file that I put into the mbeantypes directory. From the authentication provider I want to get an EJB home that is on another Weblogic 8.1 server.
    Loading the home from the Weblogic server works great. But in Workshop I get a ClassCastException from the PortableRemoteObject.narrow() call.
    This happens in Workshop even if I remove all my application jar files, so I am left with nothing but the startup classpath and the files in the mbeantypes directory. That is, I don't have any classes in two directories.
    When I look at the class that I actually get back from the call to context.lookup( jndiName ), I get the same stub class back on the Weblogic Server and on the Workshop server. But only on Workshop do I have this casting problem.
    Any ideas?
    Thanks,
    Mark

    Issue has been resolved.
    The reason I've forgotten about Value Object that is being returned by Remoute method to put them into classpath of Authenticator Provider

  • Ejb + servlet + jsp

    Hallo everybody,
    i try to develop an application with servlet jsp and ejbs but i don't have enough information about this thema.
    for example i want to make a simple login szenario :
    user type the name and passwd and the system contact with the db and show a wellcome page if the login is succesfull and an error page if the login is unsuccessfull.
    which component does was??
    the first page can be a html form and post the name and passwd to a servlet.
    in this case servlet can make a connection with the DB and can forward the user to next page or error page. BUT where should i use EJB? can i realize the db connection with ejb ? if yes how can interact the servlet with the ejb and how can i store the information (for example address of user) which i have taken from the DB?
    thanks a lot

    Thanks for the antwort
    this means that the servlet connected to DB and execute the sql to authenticate user??
    and the second part is my bigger problem :)
    what does it mean "it will pass the control
    to the enterprise java bean which will be housing the business logic for your application."
    what does a java bean really do? how can i find information about them?
    and is ther an example in which i can see how servlets, jsps and beans interact??
    thanks

  • Problem Compiling Projects with Servlet & Custom Taglibs

    There was a bug in Jdeveloper 3 that if you compiled JSP's that used Custom Tags Jdeveloper validated your web.xml file - very annoying (if anyone knows a workaround plese let me know). There is a workaround in JDeveloper 9 detailed in the release notes http://otn.oracle.com/products/jdev/htdocs/readme_902.html. Has this been fixed in 10g. Incidently I loaded the Oracle Developer Suite 10g documentaion cd dated April 04 and JDevloper was described as 9i - is this the latest version ?

    Perhaps
    javac -classpath .;..;c:\jdk1.3.1_07\lib\servlet.jar pdm\FileName.java

  • EJB, Servlet, JSP help

    I have built a small application which creates/maintains company divisions following the MVC design pattern.
    I now want to move the methods which create,update, add objects out of the controller possibly into the Model servlet. This I hope would allow other parts of the application (not yet built) to manipulate division objects and not have to do this through the Contrroller which is used to call the JSP and present data.
    I am wondering whether I should do this, or whether i should just move straight to Entity Java Beans, which I believe handle all interfaces with the database.
    If you reckon this is the correct way forward can you tell me where I can see a good example i.e. has EJB which handle all dtabase communication and can talk to the controller servlet and the jsp.

    Hi,
    We cover these issues in our book Core J2EE Patterns and also include some basic refactorings for J2EE, including moving from a non-EJB to EJB environment in phases.
    Good luck,
    Dan
    I have built a small application which
    creates/maintains company divisions following the MVC
    design pattern.
    I now want to move the methods which create,update,
    add objects out of the controller possibly into the
    Model servlet. This I hope would allow other parts of
    the application (not yet built) to manipulate division
    objects and not have to do this through the
    Contrroller which is used to call the JSP and present
    data.
    I am wondering whether I should do this, or whether i
    should just move straight to Entity Java Beans, which
    I believe handle all interfaces with the database.
    If you reckon this is the correct way forward can you
    tell me where I can see a good example i.e. has EJB
    which handle all dtabase communication and can talk to
    the controller servlet and the jsp.

  • EJB & Servlet deployment in Clustered Env.

              Hi,
              I have made a cluster of 3 weblogic servers. I would like to send a request to one
              server (e.g. http://myserver1:7001/TestServlet). The servlet utilizes an EJB which
              is not located and not deployed on myserver1 , but on other 2 servers in the cluster.
              The algorithm is round-robin. It gives me a lot of errors (Impl... classes not found
              etc etc).
              Do I have to deploy everything on all the servers?
              If I do that, the request is not routed to other servers. Since the servlet finds
              the EJB locally, it never goes to the other servers, regardless of the algorithm.
              I have set up the "home-is-clusterable" and all other relevant properties for EJB
              deployment.
              Any ideas??
              Sharad
              

    If the ejb is deployed on the server that is looking for the ejb, then it
              won't go network to use the ejb. That is a "big" WL optimization, and helps
              quite a bit for most apps.
              If you want to segregate the ejb and web functionality, you should probably
              consider running two distinct clusters (in 5.1 parlance).
              I suggest putting web and ejb together though and clustering that. Latency
              is lower. Scalability is not particularly affected. Configuration is much
              simpler.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com
              +1.617.623.5782
              WebLogic Consulting Available
              "Sharad Joshi" <[email protected]> wrote in message
              news:[email protected]...
              >
              > Hi,
              >
              > I have made a cluster of 3 weblogic servers. I would like to send a
              request to one
              > server (e.g. http://myserver1:7001/TestServlet). The servlet utilizes an
              EJB which
              > is not located and not deployed on myserver1 , but on other 2 servers in
              the cluster.
              > The algorithm is round-robin. It gives me a lot of errors (Impl... classes
              not found
              > etc etc).
              >
              > Do I have to deploy everything on all the servers?
              > If I do that, the request is not routed to other servers. Since the
              servlet finds
              > the EJB locally, it never goes to the other servers, regardless of the
              algorithm.
              > I have set up the "home-is-clusterable" and all other relevant properties
              for EJB
              > deployment.
              >
              > Any ideas??
              >
              > Sharad
              

  • Arduino ino with custom libraries

    Hi,
    I'm trying to compile an arduino sketch using ino. I'm also using a custom library called TimerOne which I've installed to ~/sketchbook/libraries and even the normal arduino IDE is able to link and compile it.
    But if I try to build it with ino, it keeps telling me this:
    user@host$ ino build
    src/sketch.cpp
    .build/uno/src/sketch.cpp:3:22: error: TimerOne.h: No such file or directory
    src/sketch.ino: In function ‘void setup()’:
    src/sketch.ino:41: error: ‘Timer1’ was not declared in this scope
    .build/uno/Makefile:189: recipe for target '.build/uno/src/sketch.o' failed
    make: *** [.build/uno/src/sketch.o] Error 1
    Make failed with code 2
    Then I tried to copy the TimerOne library directly to the lib folder of my ino-project, which didn't help.
    I also tried to specify the lib folder using "ino build -d ~/sketchbook/libraries/" but it failed too.
    I've read the documentation and help files of ino, but I can't figure out how to tell ino to use the library correctly.
    I'm a little bit confused, does anybody know what I'm doing wrong?

    Except that it does not appear in my "User Defined" option, hence the reason for me trying to find it in "Other Libraries." Sorry I did not explain that. That's why I'm bothered by this. This is very unusual.

  • Servlet jndi lookup to remote EJB, servlet and EJB not in the same application

    Hi,
    I think that the subject explain my problem.
    I have Oracle IAS9i 9.0.2.0.0, and JDeveloper 9.0.2.829
    I have deployed and EJB in IAS9i and i want to use from the developer machines, which have JDeveloper.
    how can i to do remote calls from JDeveloper?.
    I have modifed the orion-application.xml, and added remote=true.
    I have modifed the rmi.xml and added the hosts where the Jdeveloper placed.
    Any ideas?
    Thanks and cheers
    P.D The app server and jdeveloper are in the same net.
    if it is posible replys me to [email protected] too.

    Steps to access a remote EJB from within OC4J
    ++++++++++++++++++++++++++++++++++++++++++++++
    1) Deploy EJB application (ApplicationRemote) to remote container (REMOTE)
    "java -jar admin.jar -deploy ormi://REMOTE.hostname:REMOTE.port REMOTE.username REMOTE.password -deploy -file ApplicationRemote.ear
    -deploymentName ApplicationRemote"
    2) Ensure that local application (ApplicationLocal) has ejb-ref tags for remote EJBs accessed (in web.xml or ejb-jar.xml)
    3) Deploy to local container (LOCAL) an empty application (ApplicationEmpty) with the same name as the remote application (ApplicationRemote)
    "java -jar admin.jar -deploy ormi://LOCAL.hostname:LOCAL.port LOCAL.username LOCAL.password -deploy -file ApplicationEmpty.ear -deploymentName
    ApplicationRemote"
    5) Deploy local application (ApplicationLocal) to local container (LOCAL)
    "java -jar admin.jar -deploy ormi://LOCAL.hostname:LOCAL.port LOCAL.username LOCAL.password -deploy -file ApplicationLocal.ear -deploymentName
    ApplicationLocal"
    4)Restart local container
    ApplicationEmpty should consist of just an application.xml file - no modules. The same file can be deployed with different application names for all the remote
    applications that must be accessed.
    ApplicationLocal should access the remote EJB by using the following JNDI properties
    java.naming.factory.initial = "com.evermind.server.rmi.RMIInitialContextFactory"
    java.naming.provider.url = "ormi://REMOTE.hostname:REMOTE.port/ApplicationRemote"
    java.naming.security.principal = "REMOTE.username"
    java.naming.security.credentials = "REMOTE.password"
    regards
    Debu Panda

  • Ejbs - Included AQ libraries

    I'm trying to deploy an ejb using JDeveloper 3.1.1.2 into Oracle 8.16 which uses the following packages:
    oracle.aurora.jndi.sess_iiop.*;
    oracle.jms.*;
    oracle.AQ.*;
    I get ClassNotResolved exceptions at the "Generating EJBHome and EJBObject on the server..." stage.
    I assume that when the JVM on the oracle side tries to recompile my classes, it cant find the oracle packages.
    However, when I try to include the aqapi.jar as part of my advanced deployment options; I can see the AQ classes in the 'preview' (cant see the aurora ones though); but I still get the same resolver issues.
    When I query the generated jar, I cant see that AQ classes have been added.
    Would appreciate someone's help on this

    Hello,  what exactly is it you want to do with ADF?  Are you trying to convert an existing forms application to ADF?  If so, you're best bet is to download the JHeadstart Developer's Guide and read through the chapter on the Forms2ADF Generator.
    That guide, in general, might provide you with the best answer to your question.  The chapter on Using JHeadstart gives a good summary of what the tool looks like and how it works.
    In short, rather than using the standard drag-and-drop, declarative functionality that JDeveloper provides for building your application interface, JHeadstart allows you to set a wide variety of properties for your forms and tables, and for the fields on them, then uses Velocity templates to generate the forms and tables (and associated task-flows and page definition bindings) for you.  You can also customize those Velocity templates to build interface elements that aren't supported in JHeadstart by default.
    Hope that helps.

Maybe you are looking for

  • How can i add a new album on my ipad2 without ios5

    Im stuck

  • Java Webservice and Flex

    Hello All, I am stuck at getting webservice result from flex. I have created a webservice which has following method: @WebMethod public String Login(@WebParam(name = "userID") String userID, @WebParam(name = "password") String password) { // TODO Sto

  • How to use external workcentre in pm order operations?

    Dear experts, i would like to use external workcenter in pm order operations using PM01 control key. Can any body explain about how to create external work centres for using in PM orders. similarly can anybody explain about how would we settle the am

  • How do I pause screen saver?

    I have a number of pictures set up as a slide show for my screen saver.  Sometimes, I want to pause and look at the picture for a a while longer ... but not exit out of slide show.  I have been a Mac user for a long time and have lived through severa

  • What happens to MB air when the nvidia goes bad?

    My MacBook air late 2010 displays nothing on the screen. What could b wrong and how do I fix this ASAP?