Problems importing Session Ejb in Creator

Hi all,
I've tries to import a Session Ejb in a web app, usng Creator2.
I have created the MyEjb.jar containing the ejb's classes, and the deployment descriptors. The ejb do not use any data source.
Then, I've imported the ejb using the provided procedure:
Enterprise Java Beans -> Add set of Session EJBs
I've imported the MyEbj.jar file: I see the Ejb in the palette, and I can drag&drop the method I need.
The problem is when I try to "run" the web application. I have the following excpetion:
java.lang.NullPointerException
     at com.sun.rave.ejb.EjbDataSourceServiceImpl.getProjectDataSourceInfo(EjbDataSourceServiceImpl.java:66)
     at com.sun.rave.jsf.project.ext.RaveProjectWebModule.getRequestedResources(RaveProjectWebModule.java:78)
     at com.sun.rave.jsf.project.ext.RaveWebActionProvider.updateWebXml(RaveWebActionProvider.java:806)
     at com.sun.rave.jsf.project.ext.RaveWebActionProvider.invokeAction(RaveWebActionProvider.java:172)
     at org.netbeans.modules.project.ui.actions.MainProjectAction.actionPerformed(MainProjectAction.java:90)
     at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
     at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
     at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
     at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
     at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
     at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
     at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
     at java.awt.Component.processMouseEvent(Component.java:5488)
     at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
     at java.awt.Component.processEvent(Component.java:5253)
     at java.awt.Container.processEvent(Container.java:1966)
     at java.awt.Component.dispatchEventImpl(Component.java:3955)
     at java.awt.Container.dispatchEventImpl(Container.java:2024)
     at java.awt.Component.dispatchEvent(Component.java:3803)
     at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
     at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
     at java.awt.Container.dispatchEventImpl(Container.java:2010)
     at java.awt.Window.dispatchEventImpl(Window.java:1774)
     at java.awt.Component.dispatchEvent(Component.java:3803)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
[catch] at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
and also:
Error occured when trying to parse the ejb data source file C:\work\Progetti\AreaIt\ProvaWorkSpace\lib\ejb-sources\ejb-refs.xml
org.xml.sax.SAXParseException: Premature end of file.
The file is ejb-refs.xml is empty!
Where is the problem? Any idea ? Who actually creates the ejb-refs.xml file?
Any suggestion?
Thanks a lot.
Marco

Please, be aware that a value of RMI-IIOP port for Sun Application Server 8.1, bundled with Creator 2.0, is different from this one for Sun Application Server 8.2, bundled with Creator 2.1:
Sun Application Server 8.1, Creator 2.0 - 23700
Sun Application Server 8.2, Creator 2.1 - 24700

