Ejb & as400 toolbox jdbc

Anyone having experience with ejb's running in WL4.5.1 on NT using
connection pooling to an AS400 using ibm's java toolbox driver (V4R3) ? Any
special info on the transaction isolation levels ? I'm very interested on
encountered pitfalls and issues in such an environment.
Using TRANSACTION_SERIALIZABLE gives us warnings ("commit level *RR
escalated to *EXC lock") on an update after a select in a BMP (autoCommit is
set to false). These warnings are thrown as exceptions causing a rollback.
Thx,
Bart

Depends.
EJBs are pretty good in distributed, highly transactional environments.
Hibernate is useful if you have large object models, plus other things to consider like lazy loading, caching...
These technologies are basically aimed at removing some of the burden of development in cases like the above ones.
But if you don't feel any burden on your shoulders, then they probably add no value...

Similar Messages

  • Ias support for EJB, JSP/servlets,JDBC, connection pooling, XML, SOAP, load balancing etc

    Please let me know where I can find more information regarding iPlanet usage/deployment/configuring/tuning etc for support of technologies - like EJB, JSP/servlets, JDBC, connection pooling, XML, load balancing, JDBC & Transactions
    (I have already read the 'Getting Started with the iPlanet Application Server' part five and six - http://developer.iplanet.com/appserver/testdrive/partfive.jsp and partsix.jsp)(I am using the ias testdrive version).

    Hi,
    It's difficult to explain unless the J2EE architecture is understood. Also, explaining things like load balancing, Transactions, tuning, are bit vague and could blow the disk space of this site.
    To get started, the best way is to test the sample applications and the best part is you don't require internet connection to follow each steps. Install iWS and iAS, open browser, type in http://hostname:port/ias-samples/index.html. You can find links to the sample applications bundled. Please follow the steps given on deploying the application. This will enable you to a higher level.
    Regards
    Ganesh .R
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support

  • EJB Entity beans ,JDBC Stored procedures

    Hi ,
    I am new to EJB and i have some general questions
    ---Every table in an existing database is an entity bean for my application?
    --- how do i define the queries in the entity bean ? (With PreparedStatement ?)
    ---The persistent fields,the ejbmethods,constructors, the table relationships, the prepared statements and stored procedures, are defined in the entity beans ?
    --- how do i define the primary Keys in an Entity Bean !!! I will use EJB 2.1 and BMP
    thanks in advance ...

    Sandeep...
    I have dblinks going all over the place. What you are talking about is a clustered or distributed database. That is the future (or present ) of large databases. My code is set up because an 'architecture' is not yet available in the database itself to support the concepts I've posted to Steve in other threads.
    I fully believe that we'll eventually have BC4J ( or something like it ) directly in the database. I fully believe that the database will load balance these across a cluster of databases, within the database structure itself. For example... there is NOTHING to stop the JVM from deciding that it needs to load balance and submit the thread to a remote machine for processing... independent of creating a "middle tier" outside the database.
    I believed that client-server model was flawed for most (not all) applications in the 80's. Looking at the "application tier" model I have the same feeling that we're creating an overly complex scheme at the wrong layer... just pushed back one stage so that we have to rewrite everything...
    If you go back to the megalithic server design ( or cluster of servers ) with a thin thin front end... just why is the middle tier needed under the scenario I've outlined?
    As such, stored procedures/triggers be they in java or pl/sql seems best bet to me... seeing's how a call spec to java or a pl/sql wrapper is transparent to the caller using jdbc or any other future technology.
    grin Way outside the scope of the universe today... I see it as inevitable.
    null

  • JDBC Connection to AS400

    I have been trying to connect to AS400 using JDBC, but when I asked the administrator of the AS400 machine for the port to connect, he did not know what I am talking about.
    After trying to connect to all the open ports on the AS400, I am still unable to connect to the AS400 for a connection. Is there any service or software that is needed on the AS400 for me to connect to using JDBC? They are able to connect using ODBC.
    This gets me thinking a little about what port I am connecting when connecting to other databases, or even DB2 in other platform. Does ODBC, JDBC, and the client of the database always connect to the same TCP port?

    I have been trying to connect to AS400 using JDBC,
    but when I asked the administrator of the AS400
    machine for the port to connect, he did not know what
    I am talking about. That's because the driver doesn't require you to specify a port number. Internally it will connect to an AS/400 standard port number, but it doesn't need you or the admin to tell it what that is.
    After trying to connect to all the open ports on the AS400...Instead of doing that, why don't you read the documentation for the driver? I assume you'll be connecting from a non-AS/400 system, so you'll be using the Toolbox driver.

  • JDBC, JMS and EJB transactions - possible problem?

    Hello,
              I am using Oracle 9, Weblogic 8.1 SP 4, MyEclipse and
              XDoclet.
              In my current project I have the following piece of code
              in one of my message driven beans (code cited as pseudocode
              without unnecessary details):
              * @ejb.bean name="MyMessageProcessor"
              * display-name="Display name for a MyMessageProcessor"
              * jndi-name="ejb/MyMessageProcessor"
              * description="Bean MyMessageProcessor"
              * destination-type="javax.jms.Queue"
              * transaction-type="Container"
              * acknowledge-mode="Auto-acknowledge"
              * subscription-durability="Durable"
              * generate="false"
              * @ejb.transaction type="Required"
              public class MyMessageProcessor implements MessageDrivenBean, MessageListener {
              public void onMessage(Message msg) {
                   try {
                        //obtaining connections to two different databases via JNDi
                        java.sql.Connection connOne =
                        ((DataSource)ctx.lookup("DataSourceOne")).getConnection();          
                        java.sql.Connection connTwo =
                             ((DataSource)ctx.lookup("DataSourceTwo")).getConnection();
                        // performing some UPDATEs and INSERTs on connOne and connTwo
                        // calling some other methods of this bean
                        //creating the reply JMS message and sending it to another JMS queue
                        Message msgTwo = this.createReplyMessage(msg)
                        this.queueSender.send(msgTwo);
                        //commiting everything
                        this.queueSession.commit();          
                   } catch (Exception ex) {
                   try {
                        if (this.queueSession!=null) this.queueSession.rollback();
                   } catch (JMSException JMSEx) {};     
                   this.context.setRollbackOnly();
              Some days ago (before the final remarks from my client) there used to be only one DataSource configurated on the basis of the
              connection pool with non-XA jdbc driver. Everything worked fine
              including the transactions (if anything wrong happend not only wasn't the replymessage sent, but also no changes were written
              to database and the incomming message was thrown back to the my bean's
              queue).
              When I deployed the second DataSource I was informed by an error message, that only one non-transactional resource may
              participate in a global transaction. When I changed both datasources
              to depend on underlying datasources with transatcional (XA) jdbc drivers, everything stopped working. Even if
              EJB transaction was theoretically successfully rolledbacked, the changed were written to the database
              and the JMS message wasn't resent to the JMS queue.
              So here are my questions:
                   1. How to configure connection pools to work in such situations? What JDBC drivers should I choose?
                   Are there any global server configurations, which may influence this situation?
                   2. Which jdbc drivers should I choose so that the container was able to rollback the database transactions
                   (of course, if necessary)?
                   3. Are there any JMS Queue settings, which would disable the container to send message back to the
                   queue in case of setRollbackOnly()? How should be the Queue configurated?
              As I am new to the topic and the deadline for the project seems to be too close I would be grateful
              for any help.
              This message was sent to EJB list and JDBC list.
              Sincerely yours,
              Marcin Zakidalski

    Hi,
              I found these information extremely useful and helpful.
              The seperate transaction for sending messages was, of course, unintentional. Thanks a lot.
              Anyway, I still have some problems. I have made some changes to the
              code cited in my previous mail. These changes included changing QueueSessions
              to non-transactional. I also set the "Honorate global transactions" to true.
              I am using XA JDBC driver. After setting "Enable local transactions" to false
              (I did it, because I assume that JDBC transactions should be part on the global
              EJB transaction) I got the following error:
              java.sql.SQLException: SQL operations are not allowed with no global transaction by default for XA drivers. If the XA
              driver supports performing SQL operations with no global transaction, explicitly allow it by setting
              "SupportsLocalTransaction" JDBC connection pool property to true. In this case, also remember to complete the local
              transaction before using the connection again for global transaction, else a XAER_OUTSIDE XAException may result. To
              complete a local transaction, you can either set auto commit to true or call Connection.commit() or Connection.rollback().
              I have also inspected the calls of methods of bean inside of onMessage() method just to check, whether
              the transactions are correctly initialized (using the weblogic.transaction.Transaction class).
              My questions are as follows:
              1. Any suggestions how to solve it? I have gone through the google answers on that problem and only
              thing I managed to realize that JDBC must start its own transaction. Is there any way to prohibit it
              from doing that? Can using setAutocommit(true/false) change the situation for better?
              2. How to encourage the JDBC driver to be a part of EJB transaction?
              3. As I have noticed each of ejb method has its own transactions (transactions have different
              Xid). Each method of the bean has "required" transaction attribute. Shouldn't it work in such
              way that if already started transaction exists it is used by the called method?
              4. The DataSources are obtained in my application via JNDI and in the destination environment I will have slight
              impact on the configuration of WebLogic. What is least problematic and most common WebLogic configuration which would
              enable JDBC driver to participate in the EJB transaction? Is it the WebLogic configuration problem or can it be
              solved programmically?
              Currently my module works quite fine when "enable local transactions" for DataSources is set to true, but this way
              I am loosing the ability to perform all actions in one transaction.
              Any suggestions / hints are more than welcomed. This message was posted to jdbc list and ejb list.
              Marcin

  • DbXplorer IBM iSeries AS400 tables not showing

    Hi all,
    I was hoping to use the JPA generation on our IBM AS400 tables.
    The DbXplorer gets connected to our AS400 over the JT400 Toolbox JDBC type 4.0 driver. All schema's/libraries show.
    However when I open a specific library no tables are shown.
    How come my tables are not showing?
    This is my configuration:
    Driver Class: jt400.jar (Official V5R2, not JTOpen, although I have tried that one to.)
    JDBC Driver Class: com.ibm.as400.access.AS400JDBCDriver
    Database URL: jdbc:as400://SERVERNAME;date format=iso;libraries=*LIBL,FXSARTHUR
    Logging:
    These entries show in the com.m7.nitrox log:
    14-apr-2008 10:39:55 com.m7.wide.eclipse.jstudio.Plugin activate
    INFO: max mem: 748
    14-apr-2008 11:05:50 com.m7.wide.database.preferences.DatabaseDefaults getDriverClassNames
    SEVERE: java.lang.NoClassDefFoundError: com/ibm/sslight/SSLightKeyRing
    14-apr-2008 11:05:50 com.m7.wide.database.preferences.DatabaseDefaults getDriverClassNames
    SEVERE: java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
    14-apr-2008 11:05:51 com.m7.wide.database.preferences.DatabaseDefaults getDriverClassNames
    SEVERE: java.lang.NoClassDefFoundError: com/ibm/as400/ui/framework/java/DataBean

    Hi Arthur,
    The DbXplorer is not tested against AS400 platform. Please open a support case to investigate more into this configuration.
    http://support.bea.com/
    Thanks!

  • ORA-00904 Error while running CMP EJB

    When I am running my CMP bean, I get following error,
    2006-07-02 09:58:17,171 DEBUG org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.AccountBean#fi ndByAccountNumber] Executing SQL: SELECT t0_a.ACCOUNT.UOID FROM ACCOUNT t0_a WHERE (t0_a.ACCOUNT.ACCOUNT_NUMBER = ?)
    2006-07-02 09:58:17,250 ERROR [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.AccountBean#fi ndByAccountNumber] Find failed java.sql.SQLException:
    ORA- 00904: "T0_A"."ACCOUNT"."ACCOUNT_NUMBER": invalid identifier.
    Why is it giving invalide identifier? the length of this identifer is also less then 30 and there are no special characters being used in it.

    I think I have read that you cannot use the "." to navigate through the object, you can only use it for accessing a field of an object (i.e. a column of a table in the DB).
    So, never use more than 1 "." in your requests. In your case, I guess that you need to reformulate the request.

  • What's wrong with this ejb-query?

    Hi people,
    may be i worked too much, may be i've just missed something, but guys, can enyone tell me what the hell is wrong with this GOD DAMNED query?
    <ejb-ql>Select Object(adt) From AddrDataTable AS adt, IN (adt.addresseeQualities) AS aq WHERE adt.season.id = ?1 And aq.aQTemplate.id=?2</ejb-ql>
    That JBoss throws following exception:
    org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement 'Select Object(adt) From AddrDataTable AS adt, IN (adt.addresseeQualities) AS aq WHERE adt.season.id = ?1 And aq.aQTemplate.id=?2'; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "1" at line 1, column 103.
    Was expecting one of:
    "ABS" ...
    "LENGTH" ...
    "LOCATE" ...
    "SQRT" ...
    "+" ...
    <INTEGER_LITERAL> ...
    <FLOATING_POINT_LITERAL> ...
    <NUMERIC_VALUED_PARAMETER> ...
    <NUMERIC_VALUED_PATH> ...
    at org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.<init>(JDBCEJBQLQuery.java:50)
    The worst thing is that when i remove WHERE clause JBoss keeps silence like a fish - it works fine!
    So, any ideas about this?
    Thank you

    Are you sure the ?1 and ?2 parameters exist in the method for which the query is addressed.
    In the statement adt.season.id I guess season is a CMR field and then season has a CMP field called id
    and the same for aq.aQTemplate.id, aQTemplate being the CMR field and the is being a CMP field in the CMR.
    and in adt.addresseeQualities is a CMR field?
    Looks like a complex query
    SELECT OBJECT(adt) from BEAN AS adt,
    IN(adt.CMR_FIELD) AS aq
    WHERE
    adt.ANOTHER_CMR.ANOTHER_AMR_CMP_FIELD=?1
    AND
    aq.2_CMR_FIELD.2_CMP_FIELD =?2

  • Deployed EJB Not Bound

    I deplyed a simple EJB on S17AS. The server.log tells me it is deployed successful.
    CORE3282: stdout: ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@1017ca1
    CORE3282: stdout: ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@9d5793
    LDR5010: All ejb(s) of [simpleEjb] loaded successfully!
    The relevant simpleEjb.jar_verified.txt is as follows
         Test Name : tests.ejb.ias.ASEjbJndiName
         Test Assertion :
         Test Description : PASSED [AS-EJB ejb] : jndi-name is simpleHome
    However, the server log did not indicate the EJB is bound even if I set the log level to finest.
    Therefore when I tried to access it, I get the following error
    Exception in thread "main" javax.naming.NameNotFoundException: No object bound f
    or java:comp/env/ejb/simpleHome
    at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.j
    ava:116)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at HelloClient.main(HelloClient.java:61)
    The client code is as follows
    String JNDIName = "java:comp/env/ejb/simpleHome";
    myGreeterDBHome = (GreeterDBHome) javax.rmi.PortableRemoteObject.narrow(
                   initContext.lookup(JNDIName), GreeterDBHome.class);
    The sun-ejb-jar.xml is as follows
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    Copyright 2002 Sun Microsystems, Inc. All rights reserved.
    -->
    <!DOCTYPE sun-ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 7.0 EJB 2.0//EN' 'http://www.sun.com/software/sunone/appserver/dtds/sun-ejb-jar_2_0-0.dtd'>
    <sun-ejb-jar>
    <enterprise-beans>
    <name>simpleEjb.jar</name>
    <ejb>
    <ejb-name>simpleEJB</ejb-name>
    <jndi-name>simpleHome</jndi-name>
    <is-read-only-bean>false</is-read-only-bean>
                   <bean-pool>
                        <steady-pool-size>2</steady-pool-size>
                        <resize-quantity>5</resize-quantity>
                        <max-pool-size>20</max-pool-size>
                        <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
                   </bean-pool>
    </ejb>
    </enterprise-beans>
    </sun-ejb-jar>
    I tried to use lookup for both "java:comp/env/ejb/simpleHome" and "java:comp/env/simpleHome". None succeed.
    Does anyone know why the ejb is deployed successful but not bound?
    Sha

    Hi, Parsuram,
    I did restart the server and the error is the same.
    Here is the sample code. I did not change them. Only the names in deployment descriptors are modified.
    Below is the info.
    *************************Remote Interface
    Copyright � 2002 Sun Microsystems, Inc. All rights reserved.
    package samples.jdbc.simple.ejb;
    * Remote interface for the GreeterDBEJB. The remote interface defines all possible
    * business methods for the bean. These are the methods going to be invoked remotely
    * by the servlets, once they have a reference to the remote interface.
    * Servlets generally take the help of JNDI to lookup the bean's home interface and
    * then use the home interface to obtain references to the bean's remote interface.
    public interface GreeterDB extends javax.ejb.EJBObject {
    * Returns the greeting String such as "Good morning, John"
         * @return the greeting String
    public String getGreeting() throws java.rmi.RemoteException;
    *************************Home Interface
    Copyright � 2002 Sun Microsystems, Inc. All rights reserved.
    package samples.jdbc.simple.ejb;
    * Home interface for the GreeterDB EJB. Clients generally use home interface
    * to obtain references to the bean's remote interface.
    public interface GreeterDBHome extends javax.ejb.EJBHome {
    * Gets a reference to the remote interface to the GreeterDBBean.
         * @exception throws CreateException and RemoteException.
    public GreeterDB create() throws java.rmi.RemoteException, javax.ejb.CreateException;
    *************************Bean Class
    Copyright � 2002 Sun Microsystems, Inc. All rights reserved.
    package samples.jdbc.simple.ejb;
    import java.util.*;
    import java.io.*;
    * A simple stateless session bean which generates the greeting string for jdbc-simple
    * application. This bean implements the business method as declared by the remote interface.
    public class GreeterDBBean implements javax.ejb.SessionBean {
    private javax.ejb.SessionContext m_ctx = null;
    * Sets the session context. Required by EJB spec.
         * @param ctx A SessionContext object.
    public void setSessionContext(javax.ejb.SessionContext ctx) {
    m_ctx = ctx;
    * Creates a bean. Required by EJB spec.
    public void ejbCreate() {
    System.out.println("ejbCreate() on obj " + this);
    * Removes a bean. Required by EJB spec.
    public void ejbRemove() {
    System.out.println("ejbRemove() on obj " + this);
    * Loads the state of the bean from secondary storage. Required by EJB spec.
    public void ejbActivate() {
    System.out.println("ejbActivate() on obj " + this);
    * Keeps the state of the bean to secondary storage. Required by EJB spec.
    public void ejbPassivate() {
    System.out.println("ejbPassivate() on obj " + this);
    * Required by EJB spec.
    public void GreeterDBBean() {
    * Returns the Greeting String based on the time
    * @return the Greeting String.
    public String getGreeting() throws java.rmi.RemoteException {
    System.out.println("GreeterDB EJB is determining message...");
    String message = null;
    Calendar calendar = new GregorianCalendar();
    int currentHour = calendar.get(Calendar.HOUR_OF_DAY);
    if(currentHour < 12) message = "morning";
    else {
    if( (currentHour >= 12) &&
    (calendar.get(Calendar.HOUR_OF_DAY) < 18)) message = "afternoon";
    else message = "evening";
    System.out.println("- Message determined successfully");
    return message;
    ************************ejb-jar.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    Copyright 2002 Sun Microsystems, Inc. All rights reserved.
    -->
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
    <ejb-jar>
    <enterprise-beans>
    <session>
    <display-name>simple</display-name>
    <ejb-name>simpleEJB</ejb-name>
    <home>samples.jdbc.simple.ejb.GreeterDBHome</home>
    <remote>samples.jdbc.simple.ejb.GreeterDB</remote>
    <ejb-class>samples.jdbc.simple.ejb.GreeterDBBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Bean</transaction-type>
    </session>
    </enterprise-beans>
    </ejb-jar>
    ************************sun-ejb-jar.xml
    <sun-ejb-jar>
    <enterprise-beans>
    <name>simpleEjb.jar</name>
    <ejb>
    <ejb-name>simpleEJB</ejb-name>
    <jndi-name>ejb/simpleHome</jndi-name>
    <is-read-only-bean>false</is-read-only-bean>
                   <bean-pool>
                        <steady-pool-size>2</steady-pool-size>
                        <resize-quantity>5</resize-quantity>
                        <max-pool-size>20</max-pool-size>
                        <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
                   </bean-pool>
    </ejb>
    </enterprise-beans>
    </sun-ejb-jar>
    ************************Assemble Info
    C:\Sun\AppServer7\samples\jdbc\simple\assemble\jar>jar cvf simpleEjb.jar *
    added manifest
    ignoring entry META-INF/
    adding: META-INF/ejb-jar.xml(in = 710) (out= 350)(deflated 50%)
    adding: META-INF/sun-ejb-jar.xml(in = 803) (out= 424)(deflated 47%)
    adding: samples/(in = 0) (out= 0)(stored 0%)
    adding: samples/jdbc/(in = 0) (out= 0)(stored 0%)
    adding: samples/jdbc/simple/(in = 0) (out= 0)(stored 0%)
    adding: samples/jdbc/simple/ejb/(in = 0) (out= 0)(stored 0%)
    adding: samples/jdbc/simple/ejb/GreeterDB.class(in = 210) (out= 168)(deflated 20%)
    adding: samples/jdbc/simple/ejb/GreeterDBBean.class(in = 1441) (out= 734)(deflated 49%)
    adding: samples/jdbc/simple/ejb/GreeterDBHome.class(in = 257) (out= 177)(deflated 31%)
    C:\Sun\AppServer7\samples\jdbc\simple\assemble\jar>jar tf simpleEJB.jar
    META-INF/
    META-INF/MANIFEST.MF
    META-INF/ejb-jar.xml
    META-INF/sun-ejb-jar.xml
    samples/
    samples/jdbc/
    samples/jdbc/simple/
    samples/jdbc/simple/ejb/
    samples/jdbc/simple/ejb/GreeterDB.class
    samples/jdbc/simple/ejb/GreeterDBBean.class
    samples/jdbc/simple/ejb/GreeterDBHome.class
    ******************************** Deployment Info
    server1: Applications: EJB Modules: simpleEjb
    EJB Module Name: simpleEjb
    Location: C:\Sun\AppServer7\domains\domain1\server1\applications\j2ee-modules\simpleEjb_1
    ******************************** simplEJB.jar_verified.txt
    STATIC VERIFICATION RESULTS
         NUMBER OF FAILURES/WARNINGS/ERRORS
         # of Failures : 0
    # of Warnings : 1
         # of Errors : 0
         Test Name : tests.ejb.ias.ASEjbJndiName
         Test Assertion :
         Test Description : PASSED [AS-EJB ejb] : jndi-name is ejb/simpleHome
         WARNINGS :
         Test Name : tests.ejb.businessmethod.BusinessMethodException
         Test Assertion : Enterprise bean business method throws RemoteException test
         Test Description : For [ module_simpleEjb#simpleEjb#simpleEJB ]
    For EJB Class [ samples.jdbc.simple.ejb.GreeterDBBean ] business method [ getGreeting ]
    Error: Compatibility Note: A public business method [ getGreeting ] was found, but EJB 1.0 allowed the business methods to throw the java.rmi.RemoteException to indicate a non-application exception. This practice is deprecated in EJB 1.1 ---an EJB 1.1 compliant enterprise bean should throw the javax.ejb.EJBException or another RuntimeException to indicate non-application exceptions to the Container.
    *********************** server log (no binding info)
    [05/Jan/2003:17:07:19] FINE ( 1760): [EJBClassPathUtils] EJB Class Path for [simpleEjb] is ...
    [C:\Sun\AppServer7\domains\domain1\server1\applications\j2ee-modules\simpleEjb_1, C:\Sun\AppServer7\domains\domain1\server1\generated\ejb\j2ee-modules\simpleEjb]
    [05/Jan/2003:17:07:20] FINE ( 1760): Loading StatelessSessionContainer...
    [05/Jan/2003:17:07:20] FINE ( 1760): [BaseContainer] Registered EJB [simpleEJB] with MBeanServer under name [ias:instance-name=server1,mclass=stateless-session-bean,name=simpleEJB,root=root,standalone-ejb-module=simpleEjb,type=monitor]
    [05/Jan/2003:17:07:20] FINE ( 1760): main: name = "samples.jdbc.simple.ejb._GreeterDBBean_RemoteHomeImpl_Tie", codebase = ""
    [05/Jan/2003:17:07:20] FINE ( 1760): main: name = "samples.jdbc.simple.ejb._GreeterDBHome_Stub", codebase = ""
    [05/Jan/2003:17:07:20] FINE ( 1760): main: name = "samples.jdbc.simple.ejb._GreeterDBHome_Stub", codebase = ""
    [05/Jan/2003:17:07:20] FINE ( 1760): main: name = "samples.jdbc.simple.ejb._GreeterDBBean_EJBObjectImpl_Tie", codebase = ""
    [05/Jan/2003:17:07:20] FINE ( 1760): main: name = "samples.jdbc.simple.ejb._GreeterDB_Stub", codebase = ""
    [05/Jan/2003:17:07:20] FINE ( 1760): [Pool-ejb/simpleHome]: Added PoolResizeTimerTask...
    [05/Jan/2003:17:07:20] FINE ( 1760): Created container with uinque id: 68275827784351744
    [05/Jan/2003:17:07:20] FINE ( 1760): Application deployment successful : com.sun.ejb.containers.StatelessSessionContainer@1083717
    [05/Jan/2003:17:07:20] INFO ( 1760): LDR5010: All ejb(s) of [simpleEjb] loaded successfully!
    [05/Jan/2003:17:07:22] FINE ( 1760): Started 48 request processing threads
    [05/Jan/2003:17:07:22] INFO ( 1760): CORE3274: successful server startup
    [05/Jan/2003:17:07:22] FINE ( 1760): The server is now ready to process requests
    [05/Jan/2003:17:07:22] INFO ( 1760): CORE3282: stdout: ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@10613aa
    [05/Jan/2003:17:07:22] INFO ( 1760): CORE3282: stdout: ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@1f52460
    [05/Jan/2003:17:07:22] INFO ( 1760): CORE5053: Application onReady complete.
    *********************** Client class
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import java.util.Properties;
    import java.util.Hashtable;
    import javax.ejb.*;
    import java.sql.*;
    import javax.sql.*;
    import samples.jdbc.simple.ejb.*;
    public class HelloClient {
         public static void main(String[] args) throws Exception {
    javax.ejb.Handle beanHandle;
    GreeterDBHome myGreeterDBHome;
    GreeterDB myGreeterDBRemote;
    InitialContext initContext = null;
    Hashtable env = new java.util.Hashtable(1);
    initContext = getContextInfo();
    String JNDIName = "java:comp/env/ejb/simpleHome";
    System.out.println("- Looking up: " + JNDIName);
    myGreeterDBHome = (GreeterDBHome) javax.rmi.PortableRemoteObject.narrow(initContext.lookup(JNDIName), GreeterDBHome.class);
    myGreeterDBRemote = myGreeterDBHome.create();
              String theMessage = myGreeterDBRemote.getGreeting();
    myGreeterDBRemote.remove();
         public static InitialContext getContextInfo() {
         InitialContext ctx = null;
         String url = "iiop://1st:3700";
         String fac = "com.sun.enterprise.naming.SerialInitContextFactory";
    try {
         Properties props = new Properties();
         props.put(Context.INITIAL_CONTEXT_FACTORY, fac);
         props.put(Context.PROVIDER_URL, url);
              ctx = new InitialContext(props);
         catch (NamingException ne){
    System.out.println("We were unable to get a connection to " +
    " the application server at " + url);
    ne.printStackTrace();
    return ctx;
    *********************** Running Client from command line
    C:\Sun\AppServer7\samples\jdbc\simple\assemble\jar>java HelloClient
    - Looking up: java:comp/env/ejb/simpleHome
    Exception in thread "main" javax.naming.NameNotFoundException: No object bound for java:comp/env/ejb/simpleHome
    at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:116)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at HelloClient.main(HelloClient.java:34)

  • Database and ejb access in Input Processor, custom Validator

    Hi guys,
    I know the Portal docs recommend that database and ejb calls should be done in
    a Pipeline Component. Are transactions the only concern?
    I'd like to validate two fields. This can be easily accomplished by a an ejb
    method call that returns a boolean for one, and by running a simple select statement
    for the other. Are there any risks to creating custom validator classes to do
    this?
    Thanks

    David,
    Here are the characterstics of Pipelines and IPs:
    Inputprocessors:
    - Web App scope (classloaded by webapp classloader)
    - simple java class
    Pipelines/Pipeline Components:
    - Enterprise App scope (available to all webapps)
    - java class or EJB
    - can be transactional (can even rollback PipelineSession)
    - Pipelines executed from within the EJB container
    There is nothing illegal about putting EJB calls and JDBC calls into an Inputprocessor.
    For simple validation, this is probably okay. However, when doing heavy business
    logic, having the Pipeline manage a single transaction for your PCs is wonderful.
    PJL
    "David Sun" <[email protected]> wrote:
    >
    Hi guys,
    I know the Portal docs recommend that database and ejb calls should be
    done in
    a Pipeline Component. Are transactions the only concern?
    I'd like to validate two fields. This can be easily accomplished by
    a an ejb
    method call that returns a boolean for one, and by running a simple select
    statement
    for the other. Are there any risks to creating custom validator classes
    to do
    this?
    Thanks

  • Status=STATUS_NO_TRANSACTION; - nested throwable: (javax.ejb.EJBException:

    Hi,
    I'm stuck on this problem since 10 days now. Please Please help.
    I'm using Jboss 4.0.5GA and ejb 2.0 While executing the last query after running the ejbStore() of the bean, it breaks,
    The error is below :
    Executing SQL: UPDATE arinpchg SET modified_date=?, doc_num=?, printing_status=? WHERE trx_num=?
    2007-11-29 15:52:55,593 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP1xFieldBridge.au.com.cams.cims.ar.ejb.Charge#modifiedDate] param: i=1, type=TIMESTAMP, value=2007-11-29 15:52:53.14
    2007-11-29 15:52:55,593 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP1xFieldBridge.au.com.cams.cims.ar.ejb.Charge#docNum] param: i=2, type=VARCHAR, value=INV297217
    2007-11-29 15:52:55,593 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP1xFieldBridge.au.com.cams.cims.ar.ejb.Charge#printingStatus] param: i=3, type=INTEGER, value=1
    2007-11-29 15:52:55,593 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP1xFieldBridge.au.com.cams.cims.ar.ejb.Charge#trxNum] param: i=4, type=VARCHAR, value=ARTRX395716
    2007-11-29 15:52:55,734 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackException in method: public abstract au.com.cams.cims.ar.data.PendingChargeResponse au.com.cams.cims.business.ejb.PendingChargeManager.processPendingCharges(au.com.cams.cims.ar.data.PendingChargeRequest,au.com.cams.cims.core.data.DUser) throws au.com.cams.cims.core.util.StoredProcedureFailedException,au.com.cams.cims.core.util.UpdateFailedException,java.rmi.RemoteException, causedBy:
    org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=MEL-LAP-XP-66/59, BranchQual=, localId=59] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.ejb.EJBException: Update failed. Expected one affected row: rowsAffected=0, id=au.com.cams.cims.ar.data.ChargePK@839418b6)
    at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:372)
         at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:501)
         at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:361)
         at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
         at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
         at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
         at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
         at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
         at org.jboss.ejb.Container.invoke(Container.java:954)
         at sun.reflect.GeneratedMethodAccessor108.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
         at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
         at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
         at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)
         at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)
         at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
         at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
         at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
         at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
         at $Proxy508.processPendingCharges(Unknown Source)
         at au.com.cams.cims.ar.cmd.PendingChargeManagerCmdBean.doProcessPendingCharges(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at au.com.cams.cims.core.cmd.AbstractCmdBean.execute(Unknown Source)
         at au.com.cams.cims.core.sys.CIMSCommandBeanManager.doCommandBeanExecute(Unknown Source)
         at au.com.cams.cims.core.sys.CIMSCommandBeanManager.execute(Unknown Source)
         at au.com.singtech.saf.MainServlet.doPost(Unknown Source)
         at au.com.singtech.saf.MainServlet.doGet(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: javax.ejb.EJBException: Update failed. Expected one affected row: rowsAffected=0, id=au.com.cams.cims.ar.data.ChargePK@839418b6
         at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.execute(JDBCStoreEntityCommand.java:169)
         at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.storeEntity(JDBCStoreManager.java:666)
         at org.jboss.ejb.plugins.CMPPersistenceManager.storeEntity(CMPPersistenceManager.java:428)
         at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.storeEntity(CachedConnectionInterceptor.java:273)
         at org.jboss.ejb.EntityContainer.storeEntity(EntityContainer.java:756)
         at org.jboss.ejb.GlobalTxEntityMap$2.synchronize(GlobalTxEntityMap.java:149)
         at org.jboss.ejb.GlobalTxEntityMap$GlobalTxSynchronization.synchronize(GlobalTxEntityMap.java:295)
         at org.jboss.ejb.GlobalTxEntityMap$GlobalTxSynchronization.beforeCompletion(GlobalTxEntityMap.java:345)
         at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1491)
         at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1110)
         at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:324)
    My entityBean:
    * Copyright 2000 by Sing Technologies Pty. Ltd.,
    * Level 11, 269 Wickham Street, Fortitude Valley, Qld 4006, Australia
    * All rights reserved.
    * This software is the confidential and proprietary information
    * of Sing Technologies Pty. Ltd. ("Confidential Information"). You
    * shall not disclose such Confidential Information and shall use
    * it only in accordance with the terms of the license agreement
    * you entered into with Sing Technologies.
    package au.com.cams.cims.ar.ejb;
    import java.sql.*;
    import javax.ejb.*;
    import au.com.cams.cims.ar.data.*;
    import au.com.cams.cims.core.data.*;
    import au.com.cams.cims.core.util.*;
    import au.com.cams.cims.core.ejb.*;
    import au.com.cams.cims.core.app.*;
    import org.apache.log4j.*;
    import javax.naming.*;
    import javax.rmi.*;
    import java.util.*;
    import java.rmi.RemoteException;
    * @stereotype EntityBean
    * @persistence Container
    * @homeInterface au.com.cams.cims.ar.ejb.ChargeHome
    * @remoteInterface au.com.cams.cims.ar.ejb.Charge
    * @primaryKey au.com.cams.cims.ar.ejb.ChargePK
    public class ChargeBean implements EntityBean {
         static private Logger log = Logger.getLogger(ChargeBean.class.getName());
    private static final String datasource = "java:ds/cims";
    private static final String chargeLineRef = "java:comp/env/ejb/au.com.cams.cims.ar.ejb.ChargeLineHome";
    // Used by the isModified extension
    private transient boolean isDirty;
    public boolean isModified() {
    return isDirty;
    /** @field Key VARCHAR(20) CIMSSchema.dbo.arinpchg.trx_num */
    public String trxNum;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.apply_to_num */
    public String applyToNum;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.terms_code */
    public String termsCode;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.fin_chg_code */
    public String finChgCode;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.shipping_code */
    public String shippingCode;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.posting_code */
    public String postingCode;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.tax_code */
    public String taxCode;
    /** @field TIMESTAMP(23) CIMSSchema.dbo.arinpchg.aging_date */
    public Timestamp agingDate;
    /** @field TIMESTAMP(23) CIMSSchema.dbo.arinpchg.due_date */
    public Timestamp dueDate;
    /** @field FLOAT(15) CIMSSchema.dbo.arinpchg.gross_amount */
    public Double grossAmount;
    /** @field FLOAT(15) CIMSSchema.dbo.arinpchg.tax_amount */
    public Double taxAmount;
    /** @field FLOAT(15) CIMSSchema.dbo.arinpchg.tax_included_amount */
    public Double taxIncludedAmount;
    /** @field FLOAT(15) CIMSSchema.dbo.arinpchg.freight_amount */
    public Double freightAmount;
    /** @field FLOAT(15) CIMSSchema.dbo.arinpchg.tax_on_freight_amount */
    public Double taxOnFreightAmount;
    /** @field FLOAT(15) CIMSSchema.dbo.arinpchg.net_amount */
    public Double netAmount;
    /** @field FLOAT(15) CIMSSchema.dbo.arinpchg.paid_amount */
    public Double paidAmount;
    /** @field FLOAT(15) CIMSSchema.dbo.arinpchg.due_amount */
    public Double dueAmount;
    /** @field INTEGER(10) CIMSSchema.dbo.arinpchg.trx_type */
    public Integer trxType;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.doc_num */
    public String docNum;
    /** @field TIMESTAMP(23) CIMSSchema.dbo.arinpchg.doc_date */
    public Timestamp docDate;
    /** @field TIMESTAMP(23) CIMSSchema.dbo.arinpchg.apply_date */
    public Timestamp applyDate;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.debtor_num */
    public String debtorNum;
    /** @field INTEGER(10) CIMSSchema.dbo.arinppyt.trx_status */
    public Integer trxStatus;
    /** @field INTEGER(10) CIMSSchema.dbo.arinppyt.approval_status */
    public Integer approvalStatus;
    /** @field INTEGER(10) CIMSSchema.dbo.arinpchg.printing_status */
    public Integer printingStatus;
    /** @field INTEGER(10) CIMSSchema.dbo.arinpchg.posting_status */
    public Integer postingStatus;
    /** @field INTEGER(10) CIMSSchema.dbo.arinpchg.hold_status */
    public Integer holdStatus;
    /** @field VARCHAR(50) CIMSSchema.dbo.arinpchg.hold_reason */
    public String holdReason;
    /** @field VARCHAR(2000) CIMSSchema.dbo.arinpchg.notes */
    public String notes;
    /** @field VARCHAR(200) CIMSSchema.dbo.arinpchg.message */
    public String message;
    /** @field INTEGER(10) CIMSSchema.dbo.arinpchg.next_sequence_id */
    public Integer nextSequenceId;
    /** @field VARCHAR(100) CIMSSchema.dbo.arinpchg.billing_addressee */
    public String billingAddressee;
    /** @field VARCHAR(50) CIMSSchema.dbo.arinpchg.billing_job_position */
    public String billingJobPosition;
    /** @field VARCHAR(50) CIMSSchema.dbo.arinpchg.billing_addr1 */
    public String billingAddr1;
    /** @field VARCHAR(50) CIMSSchema.dbo.arinpchg.billing_addr2 */
    public String billingAddr2;
    /** @field VARCHAR(50) CIMSSchema.dbo.arinpchg.billing_addr3 */
    public String billingAddr3;
    /** @field VARCHAR(50) CIMSSchema.dbo.arinpchg.billing_locality */
    public String billingLocality;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.billing_state */
    public String billingState;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.billing_postcode */
    public String billingPostcode;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.billing_country */
    public String billingCountry;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.billing_phone_home */
    public String billingPhoneHome;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.billing_phone_business */
    public String billingPhoneBusiness;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.billing_phone_mobile */
    public String billingPhoneMobile;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.billing_phone_car */
    public String billingPhoneCar;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.billing_fax_home */
    public String billingFaxHome;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.billing_fax_business */
    public String billingFaxBusiness;
    /** @field VARCHAR(100) CIMSSchema.dbo.arinpchg.billing_email */
    public String billingEmail;
    /** @field VARCHAR(100) CIMSSchema.dbo.arinpchg.billing_email2 */
    public String billingEmail2;
    /** @field VARCHAR(100) CIMSSchema.dbo.arinpchg.billing_website */
    public String billingWebsite;
    /** @field VARCHAR(100) CIMSSchema.dbo.arinpchg.shipping_addressee */
    public String shippingAddressee;
    /** @field VARCHAR(50) CIMSSchema.dbo.arinpchg.shipping_job_position */
    public String shippingJobPosition;
    /** @field VARCHAR(50) CIMSSchema.dbo.arinpchg.shipping_addr1 */
    public String shippingAddr1;
    /** @field VARCHAR(50) CIMSSchema.dbo.arinpchg.shipping_addr2 */
    public String shippingAddr2;
    /** @field VARCHAR(50) CIMSSchema.dbo.arinpchg.shipping_addr3 */
    public String shippingAddr3;
    /** @field VARCHAR(50) CIMSSchema.dbo.arinpchg.shipping_locality */
    public String shippingLocality;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.shipping_state */
    public String shippingState;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.shipping_postcode */
    public String shippingPostcode;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.shipping_country */
    public String shippingCountry;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.shipping_phone_home */
    public String shippingPhoneHome;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.shipping_phone_business */
    public String shippingPhoneBusiness;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.shipping_phone_mobile */
    public String shippingPhoneMobile;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.shipping_phone_car */
    public String shippingPhoneCar;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.shipping_fax_home */
    public String shippingFaxHome;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.shipping_fax_business */
    public String shippingFaxBusiness;
    /** @field VARCHAR(100) CIMSSchema.dbo.arinpchg.shipping_email */
    public String shippingEmail;
    /** @field VARCHAR(100) CIMSSchema.dbo.arinpchg.shipping_email2 */
    public String shippingEmail2;
    /** @field VARCHAR(100) CIMSSchema.dbo.arinpchg.shipping_website */
    public String shippingWebsite;
    /** @field TIMESTAMP(23) CIMSSchema.dbo.arinpchg.created_date */
    public Timestamp createdDate;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.created_by */
    public String createdBy;
    /** @field TIMESTAMP(23) CIMSSchema.dbo.arinpchg.modified_date */
    public Timestamp modifiedDate;
    /** @field VARCHAR(30) CIMSSchema.dbo.arinpchg.modified_by */
    public String modifiedBy;
    /** @field VARCHAR(20) CIMSSchema.dbo.arinpchg.print_job_num *//*
    public String printJobNum;*/
    * The container assigned reference to the entity
    private EntityContext context;
    * Sets the context of the bean
    * @param ec
    public void setEntityContext(EntityContext ec) {
    context = ec;
    // to do: code goes here.
    * Clears the context of the bean
    public void unsetEntityContext() {
    this.context = null;
    // to do: code goes here.
    * This method is called when the container picks this entity object
    * and assigns it to a specific entity object. Insert code here to
    * acquire any additional resources that it needs when it is in the
    * ready state.
    public void ejbActivate() {
    * This method is called when the container diassociates the bean
    * from the entity object identity and puts the instance back into
    * the pool of available instances. Insert code to release any
    * resources that should not be held while the instance is in the
    * pool.
    public void ejbPassivate() {
    * The container invokes this method on the bean whenever it
    * becomes necessary to synchronize the bean's state with the
    * state in the database. This method is called after the container
    * has loaded the bean's state from the database.
    public void ejbLoad() {
              System.out.println("#### VJ: ChargeBean.ejbLoad()");
    * The container invokes this method on the bean whenever it
    * becomes necessary to synchronize the state in the database
    * with the state of the bean. This method is called before the
    * container extracts the fields and writes them into the database.
    public void ejbStore() {
              System.out.println("#### VJ: ChargeBean.ejbStore()");
    this.isDirty = false;
    updateTotals();
              System.out.println("#### VJ: ChargeBean.context.getPrimaryKey(): " + context.getPrimaryKey().toString());
              System.out.println("#### VJ: ChargeBean.trxNum: " + trxNum);
    * The container invokes this method in response to a client-invoked
    * remove request. Insert code to implement any actions before the
    * bean is removed from the database.
    public void ejbRemove() throws RemoveException {
    public ChargePK ejbCreate(DCharge charge, DUser user)
    throws CreateException {
         System.out.println("#### VJ: ChargeBean.ejbCreate(DCharge, DUser)");
    Connection con = null;
    ChargePK key = new ChargePK();
    if (charge == null)
    throw new CreateException("charge cannot be null");
    if (user == null)
    throw new CreateException("user cannot be null");
    try {
    // set the pk
    con = DatabaseUtilities.getConnection(log, datasource);
    this.trxNum = AppJDBCHelper.getNextTrxNum(con);
    key.trxNum = this.trxNum;
    // set other attributes
    setAttributes(charge);
    // set mod history
    this.createdDate = new Timestamp(new java.util.Date().getTime());
    this.createdBy = user.getUsername();
    this.modifiedDate = new Timestamp(new java.util.Date().getTime());
    this.modifiedBy = user.getUsername();
    } catch (GetNextIdFailedException gnife) {
    log.error("ejbCreate", gnife);
    throw new CreateException(gnife.getMessage());
    } catch (NullPointerException ex1) {
    ex1.printStackTrace();
    log.warn("ejbCreate(): " + ex1);
    throw new CreateException("ejbCreate(): " + ex1);
    } finally {
    if (con != null) DatabaseUtilities.close(con, log, "ejbCreate()");
         //System.out.println("#### VJ: ChargeBean.ejbCreate(DCharge, DUser) context.getPrimaryKey(): " + context.getPrimaryKey().toString());
         System.out.println("#### VJ: ChargeBean.ejbCreate(DCharge, DUser) (ChargeBean) trxNum: " + trxNum);
         System.out.println("#### VJ: ChargeBean.ejbCreate(DCharge, DUser) (ChargePK) key.trxNum: " + key.trxNum);
         System.out.println("#### VJ: ChargeBean.ejbCreate(DCharge, DUser) (DCharge): " + charge.getTrxNum());
    return (key);
    * The container invokes this method after invoking the ejbCreate
    * method with the same arguments.
    * @param charge
    * @param user
    public void ejbPostCreate(DCharge charge, DUser user) {
              System.out.println("#### VJ: ChargeBean.ejbPostCreate(DCharge, DUser)");
    updateTotals();
    isDirty = false;
              System.out.println("#### VJ: ChargeBean.ejbPostCreate(DCharge, DUser) context.getPrimaryKey(): " + context.getPrimaryKey().toString());
              System.out.println("#### VJ: ChargeBean.ejbPostCreate(DCharge, DUser) (ChargeBean) trxNum: " + trxNum);
              System.out.println("#### VJ: ChargeBean.ejbPostCreate(DCharge, DUser) (DCharge): " + charge.getTrxNum());
    * @exception ReadFailedException
    * @return
    public DCharge getDetails()
    throws ReadFailedException {
    DCharge charge = new DCharge();
    try {
    updateTotals();
    charge.setTrxNum(this.trxNum);
    getAttributes(charge);
    DModificationHistory history = new DModificationHistory();
    history.setCreatedDate(this.createdDate);
    history.setCreatedBy(this.createdBy);
    history.setModifiedDate(this.modifiedDate);
    history.setModifiedBy(this.modifiedBy);
    charge.setModificationHistory(history);
    } catch (InvalidDataException ex1) {
    log.warn("getDetails(): " + ex1);
    throw new ReadFailedException("getDetails(): " + ex1.toString());
    } catch (NullPointerException ex2) {
    log.warn("getDetails(): " + ex2);
    throw new ReadFailedException("getDetails(): " + ex2.toString());
    return (charge);
    * @exception ReadFailedException
    * @return
    public DCharge getAllDetails()
    throws ReadFailedException {
    DCharge charge = null;
    try {
    // get non dependant object data
    charge = getDetails();
    // declare and init search home ejbs
    Context ctx = new InitialContext();
    // used for searching
    ChargePK chargePK = new ChargePK();
    chargePK.trxNum = this.trxNum;
                   System.out.println("#### VJ: ChargeBean.getAllDetails() chargePK.trxNum(): " + chargePK.trxNum);
                   System.out.println("#### VJ: ChargeBean.getAllDetails() charge.getTrxNum(): " + charge.getTrxNum());
    // load the charge line items
    try {
    Object obj = ctx.lookup("java:comp/env/ejb/au.com.cams.cims.ar.ejb.ChargeLineSearchHome");
    ChargeLineSearchHome chargeLineSearchHome = (ChargeLineSearchHome) PortableRemoteObject.narrow(obj, ChargeLineSearchHome.class);
    ChargeLineSearch chargeLineSearch = chargeLineSearchHome.create();
    System.out.println("ChargePK: " + chargePK.trxNum);
    charge.setLineItems(chargeLineSearch.searchByCharge(chargePK));
    } catch (NamingException ne) {
    log.warn("getAllDetails(): couldn't lookup ChargeLineSearchHome " + ne.toString());
    } catch (InvalidDataException ide) {
    log.warn("getAllDetails(): couldn't set ChargeLineSearchHome " + ide.toString());
    } catch (SearchFailedException sfe) {
    log.warn("getAllDetails(): search failed " + sfe.toString());
    } catch (CreateException ce) {
    log.warn("getAllDetails(): couldn't create ChargeLineSearchHome " + ce.toString());
    } catch (RemoteException re) {
    log.warn("getAllDetails(): " + re.toString());
    } catch (NamingException ex) {
    log.warn("getAllDetails(): couldn't get an initial context " + ex.toString());
    throw new ReadFailedException("getAllDetails(): " + ex.toString());
    return charge;
    * @param charge
    * @param user
    * @exception UpdateFailedException
    public void setDetails(DCharge charge, DUser user)
    throws UpdateFailedException {
              System.out.println("#### VJ: ChargeBean.setDetails(DCharge, DUser)");
    try {
    // set other attributes
    setAttributes(charge);
    updateTotals();
    // set mod history
    this.modifiedDate = new Timestamp(new java.util.Date().getTime());
    this.modifiedBy = user.getUsername();
    } catch (NullPointerException ex1) {
    log.warn("setDetails(): " + ex1);
    throw new UpdateFailedException("setDetails(): " + ex1.toString());
    * Increments the next sequenceId and returns the current sequenceId (before incrememt)
    * @exception java.rmi.RemoteException
    * @exception UpdateFailedException
    public Integer incNextSequenceId()
    throws UpdateFailedException {
    Integer nextId = null;
    try {
    int current = this.nextSequenceId.intValue();
    // make a copy of the existing id
    nextId = new Integer(current);
    // now inc it
    this.nextSequenceId = new Integer(++current);
    } catch (EJBException e) {
    log.error("incNextSequenceId(): couldn't inc next sequenceId: " + e.toString());
    throw new UpdateFailedException(e.getMessage());
    return nextId;
    * Used by setDetails, ejbCreate.
    * @param member
    protected void setAttributes(DCharge charge) {
              System.out.println("#### VJ: ChargeBean.setAttributes(DCharge)");
         this.isDirty = true;
    ARTransactionManager mgr = null;
    try {
    Context ctx = new InitialContext();
    Object obj = ctx.lookup("java:comp/env/ejb/au.com.cams.cims.ar.ejb.ARTransactionManagerHome");
    ARTransactionManagerHome mgrHome = (ARTransactionManagerHome) PortableRemoteObject.narrow(obj, ARTransactionManagerHome.class);
    mgr = mgrHome.create();
    } catch (NamingException ne) {
    log.warn("setAttributes(): couldn't lookup ARTransactionManagerHome " + ne.toString());
    throw new EJBException(ne.toString());
    } catch (CreateException ce) {
    log.warn("setAttributes(): couldn't create ARTransactionManagerHome " + ce.toString());
    throw new EJBException(ce.toString());
    } catch (RemoteException ex) {
    log.error(ex.toString());
    throw new EJBException(ex.toString());
    try {
    TaxCode tc = mgr.getTaxCode(charge.getTaxCode());
    TaxAmounts amounts = ARUtilities.calculateTax(charge.getFreightAmount(), tc);
    this.taxOnFreightAmount = new Double(amounts.getAmountTax().doubleValue() - amounts.getAmountTaxIncluded().doubleValue());
    } catch (ReadFailedException rfe) {
    log.error("ReadFailedException reading tax code : " + charge.getTaxCode(), rfe);
    throw new EJBException(rfe.toString());
    } catch (RecordNotFoundException rnfe) {
    log.error("RecordNotFoundException reading tax code : " + charge.getTaxCode(), rnfe);
    throw new EJBException(rnfe.toString());
    } catch (RemoteException ex) {
    log.error(ex.toString());
    throw new EJBException(ex.toString());
              System.out.println("#### VJ: ChargeBean.setAttributes(DCharge) prior setters");
    this.applyToNum = charge.getApplyToNum();
    this.termsCode = charge.getTermsCode();
    this.finChgCode = charge.getFinanceChargeCode();
    this.shippingCode = charge.getShippingCode();
    this.postingCode = charge.getPostingCode();
    this.taxCode = charge.getTaxCode();
    this.agingDate = new Timestamp(charge.getAgingDate().getTime());
    this.dueDate = new Timestamp(charge.getDueDate().getTime());
    this.grossAmount = charge.getGrossAmount();
    this.taxAmount = charge.getTaxAmount();
    this.taxIncludedAmount = charge.getTaxIncludedAmount();
    this.freightAmount = charge.getFreightAmount();
    this.netAmount = charge.getNetAmount();
    this.paidAmount = charge.getPaidAmount();
    this.dueAmount = charge.getDueAmount();
    this.trxType = charge.getTrxType();
    this.docNum = charge.getDocNum();
    this.docDate = new Timestamp(charge.getDocDate().getTime());
    this.applyDate = new Timestamp(charge.getApplyDate().getTime());
    this.debtorNum = charge.getDebtorNum();
    this.trxStatus = charge.getTrxStatus();
    this.approvalStatus = charge.getApprovalStatus();
    this.printingStatus = charge.getPrintingStatus();
    this.postingStatus = charge.getPostingStatus();
    this.holdStatus = charge.getHoldStatus();
    this.holdReason = charge.getHoldReason();
    this.notes = charge.getNotes();
    this.message = charge.getMessage();
    this.nextSequenceId = charge.getNextSequenceId();
    DAddress billingAddress = charge.getBillingAddress();
    if (billingAddress != null) {
    this.billingAddressee = billingAddress.getAddressee();
    this.billingJobPosition = billingAddress.getPosition();
    this.billingAddr1 = billingAddress.getAddress1();
    this.billing

    I've solved this problem using JDBC.
    Thanks
    Smile
    Message was edited by:
    nsqsmile

  • SAP -- XI -- AS400(DB2) scenario configuration?

    Hi Experts,
    I have a scenario SAP -->XI -->AS400(DB2).
    I would like to know the step by step configuration of XI >AS400 (DB2). It will be great if any one can share the docs. Is it a good option to use JDBC adaptor for this scenario? If yes please let me know the steps for XIAS400 configuration.
    Thanks & Regards,
    Praveen.

    Hi Praveen,
    You can go for JDBC adapter, But, check this link it is also suggesting to use File adapter..
    R3-AS400
    for JDBC adapter check few links as well
    AS400 acess using JDBC adapter
    Re: JDCB Connection from XI to AS400
    JDBC drivers for DB2 on AS400 V5R3
    Sachin

  • EJB relation One to Many - ClassCastException

    Hi !
    I created two CMP EJB entity Client and Address. There is a One to Many relation between them.
    When I deploy them on JBoss, I have no errors, and the correponding tables are created in the database. The EJB seems to work fine, but when I use a 'relation' method : myAddress.setClient(myClient) for instance. I get a ServerException.
    In the log of JBoss there is :
    ClassCastException : org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.SetInstanceValue(...)
    I think I have a problem in my descriptors or JBoss configuration.
    If u have an idea ...
    Thx

    sorry to whack a load of code in but i can't see where the problem is here is my ejb-jar.xml file:
    <ejb-jar>
         <enterprise-beans>
              <entity>
                   <description>This bean represents a copy item.</description>
                   <ejb-name>CopyEJB</ejb-name>
                   <home>com.RemoteCopyHome</home>
                   <remote>com.RemoteCopy</remote>
                   <local-home>com.LocalCopyHome</local-home>
                   <local>com.LocalCopy</local>
                   <ejb-class>com.CopyBean</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>Copy</abstract-schema-name>
                   <cmp-field>
                        <field-name>copyid</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>quality</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>buyinprice</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>selloutprice</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>bookid</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>title</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>genre</field-name>
                   </cmp-field>
                   <primkey-field>copyid</primkey-field>
                   <security-identity>
                        <description></description>
                        <use-caller-identity></use-caller-identity>
                   </security-identity>
              </entity>
              <entity>
                   <description>This bean represents a supplier.</description>
                   <ejb-name>SupplierEJB</ejb-name>
                   <home>com.RemoteSupplierHome</home>
                   <remote>com.RemoteSupplier</remote>
                   <local-home>com.LocalSupplierHome</local-home>
                   <local>com.LocalSupplier</local>
                   <ejb-class>com.SupplierBean</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>Supplier</abstract-schema-name>
                   <cmp-field>
                        <field-name>supplierid</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>name</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>address1</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>address2</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>address3</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>address4</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>postcode</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>email</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>telno</field-name>
                   </cmp-field>
                   <primkey-field>supplierid</primkey-field>
                   <security-identity>
                        <description></description>
                        <use-caller-identity></use-caller-identity>
                   </security-identity>
              </entity>
              <entity>
                   <description>This bean represents an edition.</description>
                   <ejb-name>EditionEJB</ejb-name>
                   <home>com.RemoteEditionHome</home>
                   <remote>com.RemoteEdition</remote>
                   <local-home>com.LocalEditionHome</local-home>
                   <local>com.LocalEdition</local>
                   <ejb-class>com.EditionBean</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>Edition</abstract-schema-name>
                   <cmp-field>
                        <field-name>editionid</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>isbn</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>publisher</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>binding</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>other</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>edition</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>printdate</field-name>
                   </cmp-field>
                   <primkey-field>editionid</primkey-field>
                   <security-identity>
                        <description></description>
                        <use-caller-identity></use-caller-identity>
                   </security-identity>
              </entity>
              <entity>
                   <description>This bean represents an author.</description>
                   <ejb-name>AuthorEJB</ejb-name>
                   <home>com.RemoteAuthorHome</home>
                   <remote>com.RemoteAuthor</remote>
                   <local-home>com.LocalAuthorHome</local-home>
                   <local>com.LocalAuthor</local>
                   <ejb-class>com.AuthorBean</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>Author</abstract-schema-name>
                   <cmp-field>
                        <field-name>authorid</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>name</field-name>
                   </cmp-field>
                   <primkey-field>authorid</primkey-field>
                   <security-identity>
                        <description></description>
                        <use-caller-identity></use-caller-identity>
                   </security-identity>
              </entity>
              <session>
                   <description>Supplier Function Session Bean</description>
                   <display-name>SupplierFunctionEJB</display-name>
                   <ejb-name>SupplierFunctionEJB</ejb-name>
                   <home>com.SupplierFunctionHome</home>
                   <remote>com.SupplierFunctionRemote</remote>
                   <ejb-class>com.SupplierFunctionSBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
              </session>
              <session>
                   <description>Copy Function Session Bean</description>
                   <display-name>CopyFunctionEJB</display-name>
                   <ejb-name>CopyFunctionEJB</ejb-name>
                   <home>com.CopyFunctionHome</home>
                   <remote>com.CopyFunctionRemote</remote>
                   <ejb-class>com.CopyFunctionSBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
              </session>
         </enterprise-beans>
         <relationships>
              <ejb-relation>
                   <ejb-relation-name>Supplier-Copy</ejb-relation-name>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>copy-recievedfrom-supplier</ejb-relationship-role-name>
                        <multiplicity>Many</multiplicity>
                        <cascade-delete></cascade-delete>
                        <relationship-role-source>
                             <ejb-name>CopyEJB</ejb-name>
                        </relationship-role-source>
                        <cmr-field>
                             <cmr-field-name>supplier</cmr-field-name>
                        </cmr-field>
                   </ejb-relationship-role>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>supplier-has-items</ejb-relationship-role-name>
                        <multiplicity>One</multiplicity>
                        <relationship-role-source>
                             <ejb-name>SupplierEJB</ejb-name>
                        </relationship-role-source>
                   </ejb-relationship-role>
              </ejb-relation>
              <ejb-relation>
                   <ejb-relation-name>Edition-Copy</ejb-relation-name>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>edition-has-items</ejb-relationship-role-name>
                        <multiplicity>One</multiplicity>
                        <relationship-role-source>
                             <ejb-name>EditionEJB</ejb-name>
                        </relationship-role-source>
                   </ejb-relationship-role>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>copy-is-a-edition</ejb-relationship-role-name>
                        <multiplicity>Many</multiplicity>
                        <cascade-delete></cascade-delete>
                        <relationship-role-source>
                             <ejb-name>CopyEJB</ejb-name>
                        </relationship-role-source>
                        <cmr-field>
                             <cmr-field-name>edition</cmr-field-name>
                        </cmr-field>
                   </ejb-relationship-role>
              </ejb-relation>
              <!--<ejb-relation>
                   <ejb-relation-name>Author-Copy</ejb-relation-name>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>copy-has-items</ejb-relationship-role-name>
                        <multiplicity>Many</multiplicity>                                     
        <relationship-role-source>
                             <ejb-name>AuthorEJB</ejb-name>
                        </relationship-role-source>
                        <cmr-field>
                             <cmr-field-name>copies</cmr-field-name>
                             <cmr-field-type>java.util.Set</cmr-field-type>
                        </cmr-field>
                   </ejb-relationship-role>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>copy-has-authors</ejb-relationship-role-name>
                        <multiplicity>Many</multiplicity>
                        <cascade-delete></cascade-delete>
                        <relationship-role-source>
                             <ejb-name>CopyEJB</ejb-name>
                        </relationship-role-source>
                        <cmr-field>
                             <cmr-field-name>authors</cmr-field-name>
                     <cmr-field-type>java.util.Set</cmr-field-type>     
                        </cmr-field>
                   </ejb-relationship-role>
              </ejb-relation>-->
         </relationships>
         <assembly-descriptor>
              <security-role>
                   <description>This role represents everyone who is allowed full access
             to the beans.</description>
                   <role-name>Subscribers</role-name>
              </security-role>
              <method-permission>
                   <role-name>Subscribers</role-name>
                   <method>
                        <ejb-name>CopyEJB</ejb-name>
                        <method-name>*</method-name>
                   </method>
                   <method>
                        <ejb-name>SupplierEJB</ejb-name>
                        <method-name>*</method-name>
                   </method>
              </method-permission>
              <container-transaction>
                   <method>
                        <ejb-name>CopyEJB</ejb-name>
                        <method-name>*</method-name>
                   </method>
                   <method>
                        <ejb-name>SupplierEJB</ejb-name>
                        <method-name>*</method-name>
                   </method>
                   <trans-attribute>Required</trans-attribute>
              </container-transaction>
         </assembly-descriptor>
    </ejb-jar>my session bean code can be found at
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=11&t=006578

  • ISeries/AS400 Faxing ASCII

    I had a bit of trouble creating a Fax on the AS400 with the AS400 Toolbox for Java. I found the solution, so I wanted to share.
    I'm faxing an ASCII formatted file through iSeries. (A fax/modem pool was already set up there.)
    I read the data from an BufferedReader -> String -> char[].
    Then wrote the data into a BufferedArrayOutputStream, using the SCS5256Writer class from the as400.jar (jtOpen) (version 4.x for iSeries 5.2.0).
    The SCS (SNA Char Stream) object is where the magic happends.
    Retrieved the data as a byte[] and created a SpooledFileOutputStream (also from the Toolbox).
    When the spooled file is created in the iSeries queue, the device type is now using CURRENT instead of USERASCII.
    The sbmfax command (Toolbox commandCall) pickups up the specified spooled file & send it on it's way.

    I had a bit of trouble creating a Fax on the AS400
    with the AS400 Toolbox for Java. I found the
    solution, so I wanted to share.
    I'm faxing an ASCII formatted file through iSeries.
    (A fax/modem pool was already set up there.)
    I read the data from an BufferedReader -> String ->
    char[].
    Then wrote the data into a BufferedArrayOutputStream,
    using the SCS5256Writer class from the as400.jar
    (jtOpen) (version 4.x for iSeries 5.2.0).
    The SCS (SNA Char Stream) object is where the magic
    happends.
    Retrieved the data as a byte[] and created a
    SpooledFileOutputStream (also from the Toolbox).
    When the spooled file is created in the iSeries
    queue, the device type is now using *CURRENT instead
    of *USERASCII.
    The sbmfax command (Toolbox commandCall) pickups up
    the specified spooled file & send it on it's way.Interesting. Thanks for the information. :)

  • Help me to remove this Error in Entity Beans

    this is the Error i am getting along with this Error i have also put my ds xml file and other related file , please help me to remove this error
    at org.jboss.mx.server.ReflectedDispatcher.handleInvocationExceptions(Re
    flectedDispatcher.java:91)
    at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
    java:64)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
    java:197)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
    ler.java:884)
    at $Proxy18.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceController.java:414)
    at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
    java:60)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
    java:197)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    at $Proxy71.start(Unknown Source)
    at org.jboss.ejb.EjbModule.startService(EjbModule.java:367)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
    upport.java:271)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
    eanSupport.java:221)
    at sun.reflect.GeneratedMethodAccessor64.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
    java:60)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
    java:197)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
    ler.java:884)
    at $Proxy18.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceController.java:414)
    at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
    java:60)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
    java:197)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    at $Proxy15.start(Unknown Source)
    at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:570)
    at org.jboss.deployment.MainDeployer.start(MainDeployer.java:829)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:604)
    at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
    java:60)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
    java:197)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    at $Proxy8.deploy(Unknown Source)
    at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
    tScanner.java:304)
    at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
    canner.java:460)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
    doScan(AbstractDeploymentScanner.java:201)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
    loop(AbstractDeploymentScanner.java:212)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
    run(AbstractDeploymentScanner.java:191)
    Caused by: org.jboss.deployment.DeploymentException: Error in jbosscmp-jdbc.xml
    : datasource-mapping MySql not found
    at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityMetaData.<init>(JDB
    CEntityMetaData.java:483)
    at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.<init
    (JDBCApplicationMetaData.java:312)at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXm
    lFileLoader.java:67)
    at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaDat
    a(JDBCStoreManager.java:721)
    at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBC
    StoreManager.java:409)
    at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManage
    r.java:353)
    at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManag
    er.java:155)
    at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:337)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
    upport.java:271)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
    eanSupport.java:221)
    at sun.reflect.GeneratedMethodAccessor64.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
    java:60)
    ... 65 more
    11:37:34,679 INFO [EJBDeployer] Deployed: file:/C:/jboss-3.2.6/server/default/d
    eploy/ProductBean.jar
    11:37:34,679 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
    MBeans waiting for other MBeans:
    ObjectName: jboss.j2ee:jndiName=FaqMstLocal,plugin=pool,service=EJB
    state: CREATED
    I Depend On:
    Depends On Me:
    ObjectName: jboss.j2ee:jndiName=FaqMstLocal,service=EJB
    state: FAILED
    I Depend On:
    Depends On Me: MBeanException: org.jboss.deployment.DeploymentException: Error
    in jbosscmp-jdbc.xml : datasource-mapping MySql not found
    Cause: org.jboss.deployment.DeploymentException: Error in jbosscmp-jdbc.xml : da
    tasource-mapping MySql not found
    MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM:
    ObjectName: jboss.j2ee:jndiName=FaqMstLocal,plugin=pool,service=EJB
    state: CREATED
    I Depend On:
    Depends On Me:
    ObjectName: jboss.j2ee:jndiName=FaqMstLocal,service=EJB
    state: FAILED
    I Depend On:
    Depends On Me: MBeanException: org.jboss.deployment.DeploymentException: Error
    in jbosscmp-jdbc.xml : datasource-mapping MySql not found
    Cause: org.jboss.deployment.DeploymentException: Error in jbosscmp-jdbc.xml : da
    tasource-mapping MySql not found
    1 ) Contain of mysql-ds.xml File
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- $Id: mysql-ds.xml,v 1.1.2.1 2003/12/12 19:19:56 starksm Exp $ -->
    <!-- Datasource config for MySQL using 3.0.9 available from:
    http://www.mysql.com/downloads/api-jdbc-stable.html
    -->
    <datasources>
    <local-tx-datasource>
    <jndi-name>MySql</jndi-name>
    <connection-url>jdbc:mysql://192.168.111.44:3306/temp</connection-url>
              <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>new_temp</user-name>
    <password>temp</password>
    </local-tx-datasource>
    </datasources>
    2) i have also add datasource mappping in standardjaws.xml and standardjbosscmp-jdbc.xml file
    File :standardjaws.xml
    <datasource>java:/MySql</datasource>
              <type-mapping>MySql</type-mapping>
         File : standardjbosscmp-jdbc.xml
         <datasource>java:/MySql</datasource>
    <datasource-mapping>MySql</datasource-mapping>

    have a look at http://www.onjava.com/pub/a/onjava/2004/02/25/jbossjdbc.html

Maybe you are looking for

  • PI Assistant in PI Sheet

    Hi, I have configured a Scenario Of PI-Sheet. The Destination Type of Control recipe is(Browser Based Pi sheet) and the Message is cionfigured to come to my SAP mailbox.Now What i want is that the Charecteristics that i have Prepared will not Display

  • Is AskMate LLC a legitimate Mac security fixing company?

    As I was using my Safari to browse, I got a window which said something to the effect that my security had been breeched. For help, call (877)899-1824. They sent me a 6-digit code and were able to get into my whole computer. Name: Ask Mate LLC. They

  • Remote Site Architecture

    Hi, I was wondering if someone could take a look at the diagram I attached. I'm thinking I could reduce the hops the wireless traffic would take if I was able to use both Controller interafces and have them go to different switches. So, traffic comin

  • Internet connection are not detected

    hi, i upgrade from win xp to 7. After acrobat 8 installation done, i got problem during activation. Cant activate, error msg "INTERNET CONNECTION ARE NOT DETECTED". Please help to to solve it. Thank you.

  • CONNECT BY  does not perform

    Hello i have a Problem with a SQl Statement wich includes an CONNECT BY 1. there is a table with more than 4 millions entries CREATE TABLE "ANIMAL" "IDANIMAL" NUMBER(12,0) NOT NULL ENABLE, "IDPAYS" NUMBER(5,0) DEFAULT 4 NOT NULL ENABLE, "IDPERE" NUMB