Weblogic 7 SP2 - problem in ejb-jar.xml

Hi,
I have a problem when trying to move from Weblogic 7 to 7 SP2. In some of our
ejb-jar.xml descriptors we have something like the following:
<!ENTITY ENTITY_PROP SYSTEM "Config/entity_config.txt">
then used this later on in the descriptor:
<env-entry-value>&ENTITY_PROP;</env-entry-value>
In all previous versions this would work fine with the Config directory sat in
the domain directory but when we are trying to move to SP2 the ejb's are failing
at deployment time with errors like:
weblogic.xml.process.XMLParsingException: File "zip://C/bea/user_projects/mydomain/myserver/.wlnotdelete/ScanServer/MkpCodeServerEJB.jar!/META-INF/Config/entity_config.txt"
not found. - with nested exception:
[org.xml.sax.SAXParseException: File "zip://C/bea/user_projects/mydomain/myserver/.wlnotdelete/ScanServer/MkpCodeServerEJB.jar!/META-INF/Config/entity_config.txt"
not found.].....
What has changed? What can I do to solve the problem?
thank you,
Ian

Hi,
Please ignore the previous post. it is a bug in 10.3. Please contact the support and get the patch. The bug no is 8180493. thanks.
-Albert
Edited by: zhao.yong on 2009-6-22 下午11:17