Similar Messages

  • Problems creating session ejbs in a startup class

    public class startupTest implements T3StartupDef
         private T3ServicesDef services;
         public startupTest()
         public String startup(String name, Hashtable args) throws Exception
         try{
              Context initialContext = getContext("t3://localhost:7001");
         DruckAuftragHome dah =     (DruckAuftragHome)initialContext.lookup(
    "DruckAuftrag" );
              javax.ejb.EJBObject o = dah.create();
              DruckAuftrag da = (DruckAuftrag) o;
              System.out.println("EEEEEEEEEEEEEEEEEEEEEEEE"+da.makePDF());
              catch(Exception e)
                   e.printStackTrace();
              return "";
    private static Context getContext(String wlUrl)
    throws javax.naming.NamingException
    Hashtable env = new Hashtable();
    env.put(Context.PROVIDER_URL, wlUrl);
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    weblogic.jndi.WLInitialContextFactory.class.getName());
    Context ctx = new InitialContext(env);
    return ctx;
         public void setServices(T3ServicesDef services)
              this.services = services;
    Calling the Bean Method works form Servlets and form standalone Clients, but at
    startup
    java.lang.NullPointerException
    at weblogic.utils.io.UnsyncByteArrayInputStream.<init>(UnsyncByteArrayInputStream.java:57)
    at weblogic.rmi.internal.ServerRequest.getInputStream(ServerRequest.java:91)
    at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:87)
    at com.bmw.tais.appserver.ipa.produkt.druckauftrag.DruckAuftragBeanHomeImpl_WLStub.create(DruckAuftragBeanHomeIm
    pl_WLStub.java:151)
    at com.bmw.tais.helper.startupTest.startup(C:/ipa_wa/IPA/com/bmw/tais/helper/startupTest.java:49)
    at weblogic.t3.srvr.StartupThread.runStartup(StartupThread.java:182)
    at weblogic.t3.srvr.StartupThread.doWork(StartupThread.java:146)
    at weblogic.t3.srvr.PropertyExecuteThread.run(PropertyExecuteThread.java:62)
    if i call the bean in a tread over and over again the first exception is a nullpointer
    (shown above) and then i get a ClassCastException calling
    the create Methode on the DruckAuftragBeanHomeImpl_WLStub.create(DruckAuftragBeanHomeIm
    pl_WLStub.java:151)
    any ideas?
    thanks
    regars robert

    Hi Robert,
    You need to let the server to warm up before
    starting using it's services. Check weblogic doc's
    for samples.
    Regards,
    Slava Imeshev
    "robert neumaier" <[email protected]> wrote in message
    news:[email protected]...
    >
    public class startupTest implements T3StartupDef
    private T3ServicesDef services;
    public startupTest()
    public String startup(String name, Hashtable args) throws Exception
    try{
    Context initialContext = getContext("t3://localhost:7001");
    DruckAuftragHome dah =(DruckAuftragHome)initialContext.lookup(
    "DruckAuftrag" );
    javax.ejb.EJBObject o = dah.create();
    DruckAuftrag da = (DruckAuftrag) o;
    System.out.println("EEEEEEEEEEEEEEEEEEEEEEEE"+da.makePDF());
    catch(Exception e)
    e.printStackTrace();
    return "";
    private static Context getContext(String wlUrl)
    throws javax.naming.NamingException
    Hashtable env = new Hashtable();
    env.put(Context.PROVIDER_URL, wlUrl);
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    weblogic.jndi.WLInitialContextFactory.class.getName());
    Context ctx = new InitialContext(env);
    return ctx;
    public void setServices(T3ServicesDef services)
    this.services = services;
    Calling the Bean Method works form Servlets and form standalone Clients,but at
    startup
    java.lang.NullPointerException
    atweblogic.utils.io.UnsyncByteArrayInputStream.<init>(UnsyncByteArrayInputStre
    am.java:57)
    atweblogic.rmi.internal.ServerRequest.getInputStream(ServerRequest.java:91)
    atweblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:87)
    atcom.bmw.tais.appserver.ipa.produkt.druckauftrag.DruckAuftragBeanHomeImpl_WLS
    tub.create(DruckAuftragBeanHomeIm
    pl_WLStub.java:151)
    atcom.bmw.tais.helper.startupTest.startup(C:/ipa_wa/IPA/com/bmw/tais/helper/st
    artupTest.java:49)
    atweblogic.t3.srvr.StartupThread.runStartup(StartupThread.java:182)
    at weblogic.t3.srvr.StartupThread.doWork(StartupThread.java:146)
    atweblogic.t3.srvr.PropertyExecuteThread.run(PropertyExecuteThread.java:62)
    >
    if i call the bean in a tread over and over again the first exception is anullpointer
    (shown above) and then i get a ClassCastException calling
    the create Methode on theDruckAuftragBeanHomeImpl_WLStub.create(DruckAuftragBeanHomeIm
    pl_WLStub.java:151)
    any ideas?
    thanks
    regars robert

  • Session EJB with external jar dependacy problem

    I have a Session EJB that I am having trouble adding to my Creator 2 project. The session bean is developed with netbeans 5.0, ejb2.1, for sjsas 8.2 PE. It has one external jar which is compiled into the ejb jar. When I try to add the session bean to my creator 2 project I get a java.lang.reflect.UndeclaredThrowableException. Creator 2 is not finding one of the Exception external jar.
    The only way I have been successful in added the session EJB is also add the external jar. But the project fails when you load the page with javax.naming.NameNotFoundException: No object bound to the name java: xxxxxx I believe the EJB is failing at instantiation.
    Has anyone had this problem and overcome it?
    Thanks,
    Francis

    Finally I found solution.
    Instead of deploying ejb jar to ear I've created a new ear deployment profile (so now I have ejb jar profile and ear profile).
    It contains ejb jar + external jar library and custom manifest.mf with class-path to ext. jar.
    Difference between this and previous version is the old one ear cointained ejb jar and the ejb jar contained ext. jar.
    Now ear contains both ejb jar and ext. jar.
    Rado

  • Problem catching handle ejb session in jsp pages

    Hello,
    i'm trying to develop an ejb application.
    I have created an ejb session stateful in a second ejb stateless :
    InitialContext ic = new InitialContext();
    UserSessionHome home = (UserSessionHome)ic.lookup("UserSessionHome");
    UserSession conn = home.create(login,mdp);
    Then I have to retrieve this ejb session stateful in a jsp page in order to remove it or to call some others functions developped in the bean interface.
    I think that the solution for this problem are the ejb handles.
    But i don't know how and where I can store them.
    Can you help me?
    Thanx
    Sophie

    You put them in the HttpSession. For "how," read the API docs.

  • Problems importing V1.5 session files

    Morning folks, I managed to install version 3 last week with no problems, however I am having a problem importing my old version 1.5 session files.
    The session loads ok, however the levels are all wrong. I seem to recall seeing a thread about this before, however I can't seem to find it.
    Is there something specific I need to do to load in the 1.5 session file and also preserve the levels?
    Thanks for any replies :)
    ~Dave

    >I take it from the lack of replies that there is nothing I can do other than manually tweak the levels after the import?
    It's the Christmas holiday break, so not everything gets picked up immediately...
    >I seem to recall seeing a thread about this before, however I can't seem to find it.
    That's because it's on the AudioMasters forum, not here. Try:
    http://www.audiomastersforum.net/amforum/index.php/topic,4653.0.html
    I'm pretty sure that what applies to AA2.0 also applies to AA3.0.

  • Problems integrating JSF managed bean with Session EJB with JDeveloper

    HI All,
    I am developeing a JSF-EJB application using Jdeveloper11g. On deploying the application I am getting the following errors on deployment.
    <19/08/2010 2:53:49 PM EST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1282193629318' for task '17'. Error is: 'weblogic.application.ModuleException: Could not setup environment'
    weblogic.application.ModuleException: Could not setup environment
         at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1499)
         at weblogic.servlet.internal.WebAppModule.activate(WebAppModule.java:442)
         at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:375)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
         at weblogic.application.internal.flow.ModuleStateDriver.activate(ModuleStateDriver.java:95)
         Truncated. see log file for complete stacktrace
    Caused By: weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'MetaDataBean' declared in the ejb-ref or ejb-local-ref 'MetaData' in the application module 'ViewControllerWebApp.war' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct.
         at weblogic.deployment.BaseEnvironmentBuilder.addEJBLinkRef(BaseEnvironmentBuilder.java:453)
         at weblogic.deployment.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:485)
         at weblogic.servlet.internal.CompEnv.activate(CompEnv.java:157)
         at weblogic.servlet.internal.WebAppServletContext.activate(WebAppServletContext.java:3117)
         at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1497)
         Truncated. see log file for complete stacktrace
    >
    <19/08/2010 2:53:49 PM EST> <Error> <Deployer> <BEA-149202> <Encountered an exception while attempting to commit the 1 task for the application 'data-catalog'.>
    <19/08/2010 2:53:49 PM EST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'data-catalog'.>
    <19/08/2010 2:53:49 PM EST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
    weblogic.application.ModuleException: Could not setup environment
         at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1499)
         at weblogic.servlet.internal.WebAppModule.activate(WebAppModule.java:442)
         at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:375)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
         at weblogic.application.internal.flow.ModuleStateDriver.activate(ModuleStateDriver.java:95)
         Truncated. see log file for complete stacktrace
    Caused By: weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'MetaDataBean' declared in the ejb-ref or ejb-local-ref 'MetaData' in the application module 'ViewControllerWebApp.war' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct.
         at weblogic.deployment.BaseEnvironmentBuilder.addEJBLinkRef(BaseEnvironmentBuilder.java:453)
         at weblogic.deployment.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:485)
         at weblogic.servlet.internal.CompEnv.activate(CompEnv.java:157)
         at weblogic.servlet.internal.WebAppServletContext.activate(WebAppServletContext.java:3117)
         at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1497)
         Truncated. see log file for complete stacktrace
    Thanks
    Edited by: user5108636 on 18/08/2010 22:46

    Please find attached the source code of JSF managed bean, local business interface, session bean and web.xml
    MANAGED BEAN_
    package view.backing;
    import java.util.List;
    import javax.ejb.EJB;
    import javax.faces.component.UISelectItems;
    import javax.faces.component.html.HtmlSelectManyListbox;
    import model.ejb.session.MetaDataBean;
    public class SearchMetaDataBean {
    @EJB MetaDataBean metaDataService;
    private List<String> tables;
    private List<String> columns;
    private HtmlSelectManyListbox selectManyListbox1;
    private UISelectItems selectItems1;
    public void setTables(List<String> tables) {
    this.tables = tables;
    public List<String> getTables() {
    return metaDataService.getTables();
    public void setColumns(List<String> columns) {
    this.columns = columns;
    public List<String> getColumns() {
    return columns;
    public void setSelectManyListbox1(HtmlSelectManyListbox selectManyListbox1) {
    this.selectManyListbox1 = selectManyListbox1;
    public HtmlSelectManyListbox getSelectManyListbox1() {
    return selectManyListbox1;
    public void setSelectItems1(UISelectItems selectItems1) {
    this.selectItems1 = selectItems1;
    public UISelectItems getSelectItems1() {
    return selectItems1;
    LOCAL INTERFACE_
    package model.ejb.session;
    import java.util.List;
    import javax.ejb.Local;
    @Local
    public interface MetaDataLocal {
    public List<String> getTables();
    public List<String> getColumns(String tableName);
    SESSION BEAN_
    package model.ejb.session;
    import javax.ejb.Local;
    import java.sql.Connection;
    import java.sql.DatabaseMetaData;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.ArrayList;
    import java.util.List;
    import javax.annotation.PostConstruct;
    import javax.annotation.Resource;
    import javax.ejb.Stateless;
    import javax.sql.DataSource;
    @Stateless(name="MetaData")
    @Local
    public class MetaDataBean implements MetaDataLocal{
    @Resource(name="jdbc/DWDS")
    private DataSource dataSource;
    private Connection connection;
    private List<String> tables = new ArrayList<String>();
    private List<String> columns = new ArrayList<String>();
    private DatabaseMetaData dmd;
    @PostConstruct
    public void initialize(){
    try{
    connection = dataSource.getConnection();
    DatabaseMetaData dmd;
    dmd = connection.getMetaData();
    }catch(SQLException sqle){
    sqle.printStackTrace();
    public MetaDataBean() {
    public List<String> getTables(){
    try{                 
    if (dmd ==null){
    //System.out.println("Database meta data not available");
    tables.add("None");
    }else{
    ResultSet rs = dmd.getSchemas();
    ResultSet rs1 = null;
    while(rs.next()) {
    if (rs.getString(1).equalsIgnoreCase("AV_DATA")){
    rs1 = dmd.getTables(null,rs.getString(1),"%",null);
    while(rs1.next()) {
    tables.add(rs1.getString(3));
    }catch (SQLException sqle){
    sqle.printStackTrace();
    return tables;
    public List<String> getColumns(String tableName){
    try{
    ResultSet rsColumns = dmd.getColumns("", "AV_DATA", tableName, null);
    while(rsColumns.next()){
    columns.add(rsColumns.getString(4));
    }catch (SQLException sqle){
    sqle.printStackTrace();
    return columns;
    WEB.XML_
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <ejb-local-ref>
    <ejb-ref-name>MetaData</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local>model.ejb.session.MetaDataLocal</local>
    <ejb-link>MetaDataBean</ejb-link>
    </ejb-local-ref>
    </web-app>
    Edited by: user5108636 on 18/08/2010 22:45
    Edited by: user5108636 on 18/08/2010 22:46

  • Importing javax.ejb problems

    Hi,
    I have started learning EJB using netbeans 6.5 running on a mac os X 10.5.6. When i am trying to import javax.ejb and error stating that package javax.ejb does not exist.
    From a search on the net i have learned that on windows os it is a problem of class paths. I don't know how to solve this problem on mac.
    Thanks
    Ray

    Here is what I have done recently:
    I tried it in Eclipse, which also isn't able to find javax.ejb and java.ejb
    What is going wrong? It seems like j2ee.jar doesn't provide these libraries.
    Thank you.

  • Error adding session EJBs set to a project

    I have problem adding a set of session EJBs to my JSC2 project.
    I have deployed an EJB module created with NetBeans 5.0 to Java Application Server 8 embedded in Creator 2 and I would add them to my JSF web application, but when I run the wizard inserting this data:
    EJB Set Name: EjbModule1
    Application Server: Sun Java System Application Server 8.1
    Server Host: localhost
    RMI-IIOP Port: 23700
    Client jar: < the name of the deployed client EJB module >
    and pressing "Next" to go to step 2 I get this error message:
    "A java.lang.reflect.InvocationTargetException exception has occurred ..."
    What is wrong ?
    Can someone help me ? Thanks in advance

    and pressing "Next" to go to step 2 I get this error
    message:
    "A java.lang.reflect.InvocationTargetException
    exception has occurred ..."I once had this error message. Dongmei helped with this, he found that the problem was a Session bean without remote methods (local methods only). Make sure that all of your EJB Session Beans have remote methods.
    Anyway the full error log will be good starting point.
    Best regards
    Antonio.

  • Problem with sessions in Kate Editor

    Hey guys!
    I'm using Kate Editor to code and i'm having problems with sessions. If kate is open and I logout KDE, when I come back to KDE all my customizations in Kate's session (activated plugins, font size, etc) are lost.
    If I manually close Kate before logout from KDE, all the customizations are kept when a manually start Kate. I tried a lot of workarounds, but none worked.
    Is this a bug? Someone else with this issue?
    Thanks in advance!

    The Warning errors are simply because you don't have the tablespaces, users, and roles defined in your application system under the DB Admin tab. Unless it is important to you to capture the physical implementation of your tables exactly as well as the table definitions, you can safely ignore these. If the physical implementation IS important to you, then you need to create these tablespaces, roles and users under the database that you created under the DB Admin tab before you start the capture.
    The Error is because in the set of objects you are capturing there is a foreign key that references the table named "PLEASANT". This table must be among the objects that you are capturing, or must already be in a Table Definition in your application system in the repository.

  • Transaction rollback in stateless session EJB 3.0

    Hello everyone !
    I have a stateless session EJB as per 3.0 spec.
    /*Remote Interface*/
    package com.nseit.ncfm2.data.ejb;
    import java.sql.SQLException;
    import java.util.Collection;
    import javax.ejb.Remote;
    import javax.ejb.TransactionAttribute;
    import javax.ejb.TransactionAttributeType;
    import javax.naming.NamingException;
    import com.nseit.ncfm2.security.Audit;
    @Remote
    public interface ProductionDataChangesRequestsRemote {
         @TransactionAttribute(TransactionAttributeType.REQUIRED)
         public boolean shiftCandidateDetails(String sourceNcfmId,
                   String destinationNcfmId, Collection<String> specialCasesList, String shiftingRemarks, String user, Audit updtAudit) throws NamingException, SQLException;
    /*Bean Class*/
    package com.nseit.ncfm2.data.ejb;
    import javax.ejb.Remote;
    import javax.ejb.Stateless;
    import javax.ejb.TransactionAttribute;
    import javax.ejb.TransactionAttributeType;
    import javax.ejb.TransactionManagement;
    import javax.ejb.TransactionManagementType;
    import javax.naming.NamingException;
    import com.nseit.ncfm2.security.Audit;
    import com.nseit.ncfm2.util.server.lookup.LookUpServerResources;
    import java.sql.*;
    import java.util.*;
    * Session Bean implementation class ProductionDataChangesRequestsBean
    @Stateless(name = "ProductionDataChangesRequestsBean", mappedName = "ProductionDataChangesRequestsEJB")
    @Remote(ProductionDataChangesRequestsRemote.class)
    @TransactionManagement(TransactionManagementType.CONTAINER)
    public class ProductionDataChangesRequestsBean implements
              ProductionDataChangesRequestsRemote {
         * Default constructor.
         public ProductionDataChangesRequestsBean() {
              // TODO Auto-generated constructor stub
         @Override
         @TransactionAttribute(TransactionAttributeType.REQUIRED)
         public boolean shiftCandidateDetails(String sourceNcfmId,
                   String destinationNcfmId, Collection<String> specialCasesList,
                   String shiftingRemarks, String user, Audit updtAudit)
                   throws NamingException, SQLException {
              // TODO Auto-generated method stub
              Connection conn = null;
              PreparedStatement pstmt = null;
              int updtCnt = 0;
              boolean areDetailsShifted = false;
              try {
                   /* Start: update table-1 */
                   updtCnt = pstmt.executeUpdate();
                   /* End: update table-1 */
                   /* Start: update table-2 */
                   updtCnt = pstmt.executeUpdate();
                   /* End: update table-2 */
                   areDetailsShifted = true;
              } /*catch (SQLException e) {
                   // TODO Auto-generated catch block
                   System.out
                             .println("SQLException in ProductionDataChangesRequestsBean.shiftCandidateDetails(...) "
                                       + e.getMessage());
                   // e.printStackTrace();
                   context.setRollbackOnly();
              } */finally {
                   LookUpServerResources.closeStatement(pstmt);
                   LookUpServerResources.closeConnection(conn);
              return areDetailsShifted;
    Currently,if the 1st table update succeeds and the 2nd table update gives an exception,a rollback is not taking place i.e records in 1st table are updated.
    I want the transaction to be rolled back in case an SQLException occurs(or for that matter,any runtime exception occurs).
    I tried two approaches :
    i: Use of context.setRollbackOnly() in catch block for SQLException
    ii:Throwing the SQLException
    In both the cases, the transaction didn't roll back.
    How can I achieve this :
    i: Without the usage of @ApplicationException annotation(as I do not have any application exceptions)
    ii: Without catching the SQLException and then calling context.setRollbackOnly()
    Or what is the standard way?
    Thanks !

    Where is your connection object coming from?

  • Problem importing a table with blob's

    hi all, I'm facing the following situation.
    Source DB : 10.2.0.3 (client's DB)
    Destination DB (mine): 10.2.0.4
    I've a dump file (traditional) of a particular schema.
    I'm running import (imp) to import on my DB.
    It runs fine until it reaches one particular table. This table has 6 colums, 3 of them are BLOB.
    This table has 260000 rows (checked with export log).
    When import reaches row 152352 it stops loading data, but import is still running.
    what can I do to get more information from this situation in order to solve this problem?
    Any suggestion will be appreciated!
    Thanks in advance.

    Pl identify the source and target OS versions. Are there any useful messages in the alert.log ? How long did the export take ? Rule of thumb states import will take twice as long. Have you tried expdp/impdp instead ? Also see the following -
    How To Diagnose And Troubleshoot Import Or Datapump Import Hung Scenarios          (Doc ID 795034.1)
    How To Find The Cause of a Hanging Import Session          (Doc ID 184842.1)
    Import is Slow or Hangs          (Doc ID 1037231.6)
    Export and Import of Table with LOB Columns (like CLOB and BLOB) has Slow Performance          (Doc ID 281461.1)
    HTH
    Srini

  • How to call session EJB from EP service in EP 7.0?

    Hi,
    I am trying to invoke stateless session EJB from my portal service. Both the service and EJB are deployed on the same server which is EP 7.0.
    I found [this|http://help.sap.com/saphelp_nw70/helpdata/EN/42/9ddcc9bb211d72e10000000a1553f6/frameset.htm] in SAP help and tried to implement it (added PrivateSharingReference to portalapp.xml and implemented the code), but everytime I try to lookup the session bean and cast it using P4ObjectBroker.narrow() method, I get java.lang.ClassCastException. The object found in JNDI and my portal service have different classloaders, so I suppose this is the problem, but I don't know how to handle it...
    Can anyone please help me?
    Regards,
    Tomas

    Hi Satya ,
              please go though following blog for used DC concept.
    Componentization of Webdynpro Application in CE7.1
    In netweaver 7.1 interface controler is abstract and component controller is implementing interface controller so the context data and methods have to be implemented by component controller

  • Having problem access the EJB 3 from Web Component

    Hi ,
    I have an EJB 3 entity AuctionItem and a session ItemProcessor only implements the local interface IItemProcessor, then I use a servlet to access the findAll method in the ItemProcessor. I've created a Enterprise Applicaiton project to contain the ejb jar and the war file, but after I deploy the ear successfully, I couldn't access to my servlet through http://localhost:8080/AuctionWeb/AuctionServlet, it keeps giving me error like follwoing. Do you know why, your help will be very appreciated !
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    java.lang.NullPointerException
         at web.AuctionServlet.doGet(AuctionServlet.java:43)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:278)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
         at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
         at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:231)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
         at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
         at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
         at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
         at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
    My code sample:
    public class AuctionServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
          @EJB
             private IItemProcessor itemProcessor;
         public AuctionServlet() {
              super();
         protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            out.println("<html>");
            out.println("<head>");
            out.println("<title>Servlet AuctionServlet</title>");
            out.println("</head>");
            out.println("<body>");
            out.println("<h1>Servlet AuctionServlet at " + request.getContextPath () + "</h1>");
            List items = itemProcessor.findAll();
           for (Iterator it = items.iterator(); it.hasNext();) {
            AuctionItem elem = (AuctionItem) it.next();
           out.println(" <b>"+elem.getItemid()+" </b><br />");
           out.println(elem.getTitle()+"<br /> ");
            out.println("</body>");
            out.println("</html>");
    .....And the session bean is :
    package sessions;
    import javax.annotation.Resource;
    import javax.ejb.Local;
    import javax.ejb.Stateless;
    import javax.persistence.*;
    import javax.sql.DataSource;
    import java.util.List;
    import entities.AuctionItem;
    @Stateless(name = "ItemProcessor")
    public class ItemProcessor implements sessions.IItemProcessor {
         @PersistenceContext
         EntityManager entityManager;
         public Long createItem(String title, Double value, String description,
                   String status) {
              AuctionItem item = new AuctionItem();
              item.setTitle(title);
              item.setValue(value);
              item.setDescription(description);
              item.setStatus(status);
              entityManager.persist(item);
              return item.getItemid();
         public String findItemByKey(Long id) {
              AuctionItem item = entityManager.find(AuctionItem.class, id);
              return item.getTitle();
         public List findAll() {
            return  entityManager.createQuery("select object(o) from AuctionItem as o").getResultList();
    }

    The most common reason for this failure is if your web.xml does not refer to the latest web application
    .xsd :
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http
    ://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/x
    ml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    Otherwise, the web application is considered to be a J2EE 1.4 application and annotations
    are not processed. If that's not the case you can also run the application through the
    verifier to see if it identifies any issues.

  • Why can't i login with the account i just created???? I am missing an important session!!!!

    why can't i login with the account i just created???? I am missing an important session!!!!

    Hello ljp1,
    What browser are you using to log in to your brother account? It could be a problem with some settings within your browser that is giving you grief.
    Try going through these troubleshooting steps to see if it helps resolve the issue.
    http://goo.gl/TTH2s
    If I have helped you in any way click the Kudos button to say Thanks.
    The community works together, click Accept as Solution on the post that solves your issue for other members of the community to benefit from the solution.
    - Friendship is magical.

  • Stateless session EJBs  & "idempotent"

    We need to declare a method as "idempotent" to take care of failure inside a
              method call, For that to work the code inside should written in such way so
              that repeated call to the same method should not give us diffrent result.
              But why can't weblogic implement a partial rollback( Just like Oracle's save
              point rollback, where you can rollback to certain point within a
              transaction).
              Because some times it is not possible to code in such a way to get the same
              result every time(Incase of fail over)
              Thanks
              ,Stateless session EJBs
              Stateless session EJBs can have both a cluster-aware home stub and a
              replica-aware EJBObject stub. By default, WebLogic Server provides failover
              services for EJB method calls, but only if a failure occurs between method
              calls. For example, failover is automatically supported if there is a
              failure after a method completes, or if the method fails to connect to a
              server. When failures occur while an EJB method is in progress, WebLogic
              Server does not automatically failover from one server to another.
              This default behavior ensures that database updates within an EJB method are
              not "duplicated" due to a failover scenario. For example, if a client calls
              a method which increments a value in a datastore and WebLogic Server fails
              over to another server before the method completes, the datastore would be
              updated twice for the client's single method call.
              If methods are written in such a way that repeated calls to the same method
              do not cause duplicate updates, the method is said to be "idempotent." For
              idempotent methods, WebLogic Server provides the
              stateless-bean-methods-are-idempotent deployment property. If you set this
              property to "true" in weblogic-ejb-jar.xml, WebLogic Server assumes that the
              method is idempotent and will provide failover services for the EJB method,
              even if a failure occurs during a method call.
              

    Vishal,
    I wouldn't think you would have a problem doing RMI communication from a Entity
    Bean - - for instance, when a WLS instance 'hosts' an EJB that communicates to
    a different WLS instance that 'hosts' an EJB that communication occurs via RMI.
    Chuck Nelson
    Developer Relations Engineer
    BEA Technical Support

Maybe you are looking for

  • Is there an app that will allow my toddler to access or use her apps and games without being able to do other things on my iPad?

    My two year old loves to use my iPad.  She has apps for reading, shapes, counting, etc.  My problem is that when she uses my iPad, she is constantly scrolling through and changing settings or getting into other apps.  Is there an app I can download t

  • Importing table dump from oracle into sybase

    I was wondering if anyone has ever imported a table dump from oracle into sybase. I just tried it and it didn't work. I used TOAD to create my table dump file but when i imprted it into sybase using bcp in i got the following error cs_convert: cslib

  • Lenovo special image of Ubuntu

    Does anyone know where I can obtain the Lenovo-specific image of the Ubuntu 10.10 operating system?  Ubuntu's site says there's a special version with the compatible hardware specs and software. Here's a link to it: http://www.ubuntu.com/certificatio

  • Graphic manager Oracle 9i on linux Red Hat 8.0

    I would like to know if someone can help me about the way that i can start the Graphic manager of Oracle 9i on Linux Red hat 8.0, because after i installed Oracle, the manager starts but when I shut down my computer it never appeared again. Can you h

  • Recovery options for NOARCHIVELOG

    Hi there Can anybody tell me what are the recovery options available for a Database which is running in NOARCHIVELOG mode. For example, Tablespace Point-In-Time Recovery (TSPITR) can be done with a Database running in NOARCHIVELOG mode? Like that can