EJBs in WebApp

Hello,
I'm deploying a Servlet that calls a generic utility class which returns the LocalHome interface of a Session EJB. The utility class and sesion interface classes are in .jar files within the WebApp. The Servlet is declared in web.xml, but could you please tell me the format for including the EJB interfaces and generic utility class in web.xml?
Thanks to all who try to help!
Itchy

matjaztr,
thanks for the example. I'm trying to make it work, but am not sure of what the 'id' is for or how it is determined. I couldn't find a description in the Servlet Specs. Can you tell me?
Also, my servlet calls an XDoclet-generated utility class to return the local home interface. All interfaces and the utility class are in one jar, within an ear. I also include the jar in the war (is that the right way?) So, where in the application is the 'ejb-ref-name' used? I guess I don't understand its purpose.
I have to say, I've been trying to develop a j2ee with Hibernate prototype for several months now...WHAT A MESS!!!
I DO appreciate your help though.
Itchy

Similar Messages

  • WLS 8.1 two domains with EJB and webapp deployed has JVM conflicts?

    Test configuration environment:
    Windows 2003 server installed with weblogic 8.1 server and oracle 9i.
    This weblogic server have two domains, one is for EJB deployment, the other is a webapp that implements accessing to oracle through EJB.
    The issue is when we tested a method provided by the EJB that uses double to calculate some total value, the result was correct. But when we tested it using webapp that was deployed on the same server of EJB, it's result was negative or zero.
    I think the reason is that the JVM which both EJB and webapp used for calculation was the same and may made some conflicts when they run at the same time.
    Any suggestion would be greatly appreciated.
    Thank you in advance!
    Shuaibing
    Message was edited by:
    linuxapple

    This morning I deployed that webapp to the Domain that deployed the EJB, The results of calculating in webapp's jsp was correct.
    Any one be kind enough to tell me what the calling JVM differences between single domain(deployed by EJB and webapp) and two domains (deployed EJB and webapp separately)?

  • Error using EJB from webapp.

    Hi
    Im trying to move a j2ee application from BEA to SunOne A 7.0.
    Im getting an error when using/creating a EJB.
    But i can use any method on another EJB. I havent set any authority rules at all and the xml file looks the same for both EJBs.
    This application works fine on the BEA container.
    The error is:
    javax.ejb.EJBException: nested exception is: javax.ejb.EJBException: nested exception is: javax.ejb.CreateException: Could not create stateless EJB: java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write)
    javax.ejb.EJBException: nested exception is: javax.ejb.CreateException: Could not create stateless EJB: java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write)
    javax.ejb.CreateException: Could not create stateless EJB: java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write)
    at com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:528)
    at com.sun.ejb.containers.StatelessSessionContainer.access$000(StatelessSessionContainer.java:68)
    at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:734)
    at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:176)
    at com.sun.ejb.containers.StatelessSessionContainer.getContext(StatelessSessionContainer.java:457)
    at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:452)
    at se.ltjkpg.itc.intra.ejb.session.db.DBinterfaceBean_EJBObjectImpl.select(DBinterfaceBean_EJBObjectImpl.java:108)
    at se.ltjkpg.itc.intra.ejb.session.db._DBinterfaceBean_EJBObjectImpl_Tie._invoke(Unknown Source)
    at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatchToServant(GenericPOAServerSC.java:569)
    at com.sun.corba.ee.internal.POA.GenericPOAServerSC.internalDispatch(GenericPOAServerSC.java:211)
    at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatch(GenericPOAServerSC.java:113)
    at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:275)
    at com.sun.corba.ee.internal.iiop.RequestProcessor.process(RequestProcessor.java:83)
    at com.iplanet.ias.corba.ee.internal.iiop.ServicableWrapper.service(ServicableWrapper.java:25)
    at com.iplanet.ias.util.threadpool.FastThreadPool$ThreadPoolThread.run(FastThreadPool.java:283)
    at java.lang.Thread.run(Thread.java:536)
    javax.ejb.EJBException: nested exception is: javax.ejb.CreateException: Could not create stateless EJB: java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write)
    at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:736)
    at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:176)
    at com.sun.ejb.containers.StatelessSessionContainer.getContext(StatelessSessionContainer.java:457)
    at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:452)
    at se.ltjkpg.itc.intra.ejb.session.db.DBinterfaceBean_EJBObjectImpl.select(DBinterfaceBean_EJBObjectImpl.java:108)
    at se.ltjkpg.itc.intra.ejb.session.db._DBinterfaceBean_EJBObjectImpl_Tie._invoke(Unknown Source)
    at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatchToServant(GenericPOAServerSC.java:569)
    at com.sun.corba.ee.internal.POA.GenericPOAServerSC.internalDispatch(GenericPOAServerSC.java:211)
    at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatch(GenericPOAServerSC.java:113)
    at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:275)
    at com.sun.corba.ee.internal.iiop.RequestProcessor.process(RequestProcessor.java:83)
    at com.iplanet.ias.corba.ee.internal.iiop.ServicableWrapper.service(ServicableWrapper.java:25)
    at com.iplanet.ias.util.threadpool.FastThreadPool$ThreadPoolThread.run(FastThreadPool.java:283)
    at java.lang.Thread.run(Thread.java:536)
    javax.ejb.EJBException: nested exception is: javax.ejb.EJBException: nested exception is: javax.ejb.CreateException: Could not create stateless EJB: java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write)
    at com.sun.ejb.containers.StatelessSessionContainer.getContext(StatelessSessionContainer.java:461)
    at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:452)
    at se.ltjkpg.itc.intra.ejb.session.db.DBinterfaceBean_EJBObjectImpl.select(DBinterfaceBea

    Grant the property permission in config/server.policy file of your app server instance
    for eg:
    grant {
    permission java.util.PropertyPermission "os.version", "read";
    HTH
    Satish

  • How to propagate JSP-Container-Login and EJB-Lookup?

    I think I have a very common problem which should be solved by multitudes of developers, but still I can't find sufficient info how to solve it. Here is my problem:
    - My App consists of 2 different EARs, one Web-EAR and one EJB-EAR
    - The Webapp uses digest authentication through web.xml security-constraint
    - Currently both EARs are using xml-based security-provider (jazn)
    - Any user has to log in to the webapp (this works)
    - the webapp delegates business-logic to EJB3 stateless SessionBeans
    - as long as I hardcode principal and password on the creation of the InitialContext, the authentication on the EJB-container works also fine
    - what I need is a propagation of the logged in webapp user to the EJB-container
    - I switched on subject-propagation as described in OC4J security guide chapter 18
    The problem: The propagation doesnt seem to work as expected. I still have to use (hardcoded) user/password credentials upon InitalContext-creation.
    - How can I reassure that subjectpropagation is switched in?
    - How do I have to instantiate the InitialContext in order to use propagation?
    This is what I do now:
    Properties p = new Properties();
    p.put(Context.INITIAL_CONTEXT_FACTORY, "oracle.j2ee.rmi.RMIInitialContextFactory");
    p.put(Context.PROVIDER_URL, ormi://localhost:23791/EJB-EAR);
    p.put(Context.SECURITY_PRINCIPAL, "myuser");
    p.put(Context.SECURITY_CREDENTIALS, "mypassword");
    Context = new InitialContext(p);
    When loggin into the web-container, the password of the logged-in user is not accessible anymore. Because of that I thought automatic subject-propagation shouold solve my problem. Did I misunderstood the concept of subjectpropagation (using ORMI)

    So far I have achived the following, but my problem is not really solved:
    As long as I use EJBs within the same EAR of my webapp everthing is fine.
    No need to proved credentials with the instantiation of the InitialContext. Also subject-propagation is not needed.
    At the moment I split ejb and webapp into separate EAR on the same OC4J-instance, I have to use the RMIInitialcontextFactory, to get acces to the EJBs at all. Subject-Propagation is obviusly on, because without the call of Subject.getSubject(AccessController.getContext) delivers null!
    So the remaining question is, how do I initiate the subject-propagation over RMI? Is there a special name under which I have to put my subject? Do I have to execute the actual ejb-method-call by subject.doAs.. and thus have to provide a wrapper for my EJB as a ProtectedObject?
    Anybody?

  • EJB accessing web application classes

    Hi,
    what is the right method to enable packaged EJB to access classes of a
    web application? Packaging both the EJB and web application in same
    ear is not possible in this situation. We are running WebLogic 6.0 and
    ejb is in
    wlserver6.0/config/mydomain/applications/EJB.jar
    and the classes it should use are in
    wlserver6.0/config/mydomain/applications/application_name/WEB-INF/classes,
    i.e. not packed into war -package. adding
    wlserver6.0/config/mydomain/applications/application_name/WEB-INF/classes
    to WebLogic's CLASSPATH enables the ejb to deploy but seems to screw
    other deployments.

    Please address calling and EJB from a JSP using the EJB to JSP tags...?I'm throwing
    ClassCast errros on Object...
    William Kemp <[email protected]> wrote:
    This is addressed numerous times in this newsgroup and others. So, if
    you are
    insterested in additional explanations, a search of the newsgroups will
    be
    productive.
    The WLS 6.x classloading scheme for enterprise apps, ejbs, and webapps
    does
    not permit and ejb to access webapp classes in the WEB-INF/classes directory
    unless those classes are placed in the java system classpath, which,
    you have
    found, creates other problems.
    If classes are needed by both webapp and ejb, place them in a utility
    jar file
    that is packaged in the ear with the ejb, or webapp, or both, and refer
    to
    them with the Class-Path manifest directive in the ejb jar file or the
    webapp
    war file.
    For the details, see:
    http://e-docs.bea.com/wls/docs61/programming/packaging.html#1029830
    and the 7.0 stuff is good, too:
    http://edocs.bea.com/wls/docs70/programming/classloading.html#1029830
    Bill
    janne wrote:
    Hi,
    what is the right method to enable packaged EJB to access classes ofa
    web application? Packaging both the EJB and web application in same
    ear is not possible in this situation. We are running WebLogic 6.0and
    ejb is in
    wlserver6.0/config/mydomain/applications/EJB.jar
    and the classes it should use are in
    wlserver6.0/config/mydomain/applications/application_name/WEB-INF/classes,
    i.e. not packed into war -package. adding
    wlserver6.0/config/mydomain/applications/application_name/WEB-INF/classes
    to WebLogic's CLASSPATH enables the ejb to deploy but seems to screw
    other deployments.

  • Loading struts classes into a webapp

     

    Was this ever solved? I am having a similar class loading problem with struts
    jars in web-inf/lib in war packaged in an ear with 8.1.
    Thanks, Julie
    "Vinod Mehra" <[email protected]> wrote:
    Hoki,
    After looking at the stack trace you sent us, it looks like the same
    problem as CR081073. Which has been fixed already for 700sp1.
    One off patches are availiable for the 70 version. Please contact
    support for a one off patch with CR081073 as reference.
    The problem was that the context classloader was not set correctly
    while instantiating the servlet.Struts' ActionServlet invokes the
    org.apache.commons.logging.LogFactory in the constructor. If it
    can be changed to do the same thing in the init method instead it
    will work fine.
    Let us know if the patch doesn't fix the problem.
    Thanks,
    --Vinod.
    "Nagesh Susarla" <[email protected]> wrote in message
    news:[email protected]...
    Oops i meant 'not' being honored.
    "Manifest-cp specified in WARS was NOT being honored"
    thx
    -nagesh
    Nagesh Susarla wrote:
    Hi,
    CR074842 fixes manifest related issues.
    Please contact wlsupport and request a patch for the above mentioned
    CR.
    Actually Manifest-classpath specified in WAR's was being honoredand
    thats the reason the war cannot find library.jar
    hope that helps
    nagesh
    Ho-Ki Au wrote:
    I created a MANIFEST.MF in both the webapp's META-INF directory
    and
    the WEB-INF
    directory and it still doesn't work. Can you tell me how to packagethis:
    MyApp.ear:
    Library.jar
    EJB.jar:
    META-INF/MANIFEST.MF has Class-Path: Library.jar
    WebApp.war
    WEB-INF/lib/struts.jar
    WEB-INF/MANIFEST.MF has Class-Path: Library.jarWebApp.war/WEB-INF/lib/struts.jar
    META-INF/MANIFEST.MF has Class-Path: Library.jarWebApp.war/WEB-INF-lib/struts.jar
    META-INF/application.xml
    in exploded directory form. The web app is actually not able toresolve classes
    in Library.jar and struts.jar even it uses the EJB and has an EJBreference in
    its deployment descriptors.
    Can you explain how the webapp classloading works?
    "Ajay" <[email protected]> wrote:
    Ho-Ki Au <[email protected]> wrote in message
    news:[email protected]...
    I have lots of trouble understanding how classloading in weblogic
    works.
    I have
    a ear file which contains two ejb-jars, two library jars, and
    a
    webapp
    war
    file.
    The webapp uses struts and since it is not used by anybody
    else, I
    put it
    in
    the webapp's WEB-INF/lib. I did not specify any classpath for
    the
    webapp
    because
    the container is supposed to load all jars in the WEB-INF/lib
    directory.
    I'm deploying it in the exploded directory mode where everythingis
    expanded.
    So under the application directory, there is a directorymywebapp/WEB-INF/lib
    and struts.jar resides there (not expanded).
    when i use a browser to launch the app, I saw some stack trace
    in
    the
    console
    saying NoClassDefFoundException for class
    org/apache/struts/action/Action.
    Another question. if I have a jar file which is shared betweenan
    ejb and
    a webapp,
    i put it at the root level of the ear file. in the ejb jar
    file, i
    can
    use the
    Class-Path property in MANIFEST.MF to point to it. how can
    a
    webapp
    specify to
    use that library jar file?
    You can do the same stuff as in EJB with Webapp, but I am notquite
    sure
    whether it is in Meta-Inf/manaifest or Web-Inf/Manifest in thewebapp
    directory
    Hope this helps
    Ajay
    Thanks for help. Please send me email.
    -hoki

  • How to package 3rd party libs into EAR

    Netweaver 7.0, WEBAS 640:
    I have an EAR I am deploying containing an EJB and a webapp. I have third party jars that I need to use from both the EJB and webapp, and so want to just package in as part of the EAR. I do not want to fuss with deploying the third party jars separately, nor do I want to duplicate them into the EJB and WAR separately...
    I have the jars in the root of my EAR project, and have the build path set up in NWDS for the EJB and WAR so that the jars are referenced, so I'm ok at build time...
    ...but I'm getting NoClassDefFound exceptions for the classes in the 3rd party apps when I go to run them.
    What do I have to do in my EJB and WAR projects to be able to see the third party jars in the EAR at runtime?

    Hi,
    <module>
        <java>
          <uri>abc.jar</uri>
        </web>
      </module>
    Try putting this in application.xml.
    The best option for such type of problem is creating a APP-INF folder under the root.
    Sample structure:
    ear
          APP-INF
               classes   -- put all class files and properties files
               lib           -- put all jar files
        war
        ejb-jar
    Try with this structures. Put all the jar files under APP-INF/lib folder, and the application class loader will pull all the classes and properties from classes and lib folder.
    NOTE: I am not sure this folder is recognised in EP server. Weblogic recognises this folder.
    Try this once.
    In EP server the recommendation is to create  j2ee library projects and refer them in the project descriptor files. By specifying thus the server will load them in the application class loader.
    Rama Murthy

  • Servlet Class dependency is not found at weblogic startup.

    I have the following ear file which includes:
    web-inf\lib (contains all the needed utilities jar)
    *ejb.jar
    *webapp.war (The WEB-INF\lib dir inside war file contains all the needed utilities
    jars.
    I get the following BEA-101250 error saying that a servlet could not be loaded
    because a class that it depends on is not in the classpath. But I think I place
    all the needed jars in the startWebLogic.cmd file as well as in the WEB-INF\lib
    of the ear and war files. However, if a classs that a servlet depends on is not
    found, why doesn't weblogic simply tells us what that class is (instead of guessing
    to death)? How can I find which class that the servlet depends on is not found?
    Thanks.
    BEA-101250
    Error: [context]: Servlet class className for servlet svltName could not be loaded
    because a class on which it depends was not found in the classpath classPath.\nt.
    Description
    [context]: Servlet class className for servlet svltName could not be loaded because
    a class on which it depends was not found in the classpath classPath.\nt.
    Cause
    One of the classes the servlet class uses was not recognized by the Web application
    classloader.
    Action
    Make sure the class is available either in WEB-INF/classes or WEB-INF/lib or
    system classpath.

    Hmm, do you perhaps have the prefer web-inf-classes set in weblogic.xml?
    -- Rob
    rock wrote:
    I place all the utilties class in the top level APP-INF/lib. Same error. I installed
    this application on JBoss and everything runs fine. I really don't know what
    classes or jar that weblogic says that a servlet depends on.
    There are only a finite number of places where you can put all the needed jars
    in which that servlet depends:
    1. myapp.ear/APP-INF/lib
    2. myapp.ear/WEB-INF/lib
    3. or put it to a directory in the ear and refer to each jars in the CLASS-PATH
    line of the MANIFEST.MF file.
    4. myweb.war/WEB-INF/lib
    5. EJBs are in myapp.ear top directory
    6. Refer to all the jars in startWebLogic.cmd script as it starts.
    I still don't know what jars I am missing.
    Thanks.
    Rob Woollen <[email protected]> wrote:
    rock wrote:
    Rob,
    I remove all the classpath, but when I deploy the ejb complains thatit missed
    all the needed utilities class. Ok, stop there. If the utilities classes need to be seen by both the
    EJBs and webapp, then placing them in WEB-INF/lib is not enough. That
    makes them available only to the webapp.
    If you're using 8.1, then the solution is pretty simple. Move your
    utility classes into a top-level directory named APP-INF/lib
    ie
    ear/APP-INF/lib/utils.jar
    ear/fooejb.jar
    ear/fooweb.war
    If you're using < 8.1, then you can still move the jars to APP-INF/lib,
    but you'll need to add manifest class-path entries to the EJB and webapp.
    -- Rob
    I again place it on - the ear deploys fine (ejbs
    and war). But the starting servlet could not loaded because it cannotfinds a
    class that it depends on. I think I reference all the classes or jarsthat it
    needs - so I need it to tell me which one. I don't know why weblogicmakes it
    so difficult. It took me a month already and all I need to do is findthe class
    that it complains about.
    Rob Woollen <[email protected]> wrote:
    Yes, it would be nicer if that exception had more information.
    You told the web container the servlet-class in your web.xml. THe
    web
    container tried to load it and got a NoClassDefFoundError.
    Unfortuantely that exception doesn't include much information.
    NoClassDefFoundErrors are caused by something in a parent loader
    depending on something in a child classloader.
    Step #1 is for you to remove everything you've added to the $CLASSPATH.
    If that doesn't solve your problem, post again.
    -- Rob
    rock wrote:
    I have the following ear file which includes:
    web-inf\lib (contains all the needed utilities jar)
    *ejb.jar
    *webapp.war (The WEB-INF\lib dir inside war file contains all the
    needed
    utilities
    jars.
    I get the following BEA-101250 error saying that a servlet could notbe loaded
    because a class that it depends on is not in the classpath. But Ithink I place
    all the needed jars in the startWebLogic.cmd file as well as in theWEB-INF\lib
    of the ear and war files. However, if a classs that a servlet dependson is not
    found, why doesn't weblogic simply tells us what that class is (insteadof guessing
    to death)? How can I find which class that the servlet depends onis not found?
    Thanks.
    BEA-101250
    Error: [context]: Servlet class className for servlet svltName couldnot be loaded
    because a class on which it depends was not found in the classpathclassPath.\nt.
    Description
    [context]: Servlet class className for servlet svltName could notbe loaded because
    a class on which it depends was not found in the classpath classPath.\nt.
    Cause
    One of the classes the servlet class uses was not recognized by theWeb application
    classloader.
    Action
    Make sure the class is available either in WEB-INF/classes or WEB-INF/libor
    system classpath.

  • Security restriction in LoginModule?

    I have implemented my own LoginModule. In the module, I try to reference an
    EJB.
    When I call PortableRemoteObject.narrow(), I get the following error:
    java.lang.ClassCastException: Cannot narrow remote object to
    net.lm.uams.service.ejb.UserAccountManagementServiceRemoteHome
    Is this because of some security restriction related to the LoginModule, or
    do you think that the problem stems from having two copies of the same EJB
    classes? If the problem is related to having two copies of the classes, how
    would I go about referencing the classes from the LoginModule without having
    them in that .jar file?
    Note that this problem isn't at weblogic startup - I have written code to
    handle this initial administrator authentication. The problem occurs later
    during form-based authentication. The publicly available pages/EJBs work
    fine.
    using WLS 7.0 on win2000.
    I'd appreciate any pointers.
    thanks
    Sean

    Bill,
    I haven't added anything at all to the classpath in my startup script. WL
    just picks up my jar in WL_HOME/server/lib/mbeantypes. I've done a
    System.getProperty() for the classpath at runtime, and it doesn't include my
    ejb.jar.
    Yesterday, I re-wrote my class to do a straight JDBC lookup to the database
    for username/pwd/roles. It's not the solution I'd prefer, because it
    introduces a reliance on the underlying database schema into the
    LoginModule. But, I don't really have time at the moment to spend
    experimenting with my original idea. Hopefully I can come back to it in the
    future.
    thanks again,
    Sean
    "William Kemp" <[email protected]> wrote in message
    news:[email protected]...
    Each enterprise application has it's own classloader hierarchy, whichmeans the
    ejbs and webapps in an EAR file are loaded by a classloader hierarchy thatis
    parented by the boot, system, and application classloaders that load theboot
    classes, java core classes, and weblogic.jar classes, and any classes thatyou
    put in the classpath when you start weblogic. The EAR file classes areloaded
    below these, hierarchically speaking.
    I am assuming that you have put your LoginModule classfile in the javaclasspath
    when you start the server. Are you perhaps putting the jar file generatedby the
    ejbc process in the java classpath when you start the server, too? Couldyou
    post your start script? Also, remember that the start script that comeswith
    weblogic prepends it's jars and what not to the existing classpath. So,that
    while you may not be explicitly adding the ejb jar file to the classpathin the
    start script, it may be already in the classpath in the currentenvironment and
    the start script is tacking that on at the end.
    Just a guess.
    Bill
    Sean Ryan wrote:
    Thanks for the response William. I have tried what you suggested, but
    the
    problem is still the same.
    If I do the jndi lookup without the narrow() part, I can execute methodson
    the resultant object using reflection. This is a bit of a hack, and not
    really a satisfactory solution.
    I have written a main() method in my class, and when I execute it (fromthe
    .jar), it can do the lookup and narrow without any difficulty.
    As I understand it, each container has its own classloader, however myclass
    is essentially executing from within weblogic. Is there a bit of a greyarea
    here in relation to class loading? Because, as I said my class worksfine
    when it is executing in a separate jvm.
    again, I would appreciate any input you can offer.
    Sean
    "William Kemp" <[email protected]> wrote in message
    news:[email protected]...
    If this was because of a security restriction, you would see a
    different
    Exception. Try putting just the compiled Home and Remote interfaces inthe
    classpath used by the LoginModule and not the jar file with thegenerated
    and
    compiled code for the stubs. You don't need them in the client becuase
    you
    are
    coding to the inteface, not the stubs.
    Bill
    Sean Ryan wrote:
    I have implemented my own LoginModule. In the module, I try to
    reference
    an
    EJB.
    When I call PortableRemoteObject.narrow(), I get the following
    error:
    >>>>
    java.lang.ClassCastException: Cannot narrow remote object to
    net.lm.uams.service.ejb.UserAccountManagementServiceRemoteHome
    Is this because of some security restriction related to theLoginModule,
    or
    do you think that the problem stems from having two copies of the
    same
    EJB
    classes? If the problem is related to having two copies of the
    classes,
    how
    would I go about referencing the classes from the LoginModule
    without
    having
    them in that .jar file?
    Note that this problem isn't at weblogic startup - I have written
    code
    to
    handle this initial administrator authentication. The problem occurslater
    during form-based authentication. The publicly available pages/EJBs
    work
    fine.
    using WLS 7.0 on win2000.
    I'd appreciate any pointers.
    thanks
    Sean

  • A general question concerning .EAR files?

    Hi All,
    My question is, what should be the file extension of the utility class that
    I will include in my ".ear" file? Should it be filename.jar or
    filename.war? The team that I am on has successfully been able to deploy a
    .ear file that only contains our entity and session beans. We would also
    like to "JAR" up our utility class, so that we may be to use the hot
    deployment feature of the application server and the removal of the
    enviroment variable where the utility classes are located.
    We are currently using the Ant utility to help us build our .ear file.
    When I give the utility file name a ".war" extension and then deploy the
    ".ear" file; the application server boots up successfully without throwing
    any exceptions. When I give the utility file name a ".jar" extension and
    then deploy the ".ear" file, the application server boots up successfully
    with exceptions concerning unable to locate one to several utility classes.
    Thank you in advance,
    Charles
    Charles Jean-Baptiste
    [email protected]

    It sounds like you are having a ClassLoader problem.
    The main advantage of deploying EJBs and WebApps in an ear file is that the
    ClassLoader for the webapp inherrits from the ClassLoader for the EJBs.
    This basicly means that the webapp can see the EJBs...when you put another
    util.jar file in the EAR file this will be in a different ClassLoader and
    not accesible by either the EJBs or the WebApp
    (and visa-versa)....to make this accesible you need to add the entry
    Class-Path: util.jar to the manifest file for the EJB.
    1)Create a text file newmanifest.txt with a one line entry of
    Class-Path: util.jar
    2) When you build the original EJB jar file do like this:
    jar cmf newmanifest.txt MyEJB.jar com META-INF
    -this will create the jar file MyEJB.jar adding directories com and META-INF
    and including the contents of newmanifest.txt in the manifest for the jar
    file.
    3) Build this all into the ear file.
    The EJB will now be able to see the util.jar and because the WebApp can see
    the same as the EJB it will also be able to see the util.jar.
    Gareth
    "Charles Jean-Baptiste" <[email protected]> wrote in message
    news:[email protected]...
    Hi All,
    My question is, what should be the file extension of the utility classthat
    I will include in my ".ear" file? Should it be filename.jar or
    filename.war? The team that I am on has successfully been able to deploya
    .ear file that only contains our entity and session beans. We would also
    like to "JAR" up our utility class, so that we may be to use the hot
    deployment feature of the application server and the removal of the
    enviroment variable where the utility classes are located.
    We are currently using the Ant utility to help us build our .ear file.
    When I give the utility file name a ".war" extension and then deploy the
    ".ear" file; the application server boots up successfully without throwing
    any exceptions. When I give the utility file name a ".jar" extension and
    then deploy the ".ear" file, the application server boots up successfully
    with exceptions concerning unable to locate one to several utilityclasses.
    >
    Thank you in advance,
    Charles
    Charles Jean-Baptiste
    [email protected]

  • How do I check the current number of users connected to the application?

    Hi there,
    I would appreciate that you advise me on how to know how many users are accesing
    an application I've got in production, powered by BEA WebLogic Server 6.1.
    In the Administration console, I go to the specific server, and inside the tab "monitoring",
    then "Performance", I've got some graphics showing the memory usage and throughput.
    But, where do I see the number of actual connection to the application?
    Thanks

    Mark Griffith <[email protected]> wrote:
    Oscar:
    I am pretty sure that WLS doesnt give you the type of monitoring you require. You
    might have to check out one of the third party monitoring partners like Wiley or
    Precise.I guess that depends on how you define 'how many users are accessing' an
    application(s) - for example, 'OpenSessionsCurrentCount' can serve as a rough measure of
    the number of users currently using the web application. or, number of threads + execute
    queue length can give you an idea of current number of user requests executing/waiting
    to be executed at any given time, etc. WebLogic does provide lots of useful monitoring
    information, and the fact that it uses JMX makes obtaining this information very easy.
    Having said that I would like to ask a couple of questions.
    a) what is your app (EAR? EJB's WebApp?)
    b) why do you want to know, meaning as soon as you know how many what is the next
    thing you want to know/see?
    Cheers
    mbg
    "Oscar" <[email protected]> wrote:
    Hi there,
    I would appreciate that you advise me on how to know how many users are
    accesing
    an application I've got in production, powered by BEA WebLogic Server 6.1.
    In the Administration console, I go to the specific server, and inside the
    tab "monitoring",
    then "Performance", I've got some graphics showing the memory usage and
    throughput.
    But, where do I see the number of actual connection to the application?
    Thanks
    Dimitri

  • Help with JMX, SNMP in my app.

    My app has bunch of EJBs(in Jars) and one WAR file. Everything is packaged inside EAR file. My app is using JDBC and IMAP connections. Currently SNMP implementation is very simple - we jsut sending fixed trap with variable VarBind information.(no set/get functionality). Please elt me know if somebody implemented MBeans for their application. We are planning to have a full set/get functionality with MIB defined through SNMP Agent on WLS. IS it possible? I would like to hear some ideas on how to implement it.
    Thank you foir your help in advance.

    I would like to be able to do gets and sets on my EJBs and WebApps from
    a remote SNMP
    client manager. I know sets cannot be done to WL MBeans using the
    WebLogic SNMP Service. I see two ways
    to go, run an AdventNet or Sun SNMP adapter in each WL Server which will
    forward
    SNMP requests to the MBeanServer or run my own SNMP agent which is
    proxied from
    the WL SNMP agent. The WL SNMP agent does not allow sets, will it
    forward set commands
    to other SNMP agents it is proxying for?
    Mihir Kulkarni wrote:
    Rick/Stanislav, could you please elaborate ?
    Do you want to add to the BEA MIB - that is not possible
    if you want to write custom MBeans to monitor things, you certiainly can by registering your notificationListener on the mbean...
    I dont think, it would be possible to monitor a custom MBean through SNMP.
    my 2 cents,
    Mihir
    Rick Holland wrote:
    I am interested in exactly the same thing. However since 6 weeks has
    gone by without a response it looks like we are on our own.
    Stanislav Paltis wrote:
    My app has bunch of EJBs(in Jars) and one WAR file. Everything is packaged inside EAR file. My app is using JDBC and IMAP connections. Currently SNMP implementation is very simple - we jsut sending fixed trap with variable VarBind information.(no set/get functionality). Please elt me know if somebody implemented MBeans for their application. We are planning to have a full set/get functionality with MIB defined through SNMP Agent on WLS. IS it possible? I would like to hear some ideas on how to implement it.
    Thank you foir your help in advance.
    - Rick Holland OO/Distributed Systems Consultant
    - ObjectAge Inc.
    - [email protected]
    "Logic is a wreath of pretty flowers, that smell bad"
    - Rick Holland OO/Distributed Systems Consultant
    - ObjectAge Inc.
    - [email protected]
    "Logic is a wreath of pretty flowers, that smell bad"
    [att1.html]

  • Exploded vs. Archived EAR structure (when using split development)

    Using the split development structure suggested in Weblogic 8.1 with wlpackage
    ant task, I noticed that the exploded ear and the archived ear generation creates
    a "flat" deployment structure. i.e. all the files inside the ear hierarchy are
    bundled without any intermediate respective jars.
    Is there a provision to package the ejb modules in one or more jar files when
    building a qa and/or production ear ? Is this possible to accomplish or do I need
    to write separate ant "targets" in the ant script that would manually jar up the
    necessary ejbs. If so, how would this work in conjunction when I have a "ant ear"
    target ?
    I also noticed that the medrec example app has application specific value/dto
    classes bundled in a separate jar file using a build.xml file. My question, when
    running wlcompile at a higher level how does it know NOT to put the value classes
    separately under APP-INF/classes, i.e. why does the build not build/see these
    common value classes twice.
    Thanks for your help!

    DP wrote:
    Using the split development structure suggested in Weblogic 8.1 with wlpackage
    ant task, I noticed that the exploded ear and the archived ear generation creates
    a "flat" deployment structure. i.e. all the files inside the ear hierarchy are
    bundled without any intermediate respective jars.
    Is there a provision to package the ejb modules in one or more jar files when
    building a qa and/or production ear ? Is this possible to accomplish or do I need
    to write separate ant "targets" in the ant script that would manually jar up the
    necessary ejbs. If so, how would this work in conjunction when I have a "ant ear"
    target ? You would have to do this manually. Typically wlpackage would have to
    modify your application.xml to archive the modules. For instance, your
    application.xml probably has uris like myweb, myejb in it now because
    that's how you named your directories. If we archived those, they'd
    become myweb.war and myejb.jar, and the application.xml would need to be
    modified to reflect the new uris.
    It's all possible for us to do, but we ran out of time during 8.1 to get
    this one in.
    >
    I also noticed that the medrec example app has application specific value/dto
    classes bundled in a separate jar file using a build.xml file. My question, when
    running wlcompile at a higher level how does it know NOT to put the value classes
    separately under APP-INF/classes, i.e. why does the build not build/see these
    common value classes twice. I'm not sure I exactly understand your question, but let me explain how
    wlcompile works and see if that answers your question.
    wlcompile looks at each directory under the srcdir and decides whether
    it's an EJB, a webapp, or a java module. It supports an
    includes/excludes list to let you filter those directories.
    Anything that's not recognized as an EJB or webapp is compiled into
    APP-INF/classes.
    -- Rob
    >
    Thanks for your help!

  • Differences betx WL5/6 and WL8??

    The old docs don't seem to be online.
    I being intereviewed for a job were they are still using WL5
    My experience is based on seeing WL6 at a previous job and using WL 8 [ workshop and server ] at home.
    What are the important differences??
    Is there some set of reasons for a company not to upgrade over the last several years???

    howarddy
    Moving from WLS5 to WLS8 is a non trivial task, I am currently upgrading WLS8.1sp1 to WLS8.1sp3 and that is a fair amount of work in it's own right.
    I suggest you start by spending some time going through all the release notes with someone who knows your application code well:
    http://e-docs.bea.com/wls/docs61/notes/
    http://e-docs.bea.com/wls/docs70/notes/
    http://e-docs.bea.com/wls/docs81/notes/
    and make a note of the main things you will need to change, then start by creating your WLS8.1sp3 environment. Next start by trying to compile and deploy each type of component, find a simple ejb and webapp and do those first. Once these work apply all the required changes to the rest of your code. Compile, deploy and test each component one at a time and once the new addition has been made test the entire application, resist making changes to all components in one go.
    If you have unit tests make sure you use them to check your upgraded components, if you don't now is a great time to create a suit of unit tests that you can use for this migration and for the future.
    Good luck

  • Arranging WL classloaders

    [WL 6.1, Win2K]
    I have a server-setup/deployment issue/question. We're deploying a webapp (.war)
    together with some ejbs. There is framework code shared by the ejbs and webapp
    code. My question is how can I arrange things such that I if I change this framework
    code and redeploy the webapp, the webapp will pick up the new framework code.
    What I'm doing right now is putting the framework code on the system classpath
    in startWeblogic.cmd. I realize that this is why changes aren't picked up-- the
    system classloader is never destroyed and will not reload classes. I realize
    that in order to get this to work I have to load the framework code in either
    the webpp and/or ejb classloaders. But- I don't want to duplicate the code and
    deploy with both (plus, I think doing that might cause ClassCastExceptions with
    shares classes).
    Is there another way? Thanks.

    You do not need to duplicate the classes in the same EAR file. The application
    class-loader will load the EJB jar files AND any dependent utility jar files. Since
    the webapp class-loader is a child of the EJB class-loader, all classes loaded by the
    EJB class-loader are visible to the webapp...
    Use the Class-Path entry in the EJB jar file(s) manifest to force the shared classes to
    be loaded by the EJB class-loader (You need a patch for WLS 6.0 to make this work but
    it works fine in WLS 6.1)...
    Paul Folbrecht wrote:
    This is my experience also. And, duplicating classes is bad for other reasons:
    it will cause ClassCastExceptions if you pass an instance from the EJB to the
    web tier, for instance, because the ejb's CL class is considered a different class.
    What would be ideal would be a way to specifiy a location for common classes such
    that:
    1) They would be available to both the webapp and EJBs in the same EAR.
    2) You could modify the classes and have them be reloaded.
    In other words, what's needed is another classloader in the hierarcy, below the
    system CL but above the webapp and EJBs'.
    I guess there is no way to accomplish these things at the moment.
    "Khiawpin" <[email protected]> wrote:
    Even when this is done, the common classes have to be included
    in all the JAR and WAR files. If they are excluded from the WAR
    file, a ClassNotFoundException will occur.
    However, I thought the class loader hierachy is supposed to
    allow classes not in WAR files to be obtained from the EJB
    class loader.
    Any pointers?
    Robert Patrick <[email protected]> wrote:
    The simplest way of accomplishing this is to package the webapp, the
    framework classes,
    and the EJBs into an EAR file. Then, you can simply redeploy the EAR
    file.
    Paul Folbrecht wrote:
    [WL 6.1, Win2K]
    I have a server-setup/deployment issue/question. We're deploying
    a
    webapp (.war)
    together with some ejbs. There is framework code shared by the ejbsand webapp
    code. My question is how can I arrange things such that I if I changethis framework
    code and redeploy the webapp, the webapp will pick up the new frameworkcode.
    What I'm doing right now is putting the framework code on the systemclasspath
    in startWeblogic.cmd. I realize that this is why changes aren't pickedup-- the
    system classloader is never destroyed and will not reload classes.I realize
    that in order to get this to work I have to load the framework codein either
    the webpp and/or ejb classloaders. But- I don't want to duplicatethe code and
    deploy with both (plus, I think doing that might cause ClassCastExceptionswith
    shares classes).
    Is there another way? Thanks.

Maybe you are looking for