Refering to JNDI name in other EAR file

Hi, there:
Our team is trying to write a session bean as a factory to serve
other beans. Even the JSP (or other clients) can find the correct
session bean residing on different ear file, the factory can't return
properly when the returning parameter is a java object (it works fine
if we only return int/string/etc). Is there a work-around to make
these work?
Thanks,
-Daniel

Hi Ravi,
Can you please post the error message and stack trace? Also what version of WLS are you
using? The more relevant information you can give me, the more likely I'll be able to
help you.
- Matt
ravichandran wrote:
Hi Matthew,
Thank u for very quick response, the error is class cast exception and these objects
are serialized and kept in ear. ur solution will be highly appreciated.
regards
ravi
Matthew Shinn <[email protected]> wrote:
Hi,
What error are you getting (please include full error message & stack trace)?
Also,
is the object you are returning Serializable?
- Matt
ravi wrote:
Hello Daniel
I also have the same problem, do u have any solutions, please let me know,I was
struggling for more than ten days.
regards
ravi
[email protected] (Daniel) wrote:
Hi, there:
Our team is trying to write a session bean as a factory to serve
other beans. Even the JSP (or other clients) can find the correct
session bean residing on different ear file, the factory can't return
properly when the returning parameter is a java object (it works fine
if we only return int/string/etc). Is there a work-around to make
these work?
Thanks,
-Daniel

