Package my own beans in a jar

Hi,
I developped a few javabeans and i would like to package them into a jar to make these javabeans available to several applications.
myBeans.jar is located in C:\lib\ and contains :
com
---mycompany
-----businessBeans
--------xxx.class
-----technicalBeans
--------yyy.class
META-INF
---MANIFEST.MF
I added "C:\lib\myBeans.jar" to the classpath and in a java class I do:
import com.mycompany.technicalBeans.yyy;I get the following error message : the package com.mycompany.technicalBeans does not exist.
Please help :)

Usually IDE's and compile tools (ANT) override classpath settings when compiling java files.
You should add your jar to a library, if you use an IDE like JBuilder or add teh jar to a script file, if you use ANT.
If you just add it to system variable CLASSPATH that wont work.
best regards,
Maris Orbidans
SCJP SCWCD SCBCD

Similar Messages

  • Do JNDI look up for entity beans from a session bean  in different  jars

    I have a problem doing entity beans JNDI look up from a session bean which is deployed
    as a separate package (session.jar) from the entity beans (entity.jar)
    I believe if both session bean and entity beans are deployed into one jar and
    I specify ejb-local-reference-description for session bean, it should work. However,
    due to some reason, they have to be in separated packages but still in the same
    container. Then question how to do JNDI lookup given entity beans only have local
    interfaces?
    FYI.
    1 both session.jar and entity.jar are self-contained. i.e., no deployment error.
    each JNDI name can be viewed from JNDI tree
    2. weblogic-ejb-jar.xml for session.jar
    <weblogic-ejb-jar>
    <description><![CDATA[Generated by XDoclet]]></description>
    <weblogic-enterprise-bean>
    <ejb-name>PetstoreLogic</ejb-name>
    <stateless-session-descriptor>
    </stateless-session-descriptor>
    <reference-descriptor>
    </reference-descriptor>
    <jndi-name>PetstoreLogic</jndi-name>
    <local-jndi-name>PetstoreLogicLocal</local-jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    3. weblogic-ejb-jar.xml (code snip) for entity.jar
    <weblogic-enterprise-bean>
    <ejb-name>Account</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>
    <reference-descriptor>
    </reference-descriptor>
    <local-jndi-name>net.sourceforge.cpetstore/AccountLocalHome</local-jndi-name>
    </weblogic-enterprise-bean>
    4. if I do
    accountLocalHome = (AccountLocalHome) ic.lookup("net/sourceforge/cpetstore/AccountLocalHome");
    get error like:
    javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundException:
    While trying to look up /app/ejb/net.sourceforge.cpetstore-entity.jar#Account/local-home
    in /app/ejb/cpetstore-ejb.jar#PetstoreLogic.; remaining name '/app/ejb/net/sourceforge/cpetstore-entity/jar#Account/local-home'
         at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:869)
         at weblogic.jndi.internal.ApplicationNamingNode.lookup(ApplicationNamingNode.java:150)
         at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:338)

    In weblogic-ejb-jar.xml use jndi-name instead of local-jndi-name in reference-descriptor
    element.
    "Qiming He" <[email protected]> wrote:
    >
    I have a problem doing entity beans JNDI look up from a session bean
    which is deployed
    as a separate package (session.jar) from the entity beans (entity.jar)
    I believe if both session bean and entity beans are deployed into one
    jar and
    I specify ejb-local-reference-description for session bean, it should
    work. However,
    due to some reason, they have to be in separated packages but still in
    the same
    container. Then question how to do JNDI lookup given entity beans only
    have local
    interfaces?
    FYI.
    1 both session.jar and entity.jar are self-contained. i.e., no deployment
    error.
    each JNDI name can be viewed from JNDI tree
    2. weblogic-ejb-jar.xml for session.jar
    <weblogic-ejb-jar>
    <description><![CDATA[Generated by XDoclet]]></description>
    <weblogic-enterprise-bean>
    <ejb-name>PetstoreLogic</ejb-name>
    <stateless-session-descriptor>
    </stateless-session-descriptor>
    <reference-descriptor>
    </reference-descriptor>
    <jndi-name>PetstoreLogic</jndi-name>
    <local-jndi-name>PetstoreLogicLocal</local-jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    3. weblogic-ejb-jar.xml (code snip) for entity.jar
    <weblogic-enterprise-bean>
    <ejb-name>Account</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>
    <reference-descriptor>
    </reference-descriptor>
    <local-jndi-name>net.sourceforge.cpetstore/AccountLocalHome</local-jndi-name>
    </weblogic-enterprise-bean>
    4. if I do
    accountLocalHome = (AccountLocalHome) ic.lookup("net/sourceforge/cpetstore/AccountLocalHome");
    get error like:
    javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundException:
    While trying to look up /app/ejb/net.sourceforge.cpetstore-entity.jar#Account/local-home
    in /app/ejb/cpetstore-ejb.jar#PetstoreLogic.; remaining name '/app/ejb/net/sourceforge/cpetstore-entity/jar#Account/local-home'
         at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:869)
         at weblogic.jndi.internal.ApplicationNamingNode.lookup(ApplicationNamingNode.java:150)
         at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:338)

  • Package javax.faces.bean does not exist

    I am new to JSF. I tried to build a jsf application that runs on glassfish 3. I did not use IDEs.
    When I compile it , I encountered the following 4 errors:
    Error 1: package javax.inject.bean does not exist
    Error 2: package javax.faces.bean does not exist
    Error 3: cannot find symbol : class Named
    @Named<name="user">
    Error 4: cannot find symbol: class SessionScoped
    @SessionScoped.
    Please help me fix these errors.
    Thank you in advance.

    You must also be new to Java if you don't know how to deal with these problems. Do you even know what the classpath is?
    I warn you right now: if you don't know the more advanced features of the Java platform (annotations, packages and the classpath, jar library usage, classloaders) you will basically get nowhere developing web applications - especially using a complex framework like JSF.

  • LOOKUP OF beans between two jar files

    How to lookup beans between two jar file
    I have two jar files named as ejb1.jar , ejb2.jar .
    both the <ejb-name> are same..
    InitialContext ctx = new InitialContext();
    Object te = ctx.lookup("test");
    if i want to lookup for 2nd jar (ejb2.jar)which has the same <ejb-name> how to do..
    helpp !!!!!!!
    prakash

    Hi,
    No it would not be possible to differentiate the data just by using the dump files. You need to import these dump files in the database and then you can compare it for any difference.
    Regards
    Anurag

  • Customising a business component to include my own bean

    How do I include my own bean in a JSP Application containing jsp pages developed using Buisness Component wizard that access Oracle Database.

    You can modify the files in \templates\webapp or \templates\cabowebapp. I would recommend saving the original set prior to making any changes to the template files.

  • [svn:fx-3.x] 7653: updating the package target to include the new jar.

    Revision: 7653
    Author:   [email protected]
    Date:     2009-06-08 15:07:23 -0700 (Mon, 08 Jun 2009)
    Log Message:
    updating the package target to include the new jar.
    QE Notes: None.
    Doc Notes: None.
    tests: checkintests
    Modified Paths:
        flex/sdk/branches/3.x/build.xml

    Hi,
    I did this but it is given an error due to return table so i copy the routine from 3.x and copy in BI 7 start routine, now it is given an error
    E:Within classes and interfaces, you can only use "TYPE" to refer to ABAP Dictionary types, not "LIKE" or "STRUCTURE".
    Could you please help me.
    Thanks

  • Packaging POF object class in a jar file

    I have the following issue packaging a POF class.
    I have two POF classes which are defined in the package oracle.communications.activation.asap.ace;
    1. Token.java
    2. Asdl.java
    For simplicity i package them in the coherence.jar along with the other nessary artifacts.
    "tokens-pof-config.xml"
    <?xml version="1.0"?>
    <pof-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://xmlns.oracle.com/coherence/coherence-pof-config"
    xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-pof-config coherence-pof-config.xsd">
    <user-type-list>
    <!-- coherence POF user types -->
    <include>coherence-pof-config.xml</include>
    <!-- com.tangosol.examples package -->
    <user-type>
    <type-id>1001</type-id>
    <class-name>Token</class-name>
    </user-type>
    <user-type>
    <type-id>1002</type-id>
    <class-name>Asdl</class-name>
    </user-type>
    </user-type-list>
    <allow-interfaces>true</allow-interfaces>
    <allow-subclasses>true</allow-subclasses>
    </pof-config>
    Then I startup the CacheServer it startsup fine. However when I invoke the POF classes from my weblogic artifacts I get the following error message.
    <Oct 26, 2011 10:04:24 PM PDT> <Warning> <EJB> <BEA-010065> <MessageDrivenBean threw an Exception in onMessage(). The exception was:
    (Wrapped) java.io.IOException: unknown user type: oracle.communications.activation.asap.ace.Token.
    (Wrapped) java.io.IOException: unknown user type: oracle.communications.activation.asap.ace.Token
    ======================================================================================================================
    If I however define the classes in the default package or no package instead of package oracle.communications.activation.asap.ace;
    Keeping everything else the same everything works fine.
    ====================================================================================
    What do I need to do to make this work if I am packaging my POF classes not in the default package ?

    Hi JK,
    Well i have modified my POF classes since then and now created a package for them before I was just playing around and had them defined in a default package.
    Second Baby steps here, once I get things working by packaging things in the coherence.jar file I will create my own jar artifact and add it to class path. As it is I have classpath issues. ...
    So as I mentioned earlier.
    I created the oracle/communications/activation/asap/ace directory added my two POF classes to it and then repackaged the jar.
    It returns this error!
    2011-10-27 06:48:03.355/4.696 Oracle Coherence GE 3.6.0.4 <Error> (thread=main, member=1): Error while starting service "DistributedCache": (Wrapped) (Wrapped: error configuring class "com.tangosol.io.pof.ConfigurablePofContext") java.lang.NoClassDefFoundError: oracle/communications/activation/asap/ace/Token (wrong name: Token)
    So any ideas ?
    "tokens-pof-config.xml"
    ==============
    <?xml version="1.0"?>
    <pof-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://xmlns.oracle.com/coherence/coherence-pof-config"
    xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-pof-config coherence-pof-config.xsd">
    <user-type-list>
    <!-- coherence POF user types -->
    <include>coherence-pof-config.xml</include>
    <!-- com.tangosol.examples package -->
    <user-type>
    <type-id>1001</type-id>
    <class-name>oracle.communications.activation.asap.ace.Token</class-name>
    </user-type>
    <user-type>
    <type-id>1002</type-id>
    <class-name>oracle.communications.activation.asap.ace.Asdl</class-name>
    </user-type>
    </user-type-list>
    <allow-interfaces>true</allow-interfaces>
    <allow-subclasses>true</allow-subclasses>
    </pof-config>
    cache-server.sh_
    #!/bin/sh
    # This will start a cache server
    # specify the Coherence installation directory
    COHERENCE_HOME=.
    # specify the JVM heap size
    MEMORY=512m
    if [ ! -f ${COHERENCE_HOME}/bin/cache-server.sh ]; then
    echo "coherence.sh: must be run from the Coherence installation directory."
    exit
    fi
    if [ -f $JAVA_HOME/bin/java ]; then
    JAVAEXEC=$JAVA_HOME/bin/java
    else
    JAVAEXEC=java
    fi
    #JAVA_OPTS="-Xms$MEMORY -Xmx$MEMORY -Dtangosol.pof.enabled=true -Dtangosol.pof.config=tokens-pof-config.xml"
    #JAVA_OPTS="-Xms$MEMORY -Xmx$MEMORY -Dtangosol.coherence.clusteraddress=224.3.6.0 -Dtangosol.coherence.clusterport=3059"
    JAVA_OPTS="-Xms$MEMORY -Xmx$MEMORY"
    #JAVA_OPTS="-Xms$MEMORY -Xmx$MEMORY"
    $JAVAEXEC -server -showversion $JAVA_OPTS -cp "$COHERENCE_HOME/lib/coherence.jar:." com.tangosol.net.DefaultCacheServer $1
    Token.java for example (Asdl.java looks very similar)
    ================================
    package oracle.communications.activation.asap.ace;
    import java.io.IOException;
    import java.io.Serializable;
    import com.tangosol.io.pof.PortableObject;
    import com.tangosol.io.pof.PofReader;
    import com.tangosol.io.pof.PofWriter;
    import java.sql.*;
    import java.util.Enumeration;
    * This class represents the domain object Token. This class is also packaged on the classpath
    * for the Cache-Server when it starts up. The Token class implements the PortableObject format.
    * @author Ankit Asthana
    public class Token implements PortableObject {
         * The state associated with a token
         * 1 - Unassigned, 2 - Available, 3 - Reserved, 4 - defunct
         private int state;
         * The network ID associated with each token
         private String neID;
         * Unique Token ID, used to identify Tokens
         private String tokenID;
         * State of the token possible
         public static int TOKEN_AVAILABLE = 2;
         public static int TOKEN_RESERVED = 3;
         * The following are static final indices required for the implementation
         * for a POF object, they have to be sequential in order.
         public static final int TOKENID = 0;
         public static final int STATE = 1;
         public static final int NEID = 2;
         * setter Method for state of the token
         * @param state
         public void setState(int state) {
              this.state = state;
         * getter Method for the state of the token
         * @return
         public int getState() {
              return state;
         * setter Method for the network ID
         * @param neID
         public void setNeID(String neID) {
              this.neID = neID;
         * getter Method for the network ID
         * @return
         public String getNeID() {
              return neID;
         * returns the TokenID for the current token
         * @return
         public String getTokenID() {
              return tokenID;
         * Default Constructor required by POJO's, Do not remove!
         public Token() {
         * This is a utility method and returns the state of the token in a String format using the
         * integer value representing the state of the token passed to it.
         * @param tokenStateInteger
         * @return
         public static String tokenToString(int tokenStateInteger) {
              if (tokenStateInteger == TOKEN_AVAILABLE)
                   return "Available";
              else if (tokenStateInteger == TOKEN_RESERVED)
                   return "Reserved";
              return "Unknown";
         * Parameterized constructor for a token.
         * Can be used to initialize a token with the following parameters
         * @param tokenID: Unique ID representing the Token
         * @param state: The state for the token, by default available
         * @param neID: The network ID this token associates to
         public Token(String tokenID, int state, String neID) {
              this.state = state;
              this.tokenID = tokenID;
              this.neID = "" + neID;
         // ----- PortableObject interface ---------------------------------------
         * The readExternal method is required for the implementation of the POF portableObject.
         * This method is used for serialization purposes
         * {@inheritDoc}
         public void readExternal(PofReader reader) throws IOException {
              tokenID = reader.readString(TOKENID);
              state = Integer.parseInt(reader.readString(STATE));
              neID = reader.readString(NEID);
         * The writeExternal method is required for the implementation of the POF portableObject.
         * This method is used for de-serialization purposes
         * {@inheritDoc}
         public void writeExternal(PofWriter writer) throws IOException {
              writer.writeString(TOKENID, tokenID);
              writer.writeString(STATE, Integer.toString(state));
              writer.writeString(NEID, neID);
    Edited by: 807103 on Oct 27, 2011 8:55 AM
    Edited by: 807103 on Oct 27, 2011 9:00 AM

  • ORA-01722: invalid number when updating a CMP bean, SP10 WebLogic_RDBMS.jar problem?

    Hi guys
    We are having a problem with the migration to WLCS 3.2 SP2 / WLS 5.1 SP10.
    We are moving from WLCS 3.2 and WLS SP6. Our CMP beans generate errors when
    the container tries to update them. They deploy without error though.
    See below for the stack trace
    We use the recommended weblogic driver for our Oracle 8.1.7.0 database. WL
    runs on w2k, and Oracle on Solaris 7.
    Extract from set-environment:
    SET DB_CLASSPATH=
    SET PATH=%PATH%;%WEBLOGIC_HOME%\bin\oci815_8;%WLCS_ORACLE_HOME%\bin
    SET
    SQLPATH=C:\WebLogicCommerceServer3.2\db\oracle816;C:\WebLogicCommerceServer3
    .2\db\oracle816\event;
    Extract from weblogic.properties:
    weblogic.jdbc.connectionPool.commercePool=\
    url=jdbc:weblogic:oracle,\
    driver=weblogic.jdbc.oci.Driver,\
    I made a few experiments, and I noticed that generating the CMP classes
    (with EJBC) with the old WebLogic_RDBMS.jar (from WLS SP6) is working fine.
    Here is what I mean : ejbc uses the library
    c:\weblogic\lib\persistence\WebLogic_RDBMS.jar And this library has changed
    with SP10. However since that change and after rebuilding our jars, all CMP
    entity beans fail to update.
    If I just replace that WebLogic_RDBMS.jar with the previous one (from SP6),
    and without changing anything else, our CMP beans work fine. I did not
    change any driver or xml deployment descriptor.
    One of the generated files in the jar (for our bean
    VisibilityPSWebLogic_CMP_RDBMS.class) differs, and that seems to be the
    cause of the problem.
    I jadded that class and here is a difference I notice:
    OLD, ejbc ran with SP6 WebLogic_RDBMS.jar : visibilitybean.targetCompanyId =
    (BigDecimal)resultset.getObject(5);
    NEW, ejbc ran with SP10 WebLogic_RDBMS.jar : visibilitybean.targetCompanyId
    = resultset.getBigDecimal(5, 35);
    Similar differences for the SETbigdecimal.
    Dunno if that will help, but I'm attaching the 2 jar files with explicit
    names.
    Damn that was long, I hope someone will read it... Thanks for any help on
    this, see stack trace attached below
    Nicolas Lejeune
    Stack trace:
    mer. oct. 03 12:16:22 CEST 2001:<I> <EJB JAR deployment
    C:/WebLogicCommerceServer3.2/lib/foundation.jar> Exception in
    non-transactional EJB invoke:
    java.rmi.UnexpectedException: Unexpected exception in
    com.b2boost.visibility.VisibilityBean.getVisibilityId():
    java.sql.SQLException: ORA-01722: invalid number
    at weblogic.db.oci.OciCursor.getCDAException(OciCursor.java:230)
    at weblogic.jdbcbase.oci.Statement.executeUpdate(Statement.java:980)
    at
    weblogic.jdbc20.pool.PreparedStatement.executeUpdate(PreparedStatement.java:
    47)
    at
    com.b2boost.visibility.VisibilityPSWebLogic_CMP_RDBMS.update(VisibilityPSWeb
    Logic_CMP_RDBMS.java:446)
    at
    com.b2boost.visibility.VisibilityPSWebLogic_CMP_RDBMS.store(VisibilityPSWebL
    ogic_CMP_RDBMS.java:376)
    at
    weblogic.ejb.internal.EntityEJBContext.store(EntityEJBContext.java:192)
    at
    weblogic.ejb.internal.EntityEJBContext.beforeCompletion(EntityEJBContext.jav
    a:227)
    at
    weblogic.ejb.internal.StatefulEJBObject.postInvokeNoTx(StatefulEJBObject.jav
    a:355)
    at
    weblogic.ejb.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:865)
    at
    com.b2boost.visibility.VisibilityBeanEOImpl.getVisibilityId(VisibilityBeanEO
    Impl.java:198)
    at
    com.b2boost.visibility.pipeline.LoadFirstVisibilityRequestPC.process(LoadFir
    stVisibilityRequestPC.java:83)
    at
    com.beasys.commerce.foundation.pipeline.PipelineExecutorImpl.process(Pipelin
    eExecutorImpl.java:193)
    at
    com.beasys.commerce.foundation.pipeline.PipelineExecutorImplEOImpl.process(P
    ipelineExecutorImplEOImpl.java:56)
    at
    com.beasys.commerce.foundation.pipeline.PipelineExecutorImplEOImpl_ServiceSt
    ub.process(PipelineExecutorImplEOImpl_ServiceStub.java:154)
    at
    com.beasys.commerce.webflow.PipelineProcessor.callPipeline(PipelineProcessor
    .java:170)
    at
    com.beasys.commerce.webflow.PipelineProcessor.process(PipelineProcessor.java
    :102)
    at
    com.beasys.commerce.webflow.WebflowAdvisor.handleTarget(WebflowAdvisor.java:
    409)
    at
    com.beasys.commerce.webflow.WebflowAdvisor.processTarget(WebflowAdvisor.java
    :156)
    at
    com.b2boost.framework.B2boostPortalDestinationDeterminer.determineDestinatio
    n(B2boostPortalDestinationDeterminer.java:208)
    at
    com.beasys.commerce.foundation.flow.FlowManager.service(FlowManager.java:438
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :120)
    at
    weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
    l.java:922)
    at
    weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
    l.java:886)
    at
    weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
    Manager.java:269)
    at
    weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:392)
    at
    weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:274)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
    [Visibility_generated_with_SP6_weblogic_rdbms_jar.jar]
    [Visibility_generated_with_SP10_weblogic_rdbms_jar.jar]

    You are using WebLogic jDriver for Oracle which needs exact version of OCI API, that comes with the Oracle client installation. Ensure that you have installed the right Oracle client version. And updated the PATH properly.
    I notice that you have
    bin/oci815_8
    oracle816
    Thsi looks liek the inconsistency in your environment.
    What you need to do is
    1. find oci817_8 and place that in the PATH.
    2. install oracle 817 and use that client and set the ORACLE_HOME environment variable and the PATH properly.
    Try this and see if it helps.
    BTW - WLS 5.1 is EOL

  • Can I deploy the entity bean in different jar files?

    I have an application EAR, which contains several JARs. I have an entity bean A that has relationships with 2 other different entity beans B and C in the same DB. Now, I have to deploy this entity A together with B in AB.jar, and A with C in AC.jar. Both AB.jar and AC.jar are modules of the same application EAR file. They all use the same data sources to the same database, and named by different <ejb-name>.
    I have no problem with deploying the app to WebLogic 8.1. But the JSP page accessing entity A got errors. Sometime, it got error complaining that the container-generated ejbFindAccount mehtod is abstract.
    My questions are,
    Can an entity bean be defined twice in 2 different jars?
    When container load AB.jar and AC.jar, does it generate the finder methods twice?
    I guess there are some name conflicts going on here. What should I do to avoid it?
    Any comments are very much appreciated.

    Thanks for your answer, but how can I use it in connection with relationships?
    <!-- ********************************************************************** -->
    <!-- Relationship: View to FrameworkUser                                             -->
    <!-- ********************************************************************** -->
    <ejb-relation id="View-FrameworkUser">
         <description></description>
         <ejb-relation-name>View-FrameworkUser</ejb-relation-name>
         <ejb-relationship-role>
              <ejb-relationship-role-name>Views-have-FrameworkUser</ejb-relationship-role-name>
              <multiplicity>Many</multiplicity>
              <relationship-role-source>
                   <ejb-name>View</ejb-name>
              </relationship-role-source>
              <cmr-field>
                   <cmr-field-name>frameworkUser</cmr-field-name><!-#- getter/setter -#->
                   <cmr-field-type>java.util.Collection</cmr-field-type>
              </cmr-field>
         </ejb-relationship-role>
         <!-#- *************** -#->
         <ejb-relationship-role>
              <ejb-relationship-role-name>FrameworkUser-has-Views</ejb-relationship-role-name>
              <multiplicity>One</multiplicity>
              <relationship-role-source>
                   <!-#- *******REFERENCE******** -#->
                   <ejb-name>ejb_foo_jar2_ejb.jar#FrameworkUser</ejb-name>
                   <!-#- *******REFERENCE******** -#->
              </relationship-role-source>
         </ejb-relationship-role>
    </ejb-relation>
    ...this obviously doesn't work...
    Do I have to write a new <entity> where I define the referenced entity?

  • WebLogic 12.1.2 fails when injecting extension in jar into bean in same jar

    WebLogic 12.1.2 fails when deploying a web application that contains a jar in which an extension is injected into a bean that resides within that same jar. The following exception is thrown:
    "weblogic.management.DeploymentException: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [SampleExtension] with qualifiers [@Default] at injection point [[field] @Inject private test.ApplicationBean.extension]"
    weblogic.management.DeploymentException: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [SampleExtension] with qualifiers [@Default] at injection point [[field] @Inject private test.ApplicationBean.extension]
      at weblogic.application.internal.BaseDeployment.throwAppException(BaseDeployment.java:123)
      at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:260)
      at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:48)
      at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:165)
      at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
      Truncated. see log file for complete stacktrace
    Caused By: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [SampleExtension] with qualifiers [@Default] at injection point [[field] @Inject private test.ApplicationBean.extension]
      at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:311)
      at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:280)
      at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:143)
      at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:163)
      at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:382)
    The problem can be easily reproduced by a minimal case with the following structure:
    war-root
         WEB-INF
             beans.xml
             lib
                somejar.jar
    And with somejar.jar having the following structure:
    test
        ApplicationBean.java
        SampleExtension.java
    META-INF
        services
            javax.enterprise.inject.spi.Extension
        beans.xml
    ApplicationBean can looks as follows:
    @Named
    @ApplicationScoped
    public class ApplicationBean {
        @Inject
        private SampleExtension extension;
        @Inject
        private BeanManager manager;
        public void myMethod() {
            System.out.println("Extension:" + extension + " Manager:" + manager);
    And SampleExtension can be:
    public class SampleExtension implements Extension {
        public void onBeanDiscovery(@Observes AfterBeanDiscovery beanDiscovery, BeanManager beanManager) {
            out.println("Extension called");
    I published a minimal web application (as Maven multi-module project) that reproduces the case here: https://github.com/arjantijms/inject-extension
    This application runs fine on basically every other Java EE server (tried specifically JBoss EAP 6.1, GlassFish 4.0 and TomEE 1.5.2), but not on WebLogic 12.1.2.
    Note that I'm not really a WebLogic user. I'm an open source library writer who's trying to make our library (OmniFaces) to run on all Java EE implementations. This case is part of a functionality in our upcoming release.

    Hi,
    If it is war then try to apply following  Patch 13893259.
    Regards,
    Kal

  • Packaging and accessing resources in a JAR

    I'm working on an application and I would like to package my resources (icons, about dialog images, splash screen images, release version text, etc.) in the jar file I'm going to distribute for deployment.  I would like to access these resources from the JAR file in my deployed code.  But I would also like them accessible when I'm running the code in my Eclipse IDE.  Is there a way to do this using only one code base?
    My Eclipse project structure is src (folder) which contains my source code, bin (folder) which contains my class files and res (folder) which contains my resource files.
    I am using the javapackager utility to create my deployment JAR and build a self-contained deployment .exe for deploying to Windows.
    Is there a way to have the javapackager build a single JAR file from multiple sources (i.e. my bin and res folders)?  What do I have to do in my code so that the same code can be used to load resources when I'm running in Eclipse and the self-contained deployment?
    Thanks,
    Mike

    The Java Tutorials has several trails for loading resources.
    Retrieving Resources (The Java™ Tutorials >                    Deployment > Java Web Start)
    Use the getResource method to read resources from a JAR file. For example, the following code retrieves images from a JAR file.
    // Get current classloader
    ClassLoader cl = this.getClass().getClassLoader();
    // Create icons
    Icon saveIcon  = new ImageIcon(cl.getResource("images/save.gif"));
    Icon cutIcon   = new ImageIcon(cl.getResource("images/cut.gif"));
    The example assumes that the following entries exist in the application's JAR file:
    •images/save.gif
    •images/cut.gif
    See that last sentence?
    You put what you need in the jar file and then use the 'getResource' methods to load them.

  • Trying to use ProgressBar demo to build own bean

    Hello, I have a working form and I'm experimenting with PJCs. I'm using the progress bar demo as the starting point. My form only shows a grey box; communication with the bean does not seem to work.
    I have added a bean area to my form. I have created jar file with two classes: an LWComponent and a VBean. I have formsweb.cfg ARCHIVE referencing this jar (along with frmall.jar). I have the jar file in the CLASSPATH in the default.env file. The jar exists in the directory referenced in class path (and has permissions to it). I have signed the jar using a modified sign_webutil.sh (it appears to succeed). I have restarted OC4J.
    I have a when-button-pressed trigger set to do this:
    BEGIN
    SET_CUSTOM_PROPERTY('IMAGEVIEWERPJC', 1, 'CLEARALL', 1);     
    SET_CUSTOM_PROPERTY('IMAGEVIEWERPJC', 1, 'APPR_ID', :appraisal.app_id);
    SET_CUSTOM_PROPERTY('IMAGEVIEWERPJC', 1, 'CONNSTR', GET_APPLICATION_PROPERTY(CONNECT_STRING));
    SET_CUSTOM_PROPERTY('IMAGEVIEWERPJC', 1, 'POPIMAGES', 1);
    Message('Should have: ' || :appraisal.app_id || ' Got: ' || GET_CUSTOM_PROPERTY('IMAGEVIEWERPJC', 1, 'APPR_ID'));
    SET_CUSTOM_ITEM_PROPERTY('IMAGEVIEWERPJC', 'CLEARALL', 1);
    SET_CUSTOM_ITEM_PROPERTY('IMAGEVIEWERPJC', 'APPR_ID', :appraisal.app_id);
    SET_CUSTOM_ITEM_PROPERTY('IMAGEVIEWERPJC', 'CONNSTR', GET_APPLICATION_PROPERTY(CONNECT_STRING));
    SET_CUSTOM_ITEM_PROPERTY('IMAGEVIEWERPJC', 'POPIMAGES', 1);
    Message('Should have: ' || :appraisal.app_id || ' Got: ' || GET_CUSTOM_PROPERTY('IMAGEVIEWERPJC', 1, 'APPR_ID'));
    END;
    The bean should should see the POPIMAGES property being set and then use the other information to access a database and display images. But the bean area is always grey.
    The messages show that :appraisal.app_id is "46" (which is correct) and "Got: " is blank(null). So the beans APPR_ID property is not being set.
    I don't seem to be able to communicate with the bean... IF it's even running.
    I'm hoping there is an obvious step that I'm missing. 8-)
    Thank you for any help.

    New development: I modified formsweb.cfg. This time the webutilarchive variable. It now looks like this:
    WebUtilArchive=frmwebutil.jar, jacob.jar, ImageViewerProfile.jar
    After restarting OC4J and hitting the URL, a window popped up and said "downloading libraries"; three progress bars, one after the other, zipped by. Then the pop-up went away.
    Woohoo!
    The java bean area is still grey. And my button still doesn't change anything. And the debug messages I output still show that forms is not able to get/set any of the beans properties.
    But I got a pop-up!! 8-)

  • Want to package a class file and a jar file in main jar file

    hello folks,
    i have a class named launch.class
    and a jar file named First_Sample2.jar
    First_Sample2 is an application that i have made which requires more memory than is generally allocated by the JRE. so, launch.java file just contains code to execute the command:
    javaw -Xms128M -Xmx256M -jar " + path + "First_Sample2.jar"
    where path variable refers to a directory which contains First_Sample2.jar
    problem is that the only way i can use this code is by keeping two separate JAR files, one is launch.jar, the other is First_Sample2.jar and then execute launch.jar, which will in turn call First_Sample2.jar (which means I have to provide anyone with 2 separate files if they want to use my application)
    is there any way in which i can combine both these jar files into one?

    Well there is a couple ways you can achieve this, but I am telling you that packaging a JAR within a JAR will not work because classes within the internal JAR will not be recognized on the classpath.
    The easiest way to get the user to run your program with a simple double click would be to hide the two JAR files from them completely, having them reside in a folder somewhere on the user's computer. I would use a batch file (Windows environment) or an .sh file (Unix) that would set up your classpath variable and then call java to execute the main class in your main JAR.
    For instance:
    cd [Where java.exe resides]
    set CLASSPATH=[semi-colon delimited absolute file paths pointing to your two JAR files and any other JAR files that they reference]
    java -cp %CLASSPATH% [main class]
    The user would have access to this batch file, perhaps on their desktop, where they can double click to execute teh program just as if it were an EXE file. This is the best way because it hides the JAR files from the user.
    If you would like to combine the two JAR files however, you would need to extract the contents of the secondary JAR file and then include them in with the contents of the main JAR file. That is the only other way that all classes are visible on the classpath.

  • Builtin package VS own package

    I have created one own AWT package.In my own AWT package cotains methods are same as in built-in AWT package. I am importing built-in awt package also. I am accessing one method .. which package will execute ??? will it execute my own package or buitl-in package??
    Pl. answer the above question.
    Regards & thanks,
    srinivas

    I assume you are talking about classes rather than methods. There's no problem with methods with the same name etc. if they are in different classes.
    It's not a good idea to have more than one version of the same class (including package name) available but, if you do, which one you get depends on the order of items in your classpath.
    You should not be creating your own classes with package names starting with java anyway. If you want to create your own awt use your own package name, then there's no ambiguity.

  • How to get the owning bean given a java object

    Hi, is there any way - for a just-created bean instance - to know on behalf of which bean this object has been created ?
    In other words, going back from the java object to the bean symbolic name, as described in a faces-config managed-bean chunk (just the opposite of resolveVariable) ?

    You want to get the definied managed bean name inside the backing bean?
    If so, call this inside the backing bean: private String getManagedBeanName() {
        String managedBeanName = null;
        HttpServletRequest request =
            (HttpServletRequest) FacesContext
                .getCurrentInstance()
                    .getExternalContext()
                        .getRequest();
        // Lookup bean in request scope.
        Enumeration requestAttributeNames = request.getAttributeNames();
        while (requestAttributeNames.hasMoreElements()) {
            String requestAttribute = (String) requestAttributeNames.nextElement();
            Object object = request.getAttribute(requestAttribute);
            if (this.equals(object)) {
                managedBeanName = requestAttribute;
                break;
        if (managedBeanName == null) {
            // Bean is not in the request scope. Lookup it in session scope.
            Enumeration sessionAttributeNames = request.getSession().getAttributeNames();
            while (sessionAttributeNames.hasMoreElements()) {
                String sessionAttribute = (String) sessionAttributeNames.nextElement();
                Object object = request.getSession().getAttribute(sessionAttribute);
                if (this.equals(object)) {
                    managedBeanName = sessionAttribute;
                    break;
        return managedBeanName;
    }

Maybe you are looking for

  • 890FXA-GD70 Will Not Wake From S3 Sleep

    890FXA-GD70 will not wake from S3 sleep; the power comes back on and the fans run but the video never returns and the system hard locks with a POST code of 22 or 24. Other than this issue the system is rock solid. Windows 7 Ultimate 64 AMD Phenom II

  • HOW TO DELETE A CONDITION TABLE??

    HI DOES ANYONE KNOWS HOW TO DELETE CONDITION TABLE? THANKS

  • Keywords from iPhoto

    I couuld not locate a clear answer in the archives even though I suspect it is there. I transferred my major library from iPhoto to Aperture. No problems. In the keyword file, all the keywords that I use are under an iPhoto triangle, and when clicked

  • How do i download my itunes to my HP Notebook

    how do i download my itunes to my HP Notebook

  • NI-DAQmx 8.8 install failure on Vista x64

    [not sure which board is for NI-DAQmx questions  ...] When installing NIDAQ880f2.exe on 64bit Vista, I get a failure: "The NI-APAL Error Files 1.2.0f0 installation has failed with the following error. Internal Error 2202, C:\Windows\Installer\c0702.m