Similar Messages

  • Problem with ejb-jar.xml created with ejbgen.

    Hi! ,
    I m using ejbgen for creating interfaces for my bean nut i m facing a problem which is suppose i have beans in different folders and i m using ejbgen for each folder containing beans.Now the problem is i m using ejbgen under one target in build.xml so wht happens is when ejb-jar.xml is generated it contains entry for the last folder beans and overrides other beans entry in different folder . i need some way so tht ejb-jar.xml keeps appending for every ejbgen is called.
    Thanks in advance....... :-)
    warm regards,
    Sourabh Singh

    My temporary workaround is copy all beans from different directory trees to one temporary directory, and create one FileSet in Ant.
    z.

  • External Entity Problem w/ ejb-jar.xml

    I cannot figure out nor find how to have the ejb-jar.xml refer to external entities
    so that it doesn't get overly large and unmanageable. Note: our "shared-ejb-jar.xml"
    gets converted into "ejb-jar.xml" inside of a deployed shared.jar file.
    The shared-ejb-jar.xml file contains:
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans
    2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'
    <!ENTITY SatelliteExt SYSTEM "satellite-ext.xml">
    ]>
    ........XML code.........
    &SatelliteExt;
    ........XML code.........
    The satellite-ext.xml file is in the same directory and contains the XML to describe
    a single <entity>...</entity>.
    I use ant to compile and receive this error:
    C:\jist\bin\build.xml:74: SAXException while parsing 'shared-ejb-jar.xml'. This
    probably indicates badly-formed XML. Details: Relative URI "satellite-ext.xml";
    can not be resolved without a document URI.
    Any help will be most appreciated.
    -- Guy

    Problem is resolved. Thanks for looking over this thread.
    Regards
    Karthik

  • Ejb-jar.xml DOCTYPE

    Hi,
    When I deploy my application, Weblogic 6.1 validates the ejb-jar.xml against
    the public DTD http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd.
    In the production system, there will be no public internet access from the
    Weblogic server. How do I disable this lookup that required internet access?
    I've tried embedding the dtd or using a SYSTEM reference, but ejbc always
    complains -
    "Error processing 'META-INF/ejb-jar.xml': XML document does not appear to
    contain a properly formed DOCTYPE header"
    Is it possible to embed DTDs or use SYSTEM DTD references in ejb-jar.xml? If
    so, what is the syntax?
    Thanks,
    Manish

    Actually the problem wasn't with the ejb jar, but the web archive.
    Weblogic.xml had the wrong DOCTYPE -
    <!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 6.1.0
    WEB//EN" http://www.bea.com/servers/wls610/dtd/weblogic-web-jar.dtd>
    instead of
    <!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application
    6.0//EN" "http://www.bea.com/servers/wls600/dtd/weblogic-web-jar.dtd>
    Hence the server was trying to look up the url to validate. All works
    without internet access now!
    Cheers,
    Manish
    "Rob Woollen" <[email protected]> wrote in message
    news:[email protected]..
    Actually, ejbc should be using a local copy of the dtd which we ship in
    weblogic.jar. You don't need to do anything to disable the network lookup.
    -- Rob
    Manish Shah wrote:
    Hi,
    When I deploy my application, Weblogic 6.1 validates the ejb-jar.xml against
    the public DTD http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd.
    In the production system, there will be no public internet access from the
    Weblogic server. How do I disable this lookup that required internet access?
    I've tried embedding the dtd or using a SYSTEM reference, but ejbc always
    complains -
    "Error processing 'META-INF/ejb-jar.xml': XML document does not appear to
    contain a properly formed DOCTYPE header"
    Is it possible to embed DTDs or use SYSTEM DTD references in ejb-jar.xml? If
    so, what is the syntax?
    Thanks,
    Manish
    AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
    by Michael Girdley, Rob Woollen, and Sandra Emerson
    http://learnWebLogic.com

  • Ejb-jar.xml for  a file adapter in 710

    Hi,
    we moved our file adapter from 700 to 710. Now there is a problem in ejb-jar.xml. There are entries like this:
    <session>
    <description></description>
    <display-name></display-name>
    <icon/>
    <ejb-name>FileActConversionToSWIFTModuleBean</ejb-name>
    <home>com.sap.aii.af.lib.mp.module.ModuleHome</home>
    <remote>com.sap.aii.af.lib.mp.module.ModuleRemote</remote>
    <local-home>com.sap.aii.af.lib.mp.module.ModuleLocalHome</local-home>
    <local>com.sap.aii.af.lib.mp.module.ModuleLocal</local>
    <ejb-class>com.sapcons.xi.swift.FileActConversionToSWIFTModuleBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    The error messages are like this:
    Bean Interfaces: stateless bean "FileActConversionToSWIFTModuleBean" should have at least one of the following interface pairs: "local" and "local-home", "home" and "remote" or service endpoint interface
    Bean Interfaces: The home interface "com.sap.aii.af.lib.mp.module.ModuleHome" cannot be found in the search path.
    What is wrong? The interfaces ModuleHome etc. seem not to be here any more. Which interfaces should be entered in ejb-jar.xml for release 710?
    Thanks and regards, Marina

    Hi,
    yes, there is a module for file adapter. Some modifications were implemented, too. I can imagine that something was forgotten. It is possible to do the build, to deploy and to test the adapter, even if there are errors in ejb-jar.xml .
    Is there a list which things that changed between 700 and 710? 
    I have these 2 links with useful information:
    [Developing Adapters and Modules|http://help.sap.com/saphelp_nwpi71/helpdata/en/8b/895e407aa4c44ce10000000a1550b0/content.htm ]
    [Javadoc PI 7.1 (Adapter, Module and Mapping Development)|http://help.sap.com/javadocs/pi/SP3/xpi/index.html]
    Is there further information for this topic?
         Thanks and regards, Marina

  • Deployment Plan / weblogic-ejb-jar.xml:  Problem

    Hello,
    I am trying to use a deployment plan to override the principal name in the weblogic-ejb-jar.xml.
    The deployment-plan looks like this (showing only the important sections)
    <variable-definition>
    <variable>
    <name>SecurityRoleAssignment_ejbRole_PrincipalNames_1</name>
    <value>MY PRINCIPAL 1</value>
    </variable>
    </variable-definition>
    <variable-assignment>
    <name>SecurityRoleAssignment_ejbRole_PrincipalNames_1</name>
    <xpath>/weblogic-ejb-jar/security-role-assignment/[role-name="View-Role"]/externally-defined</xpath>
    <operation>replace</operation>
    </variable-assignment>
    The security-role assignment in the weblogic-ejb-jar.xml looks like this:
    <security-role-assignment>
    <role-name>View-Role</role-name>
         <externally-defined/>
    </security-role-assignment>
    I 've tried to override the element-value of <externally-defined> (a valid tag in the weblogic-ejb-jar.xml ) with help of a deployment-plan.
    When trying to deploy my application (which is organised in the directory-structure: inst_dir/APP inst_dir/PLAN
    the following error occurs:
    VALIDATION PROBLEMS WERE FOUND problem: cvc-complex-type.2.4a: Expected element 'principal-name@http://www.bea.com/ns/weblogic/10.0' instead of 'externally-defined@http://www.bea.com/ns/weblogic/10.0' here in element security-role-assignment@http://www.bea.com/ns/weblogic/10.0:
    This has surprised me, as externally-defined is (according to the documentation) a valid tag.
    I have tried to replace <externally-defined> with an empty <principal-name> tag (which works fine when deploying the application), but causes a security exception, when trying to use the EJB.
    Has anybody an idea if there is a workaround for this problem?
    IMHO the Validatio Problem is not justified at this place then why should an otherwise valid weblogic-ejb-jar.xml (when not using a deployment-plan) suddenly become invalid when a deployment plan is used?
    Thanx a lot in advance!
    Edited by: user10672779 on 02.12.2008 04:09

    Hi again,
    I tried it with the weblogic 10 Namespace Declaration but got then this error:
    failed to load java type corresponding to e=weblogic-ejb-jar@http://www.bea.com/ns/weblogic/weblogic-ejb-jar/1.0/weblogic-ejb-jar.xsd
    and following Exception:
    <02.12.2008 20.00 Uhr CET> <Error> <J2EE> <BEA-160197> <Unable to load descriptor D:\exportapps\tb.ear\app\tb_flowcontrol.jar/META-INF/weblogic-ejb-jar.xml of module tb_flowcontrol.jar. The error is weblogic.descriptor.DescriptorException: Unmarshaller failed
    at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:152)
    at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:292)
    at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:260)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(AbstractDescriptorLoader2.java:774)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.createDescriptorBean(AbstractDescriptorLoader2.java:395)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBeanWithoutPlan(AbstractDescriptorLoader2.java:745)
    Caused by: com.bea.xml.XmlException: failed to load java type corresponding to e=weblogic-ejb-jar@http://www.bea.com/ns/weblogic/weblogic-ejb-jar/1.0/weblogic-ejb-jar.xsd
    at com.bea.staxb.runtime.internal.UnmarshalResult.getPojoBindingType(UnmarshalResult.java:329)
    at com.bea.staxb.runtime.internal.UnmarshalResult.determineTypeForGlobalElement(UnmarshalResult.java:296)
    at com.bea.staxb.runtime.internal.UnmarshalResult.determineTypeForGlobalElement(UnmarshalResult.java:306)
    at com.bea.staxb.runtime.internal.UnmarshalResult.determineRootType(UnmarshalResult.java:287)
    at com.bea.staxb.runtime.internal.UnmarshalResult.unmarshalDocument(UnmarshalResult.java:153)
    at com.bea.staxb.runtime.internal.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:65)
    at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:141)
    Searching the net couldn't supply me with another answer as to use the 90 Namespace Declaration again...
    I think I forgot to mention I am using an exploded directory.
    This all seems very strange.
    cheers.

  • Setting dispatch-policy in weblogic-ejb-jar.xml

    We are using Weblogic 8.1 sp2.
    What are we trying to do-
    Use the dispatch policy feature to allocate a new execute queue to a stateless session bean. This is to throttle the usage of this bean.
    Problem(s) definition-
    1. When I deploy the application with compiled EJBs (i.e. after running ejbc) IT WORKS.
    If we deploy without compiling the EJBs IT DOES NOT WORK.
    To be very sure I have already tried removing the EJBCompilerCache every time I restart the server.
    I have made sure that we use the same weblogic.jar that the server uses during the compilation of the EJBs.
    2. In both the cases mentioned above the weblogic-ejb-jar.xml when viewwed from the console does not show the dispatch-policy element.
    Any help with regards to this would be highly appreciated.
    Rgds,
    Amresh

    We are using Weblogic 8.1 sp2.
    What are we trying to do-
    Use the dispatch policy feature to allocate a new execute queue to a stateless session bean. This is to throttle the usage of this bean.
    Problem(s) definition-
    1. When I deploy the application with compiled EJBs (i.e. after running ejbc) IT WORKS.
    If we deploy without compiling the EJBs IT DOES NOT WORK.
    To be very sure I have already tried removing the EJBCompilerCache every time I restart the server.
    I have made sure that we use the same weblogic.jar that the server uses during the compilation of the EJBs.
    2. In both the cases mentioned above the weblogic-ejb-jar.xml when viewwed from the console does not show the dispatch-policy element.
    Any help with regards to this would be highly appreciated.
    Rgds,
    Amresh

  • Problem deploying connector: META-INF/ejb-jar.xml not found in jar file

              Has anyone seen this problem:
              I built Sun's Blackbox implementation and packaged
              it identical to the BlackBoxNoTx.rar included with
              Weblogic's 'jconnector' sample (even using the same
              ra.xml and weblogic-ra.xml). When I try to deploy
              it, the server reports:
              java.io.FileNotFoundException:
              META-INF/ejb-jar.xml not found in jar file
              I have no idea why the server thinks my connector
              is an EJB. If I deploy the BlackBoxNoTx.rar included
              with the sample, everything works without a hitch.
              The only variable that I'm changing in my BlackBoxNoTx.rar
              is that I build the Blackbox classes myself--otherwise,
              the RAR packagings are identical. Any assistance is
              greatly appreciated since I'm banging my head against
              a wall...
              Thanks,
              -jason
              

              I was finally able to resolve this one. On the odd chance that someone else encounters
              the same problem, here's what went wrong:
              My RAR file had two directories: 'META-INF' and 'meta-inf'. The first was created
              by the jar tool and contained the manifest.mf file. The second I created manually
              and it contained my ra.xml and weblogic-ra.xml. When I examined the RAR using
              any tools or I extracted the contents, it looked like it only contained one directory:
              META-INF (because NT is case-insensitive).
              "Jason L" <[email protected]> wrote:
              >
              >Has anyone seen this problem:
              >
              >I built Sun's Blackbox implementation and packaged
              >it identical to the BlackBoxNoTx.rar included with
              >Weblogic's 'jconnector' sample (even using the same
              >ra.xml and weblogic-ra.xml). When I try to deploy
              >it, the server reports:
              >
              >java.io.FileNotFoundException:
              >META-INF/ejb-jar.xml not found in jar file
              >
              >I have no idea why the server thinks my connector
              >is an EJB. If I deploy the BlackBoxNoTx.rar included
              >with the sample, everything works without a hitch.
              >The only variable that I'm changing in my BlackBoxNoTx.rar
              >is that I build the Blackbox classes myself--otherwise,
              >the RAR packagings are identical. Any assistance is
              >greatly appreciated since I'm banging my head against
              >a wall...
              >
              >Thanks,
              >
              >-jason
              

  • Failed to load weblogic-ejb-jar.xml

    Hi,
    I try to deploy an EJB on Weblogic 9.1, but the weblogic-ejb-jar seems to cause this exception :
    ======================================================
    [wlappc] <30 oct. 2006 12 h 13 CET> <Error> <J2EE> <BEA-160187> <weblogic.appc failed to compile your application. Recompile with the -verbose option for more details. Please see the error message(s) below.>
    [wlappc] com.bea.xml.XmlException: failed to load java type corresponding to e=weblogic-ejb-jar@http://www.bea.com/ns/weblogic/910
    [wlappc] at com.bea.staxb.runtime.internal.UnmarshalResult.getPojoBindingType(UnmarshalResult.java:325)
    [wlappc] at com.bea.staxb.runtime.internal.UnmarshalResult.determineTypeForGlobalElement(UnmarshalResult.java:292)
    [wlappc] at com.bea.staxb.runtime.internal.UnmarshalResult.determineTypeForGlobalElement(UnmarshalResult.java:302)
    [wlappc] at com.bea.staxb.runtime.internal.UnmarshalResult.determineRootType(UnmarshalResult.java:283)
    [wlappc] at com.bea.staxb.runtime.internal.UnmarshalResult.unmarshalDocument(UnmarshalResult.java:153)
    [wlappc] at com.bea.staxb.runtime.internal.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:65)
    [wlappc] at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:138)
    [wlappc] at weblogic.descriptor.DescriptorManager.createDescriptor(DescriptorManager.java:271)
    [wlappc] at weblogic.descriptor.DescriptorManager.createDescriptor(DescriptorManager.java:240)
    [wlappc] at weblogic.descriptor.DescriptorManager.createDescriptor(DescriptorManager.java:300)
    [wlappc] at weblogic.application.descriptor.AbstractDescriptorLoader.createDescriptor(AbstractDescriptorLoader.java:344)
    [wlappc] at weblogic.application.descriptor.CachingDescriptorLoader.createDescriptor(CachingDescriptorLoader.java:188)
    [wlappc] at weblogic.application.descriptor.AbstractDescriptorLoader.createDescriptor(AbstractDescriptorLoader.java:328)
    [wlappc] at weblogic.application.descriptor.AbstractDescriptorLoader.getDescriptor(AbstractDescriptorLoader.java:237)
    [wlappc] at weblogic.application.descriptor.AbstractDescriptorLoader.getRootDescriptorBean(AbstractDescriptorLoader.java:217)
    [wlappc] at weblogic.ejb.spi.EjbJarDescriptor.parseWeblogicEjbJarBean(EjbJarDescriptor.java:171)
    [wlappc] at weblogic.ejb.container.dd.xml.DDUtils.processWLEjbJarXMLWithSchema(DDUtils.java:706)
    [wlappc] at weblogic.ejb.container.dd.xml.DDUtils.parseWLDD(DDUtils.java:535)
    [wlappc] at weblogic.ejb.container.dd.xml.DDUtils.createDescriptorFromJarFile(DDUtils.java:358)
    [wlappc] at weblogic.ejb.container.dd.xml.DDUtils.createReadOnlyDescriptorFromJarFile(DDUtils.java:141)
    [wlappc] at weblogic.ejb.container.ejbc.EJBCompiler.parseDescriptors(EJBCompiler.java:1345)
    [wlappc] at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:431)
    [wlappc] at weblogic.application.compiler.AppcUtils.compileEJB(AppcUtils.java:292)
    [wlappc] at weblogic.application.compiler.EJBCompiler.compile(EJBCompiler.java:95)
    [wlappc] at weblogic.application.compiler.flow.AppCompilerFlow.compileInput(AppCompilerFlow.java:113)
    [wlappc] at weblogic.application.compiler.flow.AppCompilerFlow.compile(AppCompilerFlow.java:43)
    [wlappc] at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:55)
    [wlappc] at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
    [wlappc] at weblogic.application.compiler.FlowDriver.run(FlowDriver.java:24)
    [wlappc] at weblogic.application.compiler.Appc.runBody(Appc.java:151)
    [wlappc] at weblogic.utils.compiler.Tool.run(Tool.java:158)
    [wlappc] at weblogic.utils.compiler.Tool.run(Tool.java:115)
    ======================================================
    Here is my weblogic-ejb-jar.xml file :
    ======================================================
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <weblogic-ejb-jar xmlns="http://www.bea.com/ns/weblogic/910"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://www.bea.com/ns/weblogic/910
              http://www.bea.com/ns/weblogic/910/weblogic-ejb-jar.xsd">
    <weblogic-enterprise-bean>
    <ejb-name>MyMDB</ejb-name>
    <message-driven-descriptor>
         <resource-adapter-jndi-name>ActiveMQRA</resource-adapter-jndi-name>
         <connection-factory-jndi-name>myQCF</connection-factory-jndi-name>
    </message-driven-descriptor>
    <resource-description>
    <res-ref-name>jms/factory</res-ref-name>
    <jndi-name>myQCF</jndi-name>
    </resource-description>
    <resource-env-description>
    <resource-env-ref-name>jms/queue</resource-env-ref-name>
    <jndi-name>queue.out</jndi-name>
    </resource-env-description>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    ======================================================
    So, it looks like this problem : http://forums.bea.com/bea/message.jspa?messageID=600018030&tstart=0
    I just need a confirmation :
    - is the "res-ref-name" format incorrect with '/' character ?
    - is the jndi-name format incorrect with '.' character ?
    Else, what is the problem with this DD ?
    Thanks,
    Rudy

    "shubha" <[email protected]> wrote:
    >
    hi ,
    Ejb with ejb-name 'hellobean' in ejb-jar.xml
    should be specified in weblogic-ejb-jar.xml with <weblogic-enterprise-bean></weblogic-enterprise-bean>
    i am having problem in deploying the most simple bean on wls7.0 .
    when i try to open the bean module with the weblogic builder i get the
    following
    message
    weblogic.ejb20.WLDeploymentException: Could not locate bean with ejb-name
    'hellobean'
    in weblogic-ejb-jar.xml
         at weblogic.ejb20.deployer.CompositeMBeanDescriptor.initialize60(CompositeMBeanDescriptor.java:249)
         at weblogic.ejb20.deployer.CompositeMBeanDescriptor.init(CompositeMBeanDescriptor.java:180)
         at weblogic.ejb20.deployer.CompositeMBeanDescriptor.<init>(CompositeMBeanDescriptor.java:171)
         at weblogic.marathon.model.EJBJarCMBean.setup(EJBJarCMBean.java:408)
         at weblogic.marathon.tasks.OpenModuleTask.figureOutModule(OpenModuleTask.java:76)
         at weblogic.marathon.tasks.OpenModuleTask.figureOutModule(OpenModuleTask.java:109)
         at weblogic.marathon.tasks.OpenModuleTask.runBackground(OpenModuleTask.java:64)
         at weblogic.jellybeans.core.task.TaskThread.execute(TaskThread.java:114)
         at weblogic.jellybeans.core.task.TaskThread.run(TaskThread.java:55)
    Could not locate bean with ejb-name 'hellobean' in weblogic-ejb-jar.xml
    Module hello1 descriptors failed to load
    if anyone has come across the same problem and have debugged it please
    help me
    out
    thanks in advance

  • Dynamic jndi-name in weblogic-ejb-jar.xml

    Is there a way to create dynamic (i.e. runtime) jndi-names for EJBs instead of
    (or in addition to) "hard coding" them in the weblogic-ejb-jar.xml file? What
    I'm trying to do is have one WebLogic instance (JVM) host multiple environments
    (our Beta and Training environments) and I simply want to deploy the same .ear
    file twice but have each environment (application - .ear) reference a different
    database schema (jdbc connection pool). I have everything working just fine for
    this scenario except when I define jndi-names for our ejbs. The problem is that
    I am really deploying the same ejbs (jndi-names and actually code base) in each
    applicatoin instance and I get an exception when the WebLogic is trying to deploy
    the second application (.ear) because the jndi-names in it have already been deployed
    by the first application instance. I recieve a jndi error stating that the name
    is already deployed.
    Or is there a better path to go down for what I am trying to do to have one WebLogic
    instance support our beta and training environments? Usually (but not always)
    our code base is the for same for both of these environments, I simply need to
    have each environment use a different database schema.
    Thanks

    A little birdie tells me that BEA does this very thing. Looking at the
    descriptors for WebLogic Portal I see:
    <weblogic-enterprise-bean>
    <ejb-name>LoaderEJB</ejb-name>
    <enable-call-by-reference>True</enable-call-by-reference>
    <jndi-name>${APPNAME}.BEA_content.LoaderHome</jndi-name>
    </weblogic-enterprise-bean>
    Yes, the ${APPNAME} token really is expanded into the J2EE application
    name at deployment time!
    Sincerely,
    Daniel Selman
    Bryan Dixon wrote:
    Rewriting our build process isn't really much of an option for me. Our current
    build process is too complex and time consuming right now to convert to Ant (we
    eventually will do this but not for a while). So are there any other ideas that
    aren't build related?
    Thanks
    "Eric Ma" <[email protected]> wrote:
    You don't need run-time dynamism in JDNI names and it can't be done anyways.
    You
    need token substitution in XML configuration files when building the
    app. If
    you are using Ant for building, then it is a breeze. If not, first convert
    your
    build process to use Ant.
    Also, a single WLS instance hosting multiple environments sounds really
    INTRIGUING
    to me.
    Eric Ma
    "Bryan Dixon" <[email protected]> wrote:
    Is there a way to create dynamic (i.e. runtime) jndi-names for EJBsinstead
    of
    (or in addition to) "hard coding" them in the weblogic-ejb-jar.xml file?
    What
    I'm trying to do is have one WebLogic instance (JVM) host multiple environments
    (our Beta and Training environments) and I simply want to deploy the
    same .ear
    file twice but have each environment (application - .ear) referencea
    different
    database schema (jdbc connection pool). I have everything working just
    fine for
    this scenario except when I define jndi-names for our ejbs. The problem
    is that
    I am really deploying the same ejbs (jndi-names and actually code base)
    in each
    applicatoin instance and I get an exception when the WebLogic is trying
    to deploy
    the second application (.ear) because the jndi-names in it have already
    been deployed
    by the first application instance. I recieve a jndi error stating that
    the name
    is already deployed.
    Or is there a better path to go down for what I am trying to do to have
    one WebLogic
    instance support our beta and training environments? Usually (but not
    always)
    our code base is the for same for both of these environments, I simply
    need to
    have each environment use a different database schema.
    Thanks

  • Sample weblogic-ejb-jar.xml for Resource-ref EJB 3.0

    I am trying to create an MDB that can be re-used under different names.
    @MessageDriven(description = "An MDB that transfers messages from one Queue to another", activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue") })
    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    public class TransferMdb implements MessageListener {
    private static final Logger LOG = Logger.getLogger(TransferMdb.class);
    @Resource(name = "jms/connfactory")
    private ConnectionFactory connectionFactory;
    @Resource(name = "jms/targetDestination")
    private Queue targetDestination;
    <ejb-jar version="3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_3_0.xsd">
    <enterprise-beans>
    <message-driven>
    <ejb-name>TransferMdb</ejb-name>
    <ejb-class>TransferMdb</ejb-class>
    </message-driven>
    </enterprise-beans>
    </ejb-jar>
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>TransferMdb</ejb-name>
    <message-driven-descriptor>
    <pool>
    <max-beans-in-free-pool>200</max-beans-in-free-pool>
    <initial-beans-in-free-pool>5</initial-beans-in-free-pool>
    </pool>
    <destination-jndi-name>test_queue</destination-jndi-name>
    <transaction-descriptor>
    <trans-timeout-seconds>20</trans-timeout-seconds>
    </transaction-descriptor>
    </message-driven-descriptor>
    <reference-descriptor>
    <resource-description>
    <res-ref-name>jms/connectionfactory</res-ref-name>
    <jndi-name>connectionfactory</jndi-name>
    </resource-description>
    <resource-description>
    <res-ref-name>jms/targetDestination</res-ref-name>
    <jndi-name>reply_queue</jndi-name>
    </resource-description>
    </reference-descriptor>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    However when I deploy the above, I get exceptions such as:
    problem: cvc-complex-type.2.4a: Expected elements 'initial-context-factory@http://www.bea.com/ns/weblogic/weblogic-ejb-jar provider-url@http://www.bea.com/ns/weblogic/weblogic-ejb-jar connection-factory-jndi-name@http://www.bea.com/ns/weblogic/weblogic-ejb-jar jms-polling-interval-seconds@http://www.bea.com/ns/weblogic/weblogic-ejb-jar jms-client-id@http://www.bea.com/ns/weblogic/weblogic-ejb-jar generate-unique-jms-client-id@http://www.bea.com/ns/weblogic/weblogic-ejb-jar durable-subscription-deletion@http://www.bea.com/ns/weblogic/weblogic-ejb-jar max-messages-in-transaction@http://www.bea.com/ns/weblogic/weblogic-ejb-jar distributed-destination-connection@http://www.bea.com/ns/weblogic/weblogic-ejb-jar use81-style-polling@http://www.bea.com/ns/weblogic/weblogic-ejb-jar init-suspend-seconds@http://www.bea.com/ns/weblogic/weblogic-ejb-jar max-suspend-seconds@http://www.bea.com/ns/weblogic/weblogic-ejb-jar security-plugin@http://www.bea.com/ns/weblogic/weblogic-ejb-jar' instead of 'transaction-descriptor@http://www.bea.com/ns/weblogic/weblogic-ejb-jar' here in element message-driven-descriptor@http://www.bea.com/ns/weblogic/weblogic-ejb-jar:<null>
    problem: cvc-complex-type.2.4a: Expected elements 'transaction-descriptor@http://www.bea.com/ns/weblogic/weblogic-ejb-jar iiop-security-descriptor@http://www.bea.com/ns/weblogic/weblogic-ejb-jar resource-description@http://www.bea.com/ns/weblogic/weblogic-ejb-jar resource-env-description@http://www.bea.com/ns/weblogic/weblogic-ejb-jar ejb-reference-description@http://www.bea.com/ns/weblogic/weblogic-ejb-jar service-reference-description@http://www.bea.com/ns/weblogic/weblogic-ejb-jar enable-call-by-reference@http://www.bea.com/ns/weblogic/weblogic-ejb-jar network-access-point@http://www.bea.com/ns/weblogic/weblogic-ejb-jar clients-on-same-server@http://www.bea.com/ns/weblogic/weblogic-ejb-jar run-as-principal-name@http://www.bea.com/ns/weblogic/weblogic-ejb-jar create-as-principal-name@http://www.bea.com/ns/weblogic/weblogic-ejb-jar remove-as-principal-name@http://www.bea.com/ns/weblogic/weblogic-ejb-jar passivate-as-principal-name@http://www.bea.com/ns/weblogic/weblogic-ejb-jar jndi-name@http://www.bea.com/ns/weblogic/weblogic-ejb-jar local-jndi-name@http://www.bea.com/ns/weblogic/weblogic-ejb-jar dispatch-policy@http://www.bea.com/ns/weblogic/weblogic-ejb-jar remote-client-timeout@http://www.bea.com/ns/weblogic/weblogic-ejb-jar stick-to-first-server@http://www.bea.com/ns/weblogic/weblogic-ejb-jar' instead of 'reference-descriptor@http://www.bea.com/ns/weblogic/weblogic-ejb-jar' here in element weblogic-enterprise-bean@http://www.bea.com/ns/weblogic/weblogic-ejb-jar:<null>
    at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:234)
    at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:221)
    at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:146)
    at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:306)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(AbstractDescriptorLoader2.java:788)
    Truncated. see log file for complete stacktrace
    I am clearly missing items in the weblogic-ejb-jar.xml. If anyone has a sample or tips, that would be awesome as a starting point.

    Those tags just declare that you are using our CMP provider and that
    your descriptor is in META-INF/weblogic-cmp-rdbms-jar.xml.
    FWIW, you might also want to check out EJBGen. It tends to keep more up
    to date with WLS than xdoclet.
    -- Rob
    Gen wrote:
    I am using xdoclets to generate descriptor file weblogic-ejb-jar.xml
    for a BMP entity bean. Xdoclet is generating the descriptor file
    alright, but is putting the following extra tags. This happens even
    for samples which come with the download, so my tags in java file are
    not wrong.
    My question is, are the extra tags below harmless, or should I
    manually go to each desciptor file and remove them?
    Thanks.
    ----------- EXTRA TAGS GENERATED START ---------
    persistence> <persistence-type>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>6.0</type-version>
    <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
    </persistence-type>
    <persistence-use>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>6.0</type-version>
    </persistence-use>
    </persistence>
    ----------- EXTRA TAGS GENERATED END ---------
    ----------- TAGS I PUT IN JAVA CLASS START --------
    * @ejb:bean name="com.ejb.entity.Customer"
    * jndi-name="com.ejb.entity.CustomerHome"
    * view-type="remote"
    * type="BMP"
    * primkey-field="com.ejb.entity.CustomerPK"
    * reentrant="false"
    * @weblogic:cache
    * max-beans-in-cache="1000"
    * read-timeout-seconds="900"
    * concurrency-strategy="ReadOnly"
    ----------- TAGS I PUT IN JAVA CLASS END --------

  • "Could not locate the bean with the ejb-name XYZ in weblogic-ejb-jar.xml

    Hi,
    Please someone help me on this...
    I'm trying to deploy an application on WLS 8.1 SP4
    on HPUX IA64 arch. From the ear file WLS is able to
    deploy 3 jars but for the last two jars it's throwing
    the below error:
    Could not locate the bean with the ejb-name xyz in weblogic-ejb-jar.xml
    But ejb with name xyz is defined in the the weblogic-ejb-jar.xml file and it's also present in the
    META-INF/ejb-jar.xml file.
    I have no clue what's going wrong.
    Any help is appreciated.
    Thanks
    Mouli

    oops! Pls ignore my previous mail. It was for a different problem.
    FOr the original problem of "couldn ot locate the bean with the ejb-name XZY in weblogic-ejb-jar.xml":
    This happens if you don't have the below files defined
    for a JAR/EAR file:
    weblogic-ejb-jar.xml and weblogic-cmp-rdbms-jar.xml (needed if you have any Datasource mapped)
    These two are basic files required for any JAR/EAR file.
    If you dont' have it already you can generate them using
    $WLS_HOME/bin/startWLBuilder.sh GUI tool bundled along
    with WLS (I used 8.1 SP4) to generate these files ! This tool is really helpful.
    - Mouli

  • Disable-warning statement in weblogic-ejb-jar.xml

    I'm having problems with the <disable-warning> statement in the weblogic-ejb-jar.xml file. I havn't been able to find documentation on exactly where the statment is supposed to be placed, as all sites just say to include the statement in your weblogic-ejb-jar.xml file. I found a working solution where I placed the statement after declaring all the weblogic-enterprise-bean and right before the closing </weblogic-ejb-jar> statment.
    Now the problem is that I have included a <transaction-isolation> block and weblogic complains about my disable warning statment.
    Does anyone know the proper location for the <disable-warning> statement?
    here is the format that was working before:
    </weblogic-enterprise-bean>
         <disable-warning>BEA-010054</disable-warning>
    </weblogic-ejb-jar> now I have:
    </weblogic-enterprise-bean>
       <transaction-isolation>
              <isolation-level>TRANSACTION_READ_COMMITTED</isolation-level>
              <method>
              </method>
       </transaction-isolation>
       <disable-warning>BEA-010054</disable-warning>
    </weblogic-ejb-jar>I have tried putting the disable warning before the transaction-isolation and after and weblogic complains about both.
    Any Ideas?
    Thanks for your time.

    I have tried putting the disable warning beforethe
    transaction-isolation and after and weblogic
    complains about both.
    Any Ideas?It would be a good idea to post the message weblogic
    is displaying. There are a couple of things you could
    check:
    * As per the documentation, the <disable-warning> tag
    was added in 8.1. Check if you are using the correct
    DTD for Weblogic 8.1 (and the version of Weblogic
    is 8.1 or higher
    * As per the DTD, the <disable-warning> comes after
    the <transaction-isolation>
    <!ELEMENT weblogic-ejb-jar (description?,
    weblogic-enterprise-bean*,
    security-role-assignment*,
    run-as-role-assignment*,
    security-permission?,
    transaction-isolation*,
    idempotent-methods?,
    enable-bean-class-redeploy?,
    disable-warning*)
    ke sure you maintain this order of elements within
    <weblogic-ejb-jar>
    Refer to
    http://e-docs.bea.com/wls/docs81/ejb/DDreference-ejb-j
    ar.htmlYep, it was pointing to an older dtd. Thank you!

  • Application deployment order with weblogic-ejb-jar.xml and jndi-name

    I have two applicatation working on Weblogic server v. 10.3.6.
    First of them creating one ejb stateless bean and creates JNDI maping for it (in weblogic-ejb-jar.xml file):
    <weblogic-enterprise-bean>
         <ejb-name>ConfigMenegerBean</ejb-name>
         <stateless-session-descriptor>
         <stateless-session-descriptor>
              <business-interface-jndi-name-map>
              <business-remote>package.ConfigurationSessionRemote</business-remote>
              <jndi-name>ConfigMeneger</jndi-name>
              </business-interface-jndi-name-map>
         </stateless-session-descriptor>
         <enable-call-by-reference>true</enable-call-by-reference>
         <jndi-name>ConfigMeneger</jndi-name>
    </weblogic-enterprise-bean>
    Second appication have to refer for this bean by JNDI using spring been lookup :
    <jee:jndi-lookup id="configManager" jndi-name="ConfigMeneger"/>
    I changed deployment order parameter for both apllication(first=100 and second=500) in order to first app start first and share bean by jndi to another application. Unfortuantelly I got an error :
    javax.naming.NameNotFoundException: Unable to resolve 'ConfigMeneger'. Resolved ''; remaining name 'ConfigMeneger'
    How can I configure deployment order that first application make jndi mapping for bean, before the second application will use it ?

    Ok in a way I have solved my problem (even if I am not completely satisfied by the way on how to proceed...). So thanks to message "JBuilder7.0 and Weblogic6.1" on EJB sun forum :
    http://forum.java.sun.com/thread.jsp?thread=285735&forum=13&message=1255488
    I have tried the following actions (mentionned in the other forum messages):
    - To preserve changes to weblogic*.xml, the safest way is to change the ejb-borland.xml.
    (I am not sure that I have applied this advice correctly, because I suppose that syntax is not similar in weblogic file or borland file).
    And you can MANUALLY update the weblogic file in your JAR archive.
    1. Open the EJB JAR file in Winzip and extract the weblogic-ejb-jar.xml file, so that a copy exists in your
    project directory.
    2. Open this file (in Notepad), add the WebLogic specific information, and then save the file.
    3. Now, when you are finished with the build cycle and are ready to deploy, you may open the EJB jar file
    and swap in the weblogic-ejb-jar.xml file."
    Good Luck.

  • Please check this ejb-jar.xml, weblogic-ejb-jar.xml,weblogic-cmp-rdbms.xml

    i am getting a classcast exception.My Stateless and stateful session bean works
    fine .. problem only with Entity bean. Please check these xml files and let me
    know if i have missed anything.
    ejb-jar.xml
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans
    2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <enterprise-beans>
    <entity>
    <ejb-name>stores</ejb-name>
    <home>Ejb.Stores.storesHome</home>
    <remote>Ejb.Stores.storesRemote</remote>
    <ejb-class>Ejb.Stores.storesBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>storesBean</abstract-schema-name>
    <cmp-field>
    <field-name>productId</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>descrip</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>price</field-name>
    </cmp-field>
    <primkey-field>productId</primkey-field>
    <query>
    <query-method>
    <method-name>findPriceGreaterThan</method-name>
    <method-params>
    <method-param>double</method-param>
    </method-params>
    </query-method>
    <ejb-ql>
    <![CDATA[SELECT OBJECT(a) FROM storesBean AS a WHERE a.price > ?1]]>
    </ejb-ql>
    </query>
    </entity>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>stores</ejb-name>
         <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    ------------- end of ejb-ar.xml---------------------
    weblogic-jar.xml
    <?xml version="1.0"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN"
    "http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd" >
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>stores</ejb-name>
    <entity-descriptor>
    <persistence>
    <persistence-type>
         <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
         <type-version>6.0</type-version>
         <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
         </persistence-type>
         <persistence-use>
         <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
         <type-version>6.0</type-version>
         </persistence-use>
    </persistence>
    </entity-descriptor>
    <jndi-name>storesEntity</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    ------------- end of weblogic-jar.xml----------
    weblogic-cmp-rdbms-jar.xml
    <!DOCTYPE weblogic-rdbms-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 6.0.0
    EJB RDBMS Persistence//EN' 'http://www.bea.com/servers/wls600/dtd/weblogic-rdbms20-persistence-600.dtd'>
    <weblogic-rdbms-jar>
    <weblogic-rdbms-bean>
    <ejb-name>stores</ejb-name>
    <data-source-name>sqlTX</data-source-name>
    <table-name>ProductEJBTable</table-name>
    <field-map>
    <cmp-field>productId</cmp-field>
    <dbms-column>productId</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>descrip</cmp-field>
    <dbms-column>descrip</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>price</cmp-field>
    <dbms-column>price</dbms-column>
    </field-map>
    </weblogic-rdbms-bean>
    <create-default-dbms-tables>false</create-default-dbms-tables>
    </weblogic-rdbms-jar>
    ---------------- end of weblogic-cmp-rdbms-jar.xml----------
    Do i have to mention the connection Pool name anywhere .. My connection Pool name
    is sql7Pool and my datasource name which i have mentioned is sqlTx. I am using
    Sql server 7. I am deploying a jar file(not a war file) and accessng the EJB through
    a Servlet. Please any help would definitely be appreciated.
    Cheers
    Ashish.

    I thought you were getting a class cast exception but the stack trace shows
    a NullPointerException on line 38 of your servlet code. I am not sure if the
    code that you have attached is the complete code or just snippets of your
    complete code. Anyways, counting 38 lines in the code you attached points to
    the line "mr =
    mh.create(request.getParameter("login"),request.getParameter("name"));"
    which could be because "mh" is null. Can you verify "mh" is not null and
    also "objRef" is not null.
    Attaching the stack trace for ClassCastException would be useful.
    -- Anand
    "Ashish Suvarna" <[email protected]> wrote in message
    news:[email protected]...
    >
    Hey Anand,
    Thanks for your reply. I have attached the StackTrace,Servlet code andmy
    location and settings of my servlet .
    This is the StackTrace which i get :
    pl.java:265)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:200)
    atweblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:2495)
    atweblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2204)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    before create
    java.lang.NullPointerException
    at trialweblogic.webServlet.doGet(webServlet.java:38)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:265)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:200)
    atweblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:2495)
    atweblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2204)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    -------------- end of StackTrace---------------------
    My Servlet Code is
    package trialweblogic;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import java.sql.*;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    import javax.ejb.ObjectNotFoundException;
    import javax.ejb.DuplicateKeyException;
    import javax.ejb.EJBException;
    import java.rmi.RemoteException;
    import java.rmi.Remote;
    import trialweblogic.*;
    public class webServlet extends HttpServlet {
    masterHome mh;
    masterRemote mr;
    OutputStream out;
    private static final String CONTENT_TYPE = "text/html";
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    public void doGet(HttpServletRequest request, HttpServletResponseresponse)
    throws ServletException, IOException {
    response.setContentType(CONTENT_TYPE);
    PrintWriter out = response.getWriter();
    // out = response.getOutputStream();
    try{
    InitialContext ic = new InitialContext();
    Object objRef = ic.lookup("masterBeanJNDI");
    mh =(masterHome)PortableRemoteObject.narrow(objRef,masterHome.class);
    >
    mr =mh.create(request.getParameter("login"),request.getParameter("name"));
    out.println("after create");
    }catch(Exception ex){
    ex.printStackTrace();
    public void destroy() {
    --------- end of servlet--------------
    I am using Weblogic 6.1. I have included the following in my web.xml filewhich
    is located atC:\bea\wlserver6.1\config\examples\applications\examplesWebApp\WEB-INF
    >
    >
    <servlet>
    <servlet-name>webServlet</servlet-name>
    <servlet-class>trialweblogic.webServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>webServlet</servlet-name>
    <url-pattern>/webServlet/*</url-pattern>
    </servlet-mapping>
    My Servlet is located atC:\bea\wlserver6.1\config\examples\applications\examplesWebApp\WEB-INF\class
    es\trialweblogic\
    folder. In this folder i also have the supporting files (home,remote &bean tooo).
    >
    >
    I call this servlet when te user submits the info from a JSP page.
    Hope this info helps in solving my problem. Do i have to mention theconnection
    Pool name anywhere in the xml descriptor or am i missing anything here. iguess
    Connection Pool name is not required since we are mentioning the JNDI namein
    the xml descriptor. Bye for now.Awaiting your reply.
    Cheers
    Ashish.
    "Anand Byrappagari" <[email protected]> wrote:
    It is unlikely that your xml descriptors can cause class cast exceptions.
    How did you install the servlet? Can you attach the servlet code that
    might
    help. Also complete stack trace of the exceptions would be helpful.
    -- Anand
    "Ashish Suvarna" <[email protected]> wrote in message
    news:[email protected]...
    Hi Anand,
    Thanks for quic reply.Hey i am using weblogic6.1. I am Not usinga WAR
    and
    ear file.I have created a jar file and deployed it.now i have createda
    servlet
    to access entity bean.Is a war file neccessary for accesing an entitybean
    through
    Servlet or JSP ???I am using sql server 7. The error that it givesis -----
    java.lang.ClassCastException: Cannot narrow remote object<br>
    "inside lookup method aaaaaaa" java.lang.NullPointerException. <br>
    Hope to get ur reply soon. in another entity bean i am getting thiserror ---
    java.lang.ClassCastException:
    weblogic.jdbc.common.internal.RmiDataSource
    .. I
    can't understand wots this error. I feel i am missing something inmy xml
    descriptor.
    Bye for now.
    Cheers
    Ashish.
    "Anand Byrappagari" <[email protected]> wrote:
    Can you attach the stack trace for the exception? Also please describe
    you
    environment - are the war and jar files installed separately? Are
    they
    composed into a ear? Also when are you getting a classcast exception?
    -- Anand
    "Ashish Suvarna" <[email protected]> wrote in message
    news:[email protected]...
    i am getting a classcast exception.My Stateless and stateful sessionbean
    works
    fine .. problem only with Entity bean. Please check these xml filesand
    let me
    know if i have missed anything.
    ejb-jar.xml
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD EnterpriseJavaBeans
    2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <enterprise-beans>
    <entity>
    <ejb-name>stores</ejb-name>
    <home>Ejb.Stores.storesHome</home>
    <remote>Ejb.Stores.storesRemote</remote>
    <ejb-class>Ejb.Stores.storesBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>storesBean</abstract-schema-name>
    <cmp-field>
    <field-name>productId</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>descrip</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>price</field-name>
    </cmp-field>
    <primkey-field>productId</primkey-field>
    <query>
    <query-method>
    <method-name>findPriceGreaterThan</method-name>
    <method-params>
    <method-param>double</method-param>
    </method-params>
    </query-method>
    <ejb-ql>
    <![CDATA[SELECT OBJECT(a) FROM storesBean AS a WHERE
    a.price> >> >>> >> >?1]>
    </ejb-ql>
    </query>
    </entity>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>stores</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    ------------- end of ejb-ar.xml---------------------
    weblogic-jar.xml
    <?xml version="1.0"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD
    WebLogic
    6.0.0 EJB//EN"
    "http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd" >
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>stores</ejb-name>
    <entity-descriptor>
    <persistence>
    <persistence-type>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>6.0</type-version>
    <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
    </persistence-type>
    <persistence-use>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>6.0</type-version>
    </persistence-use>
    </persistence>
    </entity-descriptor>
    <jndi-name>storesEntity</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    ------------- end of weblogic-jar.xml----------
    weblogic-cmp-rdbms-jar.xml
    <!DOCTYPE weblogic-rdbms-jar PUBLIC '-//BEA Systems, Inc.//DTD
    WebLogic
    6.0.0
    EJB RDBMS Persistence//EN'
    'http://www.bea.com/servers/wls600/dtd/weblogic-rdbms20-persistence-600.dt
    d
    <weblogic-rdbms-jar>
    <weblogic-rdbms-bean>
    <ejb-name>stores</ejb-name>
    <data-source-name>sqlTX</data-source-name>
    <table-name>ProductEJBTable</table-name>
    <field-map>
    <cmp-field>productId</cmp-field>
    <dbms-column>productId</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>descrip</cmp-field>
    <dbms-column>descrip</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>price</cmp-field>
    <dbms-column>price</dbms-column>
    </field-map>
    </weblogic-rdbms-bean>
    <create-default-dbms-tables>false</create-default-dbms-tables>
    </weblogic-rdbms-jar>
    ---------------- end of weblogic-cmp-rdbms-jar.xml----------
    Do i have to mention the connection Pool name anywhere .. My
    connection
    Pool name
    is sql7Pool and my datasource name which i have mentioned is sqlTx.I am
    using
    Sql server 7. I am deploying a jar file(not a war file) and accessngthe
    EJB through
    a Servlet. Please any help would definitely be appreciated.
    Cheers
    Ashish.

Maybe you are looking for