Similar Messages

  • Default ejb JNDI name in websphere ear

    Hi,
    I am using ejb2.0-2.1 in websphere 6.0 WAS.
    I have a local entity ejb.
    I wish to define a service locator for this as a singleton class that caches the entity bean's home after doing a JNDI lookup.
    I am interested in two things.
    1) Since my service locator is a simple singleton class I want it to lookup the local ejb homes using the JNDI names supplied in the websphere specific deployment descriptors correspondiing to ejb-jar.xml. (No point in even thinking of any ejb-local-ref) My service locator is defined inside the same ejb jar.
    2) Ideally I would like to not specify any explicit JNDI names in any websphere specific DD for the local ejb homes. I would like to use a JNDI name based on the ejb-name itself.
    I have been able to do 2) using JBoss.
    Thanks.
    Raster

    Hi Ravi,
    Can you please post the error message and stack trace? Also what version of WLS are you
    using? The more relevant information you can give me, the more likely I'll be able to
    help you.
    - Matt
    ravichandran wrote:
    Hi Matthew,
    Thank u for very quick response, the error is class cast exception and these objects
    are serialized and kept in ear. ur solution will be highly appreciated.
    regards
    ravi
    Matthew Shinn <[email protected]> wrote:
    Hi,
    What error are you getting (please include full error message & stack trace)?
    Also,
    is the object you are returning Serializable?
    - Matt
    ravi wrote:
    Hello Daniel
    I also have the same problem, do u have any solutions, please let me know,I was
    struggling for more than ten days.
    regards
    ravi
    [email protected] (Daniel) wrote:
    Hi, there:
    Our team is trying to write a session bean as a factory to serve
    other beans. Even the JSP (or other clients) can find the correct
    session bean residing on different ear file, the factory can't return
    properly when the returning parameter is a java object (it works fine
    if we only return int/string/etc). Is there a work-around to make
    these work?
    Thanks,
    -Daniel

  • Running a J2EE application (ear file)

    I am new to J2EE. I have created a EnpDtls Servlet simply to greet a person by name - like sample application. But i am unable to see it in on web (localhost:8080). What should i give as url to view the application? I am using J2EE 1,4 Application Server 8.2 from SUN. and jsdk 1.5
    I can see my html file under Context Root i.e localhost:8080/EmpDtlsCx. But what should be the url to see the class file of my sevlet.
    Servlet is : EmpDtls.class
    ContextRoot : /EmpDtlsCx
    Web Display : EmpDtlsWebDsp
    EAR file : EmpDtlsEar
    I have used deploytool. I can also see the Application in Admin console (localhost:4848) -> Enterprise Application. But there also the Admin console does not give any otion of launch as it gives for Web Application. Please note that the verifier option in Admin consoile also passes of sucessfully.
    The deployment descriptors: application.xml, sun-application.xml are under <J2ee INSTALLDIR>/domains/domain1/applications/j2ee-apps/EmpDtlsEar/ - the name of the EAR file.
    Should i get ContextRoot as folder name ?
    Could anyone help in solving my problem ?
    The structure of directories and files is as follows
       EmpDtlsEar
       |
       |____ META-INF
       |                |
       |                |____ application.xml
       |                |____ sun-spplication.xml
       |                |____ sun-j2ee-ri.project
       |                |____ MANIFEST.MF
       |
       |____ war-ic.war
                       |
                       |____ EmpDtls.html
                       |
                       |____ META-INF
                       |                  |
                       |                  |__ MANIFEST.MF
                       |
                       |____ WEB-INF
                                         |
                                         |__ web.xml
                                         |
                                         |__ sun-web.xml
                                         |
                                         |__ sun-jee-ri.project
                                         |
                                         |__ classes
                                                  |
                                                  |__ EmpDtls.class
    thanks in advance
    tshot

    Ok, you have your servlet defined, but now you should map it using mapping tags. Try editing your web.xml file as follows (adding mapping):
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
      <display-name>EmpDtlsWarDisp</display-name>
      <servlet>
        <display-name>EmpDtlsWebDisp</display-name>
        <servlet-name>EmpDtlsWebComp</servlet-name>
        <servlet-class>tshot.EmpDtls</servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>EmpDtlsWebComp</servlet-name>
        <url-pattern>/EmpDtls</url-pattern>
      </servlet-mapping>
    </web-app>Note the adding of "tshot." in front of your EmpDtls in your servlet-class tag.
    This means you need to create a directory in your src location called "tshot", move your EmpDtls.java into the new directory, and then edit that java file, placing the following line at the top of it:
    package tshot;Once you have re-built and re-deployed this you should be able to access your servlet at:
    http://localhost:8080/EmpDtlsCx/EmpDtls
    Refactoring is a term used to mean you've decided to change the name of a variable, method or some alteration of your java file such as changing package names (or adding to a package in this case) whereby the results may or may not affect other classes which depend on this class. Typically, nowadays refactoring is usually done by selecting a refactoring command from a menu item or button within an IDE (Integrated Development Environment) whereby the IDE performs all of the dependancy checking for you and copies the change to affected areas where necessary. Thus, all you need to do is choose the right refactoring operation and click "Ok" in most cases. In the old days, you would have to keep track of all affected areas and manually edit where necessary, based on your imposed change.

  • What will happen if I open an .ear file on the OAS OC4J_Portal/applications

    Hi,
    Is it possible to open an .ear file in another directory of OC4J_Portal instance with UNIX as the flavour. If so what would happen?

    Hi Vijayendra,
    I am not able to understand your question clearly, but I think you are looking to deploy the single EAR file twice in the same OC4J. It's possible only if you give a different name for the EAR File & the Application.
    Regards,
    Sandeep

  • Error while deploying .ear file on the oracle 10g Application server

    While deploying the ITS.ear or any other .ear file thru the application server console the screen shows the deploying screen continuously without any errors.The screen shows uploading the .ear file without any errors.Can somebody help me out it 's very urgent
    Thanks in advance.

    Hello,
    I asked you about the amount of AS instances because currntly I'm working on a clustering issue likewise. Nevertheless, your issue looks like a browser cache problem, have you tried different browsers to perform your deployment tasks? what about ant tasks?
    hope it helps,
    RB

  • How to deploy ear file in OATS

    hi gems..good afternoon...
    I need to deploy my application's EAR file in OATS to test it.
    I have installed OATS 12.0 version and also have started the demo setup i.e the medrec application from the documentation.
    Now, how can I setup my application in OATS...I have the ear file and the database credentials.
    Pls guide me...thanks a lot...

    gogol wrote:
    Thanks a lot Jean-Baptiste for your reply..
    That means cant we deploy any other ear file (other than medrec application, default application during installation) if we dont install weblogic separately from a licensed version??Exactly.
    >
    actually the confusions i faced are:
    after installation of OATS, when i hit the url "http://localhost:7011/console" and gave the credentials "weblogic/welcome1", then it shows the medrec.ear, physician.ear etc are deployed.
    Those are demo samples provided with ATS
    Again when i hit the url "http://localhost:8088/console" and gave the credentials "oats/<password>", then it shows the oats_ee.ear is deployed.
    Thats why I am confused, how the ear has been deployed....there are two locations available with different credentials.2 different locations because 2 different applications not running in the same container (different port, different url)
    >
    I am followng the Getting Started documentation, but i couldnot clear the concept.Best is to use your own licensed weblogic installation. Of course, technically speaking, you can do it, but be careful not to be out of compliant.
    Cheers
    JB

  • JNDI names missing after deployement of .ear files

    I am trying to take an app that is currently in 1 ear file and split it into 2
    ear files for 2 weblogic server instances. When I split the ear and deploy, deployment
    seems to work fine but JNDI names never show up. When I deploy as one ear, all
    JNDI names show up fine. The jars and wars inside the ears are exactly the same
    build artifacts for either configuration. The original application.xml from 1
    ear is split into 2 ears appropriately.
    Any ideas?

    Try completely closing out of iBooks: from the Home screen double tap the Home button, once the multitask bar appears swipe up on the iBooks icon to close out of iBooks. Now restart the iPad and see if this might help resolve the issue.
    Alternatively instead of a restart you could perform a Reset once you close iBooks.
    Reset: hold down the Home and Sleep/Wake button at the same time for ~10sec, ignore the Slide to Power Off, the iPad will then Reset, Note: No data is lost during a Reset.

  • Two ear file communicating with each other

    HI,
    I have one doubt,
    I Have two ear files (two webservices actually) deployed succesfully in the same application server (Weblogic7.0). Let us say them a.ear and b.ear
    In a.ear there are class say A.class and B.class. In B.java file there is a staic HashMap which stores some object based on some id. Also in B.java there is static method which takes the id as a parameter and return the corrospojnding object stored in the static hasmap.
    In b.ear file there class say B.class and C.class. Note that this ear file has its own copy of B.class file. In C.java file i create an object (though i dont need create being it a static method) of B.java and calls the static object passing it the id and expecting it that it will return me the object stored in the Hashmap. it returns me null though it has the objects stored for that id.
    Is it because both ear files has their own copy of B.class. but i though that that they are running in the same jvm in application server so it should not be a problem. if this is the reason then my problem will be solved if i put them in same ear file.
    Can anybody put his insights into his experiences and lemme know what is the cause of problem and solution and for my knowledge why it is happening.
    Best Regards,
    Akhil Nagpal

    You're right that the two have different copies of the class. This is because the EJB container uses a different classloader for different applications, to prevent statics clashing with each other and other related security reasons.
    Usually if you want to communicate from one to the other, you would use the EJB mechanism itself. The JNDI names should be global (from simple tests I did in the past, this seems to be the case) so that one application can look up an EJB from the other.

  • How to change web-app display name within EAR file?

    Currently we are deploying an EAR file (which contains a web-app and an EJB) per
    BEA recommendations. The web-app shows up on the admin console with '/' as the
    name. Is there anyway to change this to the name I want?
    thx,
    Matt

    FYI - here is the entire content of applicaiton.xml in the EAR file we deploy:
    <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application
    1.3//EN' 'http://java.sun.com/dtd/application_1_3.dtd'>
    <application>
    <display-name>RVApp</display-name>
    <module>
    <ejb>RVTrackingBean</ejb>
    </module>
    <module>
    <web>
    <web-uri>RVWebApp</web-uri>
    <context-root>/</context-root>
    </web>
    </module>
    </application>
    "Erik Johnson" <[email protected]> wrote:
    >
    No, you can't change that in the console. It's defined in the application's
    application.xml
    descriptor file.
    erik
    "Matt Savino" <[email protected]> wrote:
    Currently we are deploying an EAR file (which contains a web-app and
    an EJB) per
    BEA recommendations. The web-app shows up on the admin console with'/'
    as the
    name. Is there anyway to change this to the name I want?
    thx,
    Matt

  • How to deploy ear file with jar file and war file with different names

    Hi,
    As part of weblogic migration from WL 6.1 sp3 to WL 10, Iam facing some problem.
    Problem:
    I have one ear file(abc.ear) to deploy which contains one jar file(xyz.jar) and one war file(pqr.war).
    In config.xml file of WL 6.1, it was mentioned as :
    <Application Deployed="true" Name="abc" Path="./config/mydomain/applications/abc.ear">
    <EJBComponent Name="xyz" Targets="myserver" URI="xyz.jar"/>
    <WebAppComponent Name="pqr" Targets="myserver" URI="pqr.war"/>
    </Application>.
    The above is working fine.
    But in config.xml file WL10,I cannot mention the same.
    I need to have different application anmes for ear,jar and war.If I deploy as a ear file,the jar and war files are deployed with the same ear file name.
    I tried the following options:
    1) Deploying as a ear file by adding <sub-deployments>
    2) Deploying both war and jar seperately which is not recommended in my application.
    Please provide the content I should place in the config.xml so that everything works fine correctly.
    Any help is appreciated.

    Hi,
    As part of weblogic migration from WL 6.1 sp3 to WL 10, Iam facing some problem.
    Problem:
    I have one ear file(abc.ear) to deploy which contains one jar file(xyz.jar) and one war file(pqr.war).
    In config.xml file of WL 6.1, it was mentioned as :
    <Application Deployed="true" Name="abc" Path="./config/mydomain/applications/abc.ear">
    <EJBComponent Name="xyz" Targets="myserver" URI="xyz.jar"/>
    <WebAppComponent Name="pqr" Targets="myserver" URI="pqr.war"/>
    </Application>.
    The above is working fine.
    But in config.xml file WL10,I cannot mention the same.
    I need to have different application anmes for ear,jar and war.If I deploy as a ear file,the jar and war files are deployed with the same ear file name.
    I tried the following options:
    1) Deploying as a ear file by adding <sub-deployments>
    2) Deploying both war and jar seperately which is not recommended in my application.
    Please provide the content I should place in the config.xml so that everything works fine correctly.
    Any help is appreciated.

  • Generated ear file has no file name

    Hi experts,
    I need to deploy the changes made to an existing webdynpro project but upon generation of the ear file to be deployed, the generated ear file has no file name. The created file is .ear whereas the previous generated ear files have filenames. Example is test.ear. I generated the ear file from the webdynpro explorer, then right click on my project and click on Create archive option.
    Please advise if there are any settings or configurations to be done in NWDS so that the generated ear file will have a filename.
    Thanks,
    Eric

    Hi ,
    reer the link
    http://help.sap.com/saphelp_nw70/helpdata/en/42/dfc3bb607a6ffbe10000000a1553f6/content.htm
    This is not a relevent forum for your question,better to post in EP forum.
    Regards,
    Raj

  • Is there any option to recover a file we saved with the same name that other by mistake in a MAC PC

    is there any option to recover a file we saved with the same name that other by mistake in a MAC PC

    There's a slim chance. +*Stop using the drive IMMEDIATELY.+*
    Then see: [Data Recovery|http://web.me.com/pondini/AppleTips/Recover.html].

  • (266436851) Q: WWSD-7 Can web service be in packages other than .ear files?

    Q:<WWSD-7> Could we deploy the SOAP package not using the ear, instead could we
    put all the related Java code to jar file and the rest of the code to the war
    files? The reason I asked is because we do not deploy our applciation in ear format.
    A:<WWSD-7> EAR files are general packaging structures that can contain war, EJB
    jar, rar and regular jar files. The wsgen task provided expects an output file
    to be an ear file. If you are going to utilize another format you will be resonpsible
    for building the appropriate web application components. It can be done but you
    will have to do more work and not use the provided wsgen task. As far as web services
    in general are concerned, the actual business processing can be done by any component
    just as long as there is a servlet that understands the SOAP requests and responses.
    It is BEA expectation that EJBs are supposed to be you core business components
    so these will be the operations most likely to be exposed as web srevices.

    Hello Erik,
    I was looking into the thread , it seems you have found out the solution .
    Could you look into this thread and provide some insight for the same ? I am currently facing the problem as mentioned in the link below.
    CAF-EJB
    Regards,
    Ronniee

  • JNDI name for a JMB is not replicatet to other servers in the cluster

    Hi,
              wl6.1sp7, two server cluster
              When I look at the JNDI Tree for a server I can't find JNDI names of JMB's from the other server in the cluster.
              I get an exception when trying to send to a destinaton on the other server. (Unable to resolve 'xlink.jms.service.report.biztalk-lab.Report' Resolved: 'xlink.jms.service.report' Unresolved:'biztalk-lab')
              Setting are same as explained in this thread...
              http://forums.bea.com/bea/thread.jspa?threadID=600003492&tstart=0
              And JNDINameReplicated is set to true....
              Why is the JNDI names not replicated?
              <JMSQueue JNDIName="xlink.jms.service.report.biztalk-lab.Report"
              JNDINameReplicated="true" Name="Report" StoreEnabled="default"/>
              This is the DD of a JMB:
              <weblogic-ejb-jar>
              <weblogic-enterprise-bean>
              <ejb-name>xlink.jms.service.report.biztalk-lab.Report</ejb-name>
              <message-driven-descriptor>
              <pool>
              <max-beans-in-free-pool>3</max-beans-in-free-pool>
              <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
              </pool>
              <destination-jndi-name>xlink.jms.service.report.biztalk-lab.Report</destination-jndi-name>
              <connection-factory-jndi-name>xlink.jms.factory.commerceFactory</connection-factory-jndi-name>
              </message-driven-descriptor>
              <jndi-name>xlink.jms.service.report.biztalk-lab.Report</jndi-name>
              </weblogic-enterprise-bean>
              </weblogic-ejb-jar>
              ~b

    1. yes
              <JMSConnectionFactory AllowCloseInOnMessage="false"
              DefaultDeliveryMode="Persistent" DefaultPriority="4"
              DefaultTimeToLive="0"
              JNDIName="xlink.jms.factory.commerceFactory"
              MessagesMaximum="10" Name="xlink.jms.factory.commerceFactory"
              OverrunPolicy="KeepOld" Targets="bluej,biztalk-lab,devtestCluster"/>
              2. No I am just using the jndi name of the queue.
              This is an example of how I send a message:
                   Context ctx = new InitialContext();
              QueueConnectionFactory qconFactory;
              QueueConnection qcon;
              QueueSession qsession;
              QueueSender qsender;
              Queue queue;
              ObjectMessage msg;
              qconFactory = (QueueConnectionFactory) ctx.lookup("xlink.jms.factory.commerceFactory");
              qcon = qconFactory.createQueueConnection();
              qsession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
              queue = (Queue) ctx.lookup("xlink.jms.queue.biztalk-lab.OrdrspImport");
              qsender = qsession.createSender(queue);
              msg = qsession.createObjectMessage(reportExecutorContainer);
              qcon.start();
              qsender.send(msg);
              qsender.close();
              qsession.close();
              qcon.close();
              3. I don't know those setting (wl 6.1sp7)

  • When someone other than myself downloads an image from my web album, a dynamically generated file name replaces the original file name.  How I can prevent the original file name being replaced during the downloading process?

    When someone other than myself downloads an image from my web album, a dynamically generated file name replaces the original file name.  How I can prevent the file name being changed during this downloading process?

    Hi Glenyse,
    Here are my steps.
    1.  I upload multiple image (jpg) files onto my photo album.
    2.  I select the "sharing" by email option for this album.
    3.  I enter the recipient's email address.
    4.  The recipient receives my message and clicks on the link.
    5.  The recipient accesses my photo album and clicks on one of the images.
    6.  The image opens up to its own screen.
    7.  The recipient selects the "download" and then save file option.
    Here is the part I do not understand.  For some reason, during this "download" process, the original name which I have given to the file is replaced by different name.  So I was hoping that someone knows how to prevent the file name from being changed during the "download and save" process.
    Much appreciated if you can help me find a solution to this problem.
    Mary  

Maybe you are looking for