JDeveloper EJB3 Session Bean Problem

Hi Everyone,
I am new to JDeveloper. I tried to do a EJB3 Stateless Session Bean. I want to add the AroundInvoke Function to the Bean class. At below
@AroundInvoke
// mark this method as a bean interceptor
public Object checkPermission(InvocationContext ic) throws Exception {
System.out.println("*** checkPermission interceptor invoked");
// you can implement your own security framework using interceptors
if (!ic.getEJBContext().getCallerPrincipal().getName().equals("oc4jadmin")) {
throw new SecurityException("Caller: '"
+ ic.getEJBContext().getCallerPrincipal().getName()
+ "' does not have permissions for method "
+ ic.getMethod());
return ic.proceed();
However, the Jdeveloper 11g keep show me the error message that AroundInvoke is not found. Then I put the import javax.ejb.AroundInvoke. It still complain import javax.ejb.AroundInoke not found.
Please help and advise.
Thank you

A small tip - if you go to the add a library dialog in the project properties you'll see a search box at the top - you can put a class name there and JDeveloper will show you in which library it is.

Similar Messages

  • JDeveloper 10.1.3 EA 1 Session Bean Problems

    Hello,
    it seems there are some problems in JDeveloper 10.1.3 EA1 related to Session EJBs:
    1) The Create Session Bean Wizard doesn't work correctly. After finishing the Wizard, JDeveloper only creates the ejb-jar.xml and orion-ejb-jar.xml, but not the Session EJB classes/interfaces themselves (Bean, Remote, Home). So I had to develop the Session Bean in JDeveloper 10.1.3 Developer Preview. That worked fine. I finally migrated the project to 10.1.3 EA1.
    2) When I try to run my JSF/EJB application with the Session Bean in 10.1.3 EA1, the following error occurred:
    05/10/24 17:31:15 Error instantiating application 'current-workspace-app' at file: <a file path>...oc4j-app.xml:
    Error initializing ejb-modules:
    Error loading module file: <a file path>.../Model/classes/:
    Syntax error in source or compilation failed in:
    <a file path>...\Software\JDeveloper\jdevj2eebase1013\jdev\system\oracle.j2ee.10.1.3.34.12\embedded-oc4j\application-deployments\current-workspace-app\Umfragesystem02_Model_0\generated\CommandHandlerSession_StatelessSessionBeanWrapper0.java
    I have no idea how to solve this problem. Does anybody have a solution?
    Regards,
    Matthias

    Tested Session Bean and Entity Bean.<br>
    The bean class and the deployment descriptors get<br>
    generated.<br>
    The remote/local, home/local home interfaces do not<br>
    get generated.<br><br>
    Thanks. The Session Bean Creation Wizard problem is a problem I could solve using a workaround. But the problem that really stems me is the error I receive when I try to run my webapp using the Session Bean and some more classes and JavaServer Faces files:<br>
    <br>
    Error instantiating application 'current-workspace-app' at file: ...oc4j-app.xml: <br>Error initializing ejb-modules: <br>
    Error loading module file: .../Model/classes/: <br>
    Syntax error in source or compilation failed in:<br> ...\Software\JDeveloper\jdevj2eebase1013\jdev\system\oracle.j2ee.10.1.3.34.12\embedded-oc4j\application-deployments\current-workspace-app\Umfragesystem02_Model_0\generated\CommandHandlerSession_StatelessSessionBeanWrapper0.java <br>
    <br>
    What goes wrong with JDeveloper or the application?

  • Problem retreiving object from EJB3 Session Bean

    Please delete.
    Edited by: wsaxton1 on Oct 9, 2007 10:18 PM

    So we tested some things that are described in the SDN or by SAP with Connectors.
    We tested JCO version 2.0.12, 2.1.18 and 3.0 in J2EE Projects in netweaver and in Eclipse (Standalone).
    For version 2.0.12 there is a failure that this version is not compatible with the other things in netweaver.
    This version is for standalone and integrated sytems.
    For version 2.1.18 is only described as standalone and so failure happened in netweaver that other classes are coruppted or missed. The internal test in "content administrator" (Ping and Test) do not work and had the same error.
    For version 3.0 (that displace the other two versions) there is many to do in  settings and coding that we do not have tested yet because project is not that small to write it for JCO 3.0 only for testing. When we only displaced files in netweaver the server do not start any more.
    So:
    Is there a way to call R/3 from session bean and 1. create an JCO client or 2. add a client to the "standard" pool of netweaver to use it?
    Any ideas? help? links?
    Project have to be complete in september...
    Our combi is SAP Netweaver 2004 SP21 on Windows XP SP2 / Server 2003 Standard SP1 with JVM 1.4.2_16... need of any more info?
    thx

  • Ejb3 session bean lookup

    Hello, I have following problem with the ejb3 and session bean lookup:
    For example, I have a session bean with some dummy method, i.e. getInfo() :
    @Stateless
    public class MySessionBean implements MySessionLocal {
    public String getInfo() {return "Hello from Session bean";}
    When I lookup and use this bean in servlet in the following way, everything is OK:
    public class MyServlet extends HttpServlet {
    @EJB() MySessionLocal mySession;
    protected void doPost(HttpServletRequest request, HttpServletResponse response) {
    out.println(mySession.getInfo());
    On the other side, when I create some java bean object as a facade, import and use it in servlet , it doesn't work:
    public class Facade {
    @EJB() MySessionLocal mySession;
    public String getInfo() { return mySession.getInfo();}
    public class MyServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) {
    Facade myFacade = new Facade();
    out.println(myFacade.getInfo());
    When servlet runs and gets to the command myFacade.getInfo(), NullPointerException is thrown, because mySession object in myFacade is null (ejb lookup method probably fails to perform...)
    I'm trying to use Facade to be able to use my Session Bean in JSP pages, i.e. to do something like <jsp:useBean id="myFacade" class="Facade" ...>
    Could someone clarify why lookup doesn't work in javabean object, despite the fact that it works in servlets?
    P.S. I'm running the latest promoted build (b31) of GlassFish (maybe this is the cause) and NetBeans IDE...

    Hi,
    Please try this ... http://weblogic-wonders.com/weblogic/2009/08/16/weblogic-10-3-ejb3-local-lookup-sample/ (Lookup from JSP)
    and
    http://weblogic-wonders.com/weblogic/2009/08/15/hello-world-2/  (Lookup/Injection from Servlet)
    Thanks
    Jay SenSharma

  • Enterprise Session Bean Problem

    Dear Experts,
    I have just installed Netweaver Developer Studio 7.1 Composition Environment and is doing some development on it from the tutorial in the following link
    [http://help.sap.com/saphelp_nw04/helpdata/en/c3/679564e11d482f8a706b423f67e56c/content.htm|http://help.sap.com/saphelp_nw04/helpdata/en/c3/679564e11d482f8a706b423f67e56c/content.htm]
    I have created a new EJB Project using the Configuration SAP EJB J2EE 1.4 Project and created a new stateless session bean Calculator. 
    I finished creating the session bean with all the BUSINESS METHODS, but when I expand the project node Calculator in the J2EE Explorer, I CANNOT see the Calculator.java class.  All other classes such as CalculatorBean.java, CalculatorHome.java, etc are present. 
    This is where the problem comes, when I create the JavaBean in the Web Module I will need to access the Calculator.java class and now I cannot access it since it is missing.
    Can you please guide me on how to generate the Calculator.java class in the session bean.
    Points will be rewarded for correct answers.
    Thanks in advance
    Edited by: jamison2004 jordan2004 on May 7, 2008 11:16 AM
    Edited by: jamison2004 jordan2004 on May 7, 2008 11:25 AM

    Hi jamison jordan,
    Maybe you check the CE version of the documentation:
    [Creating Your First J2EE Application|http://help.sap.com/saphelp_nwce10/helpdata/en/c3/679564e11d482f8a706b423f67e56c/frameset.htm]
    kind regards
    Stefanie

  • Static methods in Session Beans problem

    Can a Stateful Session Bean have a static method?
    public static String foo();
    I tried to add a static method to a Stateful Session bean but had two problems:
    When I tried to add the static modifier to the Remote interface:
    static String foo();
    I got the following error message:
    Error(12,17): modifier static not allowed here
    When I tried to compile code calling this function :
    MyClass.foo();
    I got this message:
    Error(795,42): non-static method getNewSuffix(java.lang.String) cannot be referenced from a static context
    Even though a static method was compiled in this class. I assume it can't find the static modifier in the Remote interface which wasn't allowed. Are static methods allowed in EJB's at all?

    dear friend,
    1) Interfaces may not contain static functions!
    2) EJBs doesnt support static methods !
    Maybe you should go and learn more about Java and EJB's ?

  • Multiple session bean problem

    Hi,
    I am developing an admin module to my web app and have created a 2nd session bean to manage data within the admin component of the site just to keep things cleaner and more logical. However there is a problem which I cannot overcome.
    The source code to my main website is located in soulsurfing package. The source code to my admin website is located in soulsurfing.admin package. Inside this package is the java code to my admin web pages and a 2nd session bean called adminSessionBean. So far so good.
    I dropped a database table into my admin page which created a cachedrowset (CustomerRowSet) in my adminSessionBean and a data provider on my admin page (CustomerDataProvider). Ok things are still going well until now.
    There are two main issues i'm facing.
    1. Setting a breakpoint in my code and trying to step through the code line by line (F10) fails whenever the adminSessionBean appears in the line of code. In actuality the system just hangs until I exit debug mode in which the page finishes loading ok. If I step into the code (F11) it still works ok and if there is no breakpoint at all it loads ok too so there is something wrong with the debugger.
    2. Most importantly there is a problem with either the cachedrowset or the data provider because it simply does not return any data from the database. The sql query works fine in both MySQL and when running from creator too so no problem here. If I put a line of code in to capture the sql statement such as String test_var3 = getAdmin$adminSessionBean().getCustomerRowSet().getStatement().toString() a null exception is thrown. However if I ditch the 2nd session bean (adminSessionBean) and run everything exactly the same through the original session bean (SessionBean1) located in soulsurfing package then it all works fine so there must be conflict somewhere with having multiple session beans perhaps in different packages.
    Can anybody help me?
    Below is the java code to my web page that sets and executes the cachedrowset in the prerender method that is failing. Further below that is the code to my 2nd session bean.
    Thanks.
    customer_list.java
    package soulsurfing.admin;
    import com.sun.rave.web.ui.appbase.AbstractPageBean;
    import com.sun.rave.web.ui.component.Body;
    import com.sun.rave.web.ui.component.Form;
    import com.sun.rave.web.ui.component.Head;
    import com.sun.rave.web.ui.component.Html;
    import com.sun.rave.web.ui.component.Link;
    import com.sun.rave.web.ui.component.Page;
    import javax.faces.FacesException;
    import com.sun.rave.web.ui.component.TextField;
    import com.sun.rave.web.ui.component.Button;
    import com.sun.rave.web.ui.component.PageSeparator;
    import com.sun.rave.web.ui.component.StaticText;
    import com.sun.rave.web.ui.component.Table;
    import com.sun.rave.web.ui.component.TableRowGroup;
    import com.sun.rave.web.ui.component.TableColumn;
    import com.sun.data.provider.impl.CachedRowSetDataProvider;
    import com.sun.rave.web.ui.component.MessageGroup;
    import com.sun.rave.web.ui.model.DefaultTableDataProvider;
    public class customer_list extends AbstractPageBean {
        private int __placeholder;
        private void _init() throws Exception {
            customerDataProvider.setCachedRowSet((javax.sql.rowset.CachedRowSet)getValue("#{adminSessionBean.customerRowSet}"));
        private Page page1 = new Page();
        public Page getPage1() {
            return page1;
        public void setPage1(Page p) {
            this.page1 = p;
        private Html html1 = new Html();
        public Html getHtml1() {
            return html1;
        public void setHtml1(Html h) {
            this.html1 = h;
        private Head head1 = new Head();
        public Head getHead1() {
            return head1;
        public void setHead1(Head h) {
            this.head1 = h;
        private Link link1 = new Link();
        public Link getLink1() {
            return link1;
        public void setLink1(Link l) {
            this.link1 = l;
        private Body body1 = new Body();
        public Body getBody1() {
            return body1;
        public void setBody1(Body b) {
            this.body1 = b;
        private Form form1 = new Form();
        public Form getForm1() {
            return form1;
        public void setForm1(Form f) {
            this.form1 = f;
        private TextField textField1 = new TextField();
        public TextField getTextField1() {
            return textField1;
        public void setTextField1(TextField tf) {
            this.textField1 = tf;
        private TextField textField2 = new TextField();
        public TextField getTextField2() {
            return textField2;
        public void setTextField2(TextField tf) {
            this.textField2 = tf;
        private Button button1 = new Button();
        public Button getButton1() {
            return button1;
        public void setButton1(Button b) {
            this.button1 = b;
        private Button button2 = new Button();
        public Button getButton2() {
            return button2;
        public void setButton2(Button b) {
            this.button2 = b;
        private PageSeparator pageSeparator1 = new PageSeparator();
        public PageSeparator getPageSeparator1() {
            return pageSeparator1;
        public void setPageSeparator1(PageSeparator ps) {
            this.pageSeparator1 = ps;
        private StaticText staticText1 = new StaticText();
        public StaticText getStaticText1() {
            return staticText1;
        public void setStaticText1(StaticText st) {
            this.staticText1 = st;
        private StaticText staticText2 = new StaticText();
        public StaticText getStaticText2() {
            return staticText2;
        public void setStaticText2(StaticText st) {
            this.staticText2 = st;
        private Table table1 = new Table();
        public Table getTable1() {
            return table1;
        public void setTable1(Table t) {
            this.table1 = t;
        private TableRowGroup tableRowGroup1 = new TableRowGroup();
        public TableRowGroup getTableRowGroup1() {
            return tableRowGroup1;
        public void setTableRowGroup1(TableRowGroup trg) {
            this.tableRowGroup1 = trg;
        private MessageGroup messageGroup1 = new MessageGroup();
        public MessageGroup getMessageGroup1() {
            return messageGroup1;
        public void setMessageGroup1(MessageGroup mg) {
            this.messageGroup1 = mg;
        private CachedRowSetDataProvider customerDataProvider = new CachedRowSetDataProvider();
        public CachedRowSetDataProvider getCustomerDataProvider() {
            return customerDataProvider;
        public void setCustomerDataProvider(CachedRowSetDataProvider crsdp) {
            this.customerDataProvider = crsdp;
        private TableColumn tableColumn2 = new TableColumn();
        public TableColumn getTableColumn2() {
            return tableColumn2;
        public void setTableColumn2(TableColumn tc) {
            this.tableColumn2 = tc;
        private StaticText staticText4 = new StaticText();
        public StaticText getStaticText4() {
            return staticText4;
        public void setStaticText4(StaticText st) {
            this.staticText4 = st;
        private TableColumn tableColumn3 = new TableColumn();
        public TableColumn getTableColumn3() {
            return tableColumn3;
        public void setTableColumn3(TableColumn tc) {
            this.tableColumn3 = tc;
        private StaticText staticText5 = new StaticText();
        public StaticText getStaticText5() {
            return staticText5;
        public void setStaticText5(StaticText st) {
            this.staticText5 = st;
        private TableColumn tableColumn11 = new TableColumn();
        public TableColumn getTableColumn11() {
            return tableColumn11;
        public void setTableColumn11(TableColumn tc) {
            this.tableColumn11 = tc;
        private StaticText staticText13 = new StaticText();
        public StaticText getStaticText13() {
            return staticText13;
        public void setStaticText13(StaticText st) {
            this.staticText13 = st;
        public customer_list() {
        protected adminSessionBean getAdmin$adminSessionBean() {
            return (adminSessionBean)getBean("admin$adminSessionBean");
        protected soulsurfing.ApplicationBean1 getApplicationBean1() {
            return (soulsurfing.ApplicationBean1)getBean("ApplicationBean1");
        protected soulsurfing.SessionBean1 getSessionBean1() {
            return (soulsurfing.SessionBean1)getBean("SessionBean1");
        protected soulsurfing.RequestBean1 getRequestBean1() {
            return (soulsurfing.RequestBean1)getBean("RequestBean1");
        public void init() {
            super.init();
            try {
                _init();
            } catch (Exception e) {
                log("customer_list Initialization Failure", e);
                throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
        public void preprocess() {
        public void prerender() {
            try {
                if (getAdmin$adminSessionBean().getFilter1().equalsIgnoreCase("")) {
                    getAdmin$adminSessionBean().getCustomerRowSet().setString(1, "%");
                } else {
                    getAdmin$adminSessionBean().getCustomerRowSet().setString(1, getAdmin$adminSessionBean().getFilter1());
                if (getAdmin$adminSessionBean().getFilter1().equalsIgnoreCase("")) {
                    getAdmin$adminSessionBean().getCustomerRowSet().setString(2, "%");
                } else {
                    getAdmin$adminSessionBean().getCustomerRowSet().setString(2, getAdmin$adminSessionBean().getFilter2());
                getAdmin$adminSessionBean().getCustomerRowSet().execute();
                customerDataProvider.refresh();
                customerDataProvider.cursorFirst();
                getAdmin$adminSessionBean().setRowCount(customerDataProvider.getRowCount());
                getAdmin$adminSessionBean().setMsg(getAdmin$adminSessionBean().getRowCount() + " records returned.");
                //i have a breakpoint here which hangs when stepping over code however works if breakppoint not set
                String test_var1 = getAdmin$adminSessionBean().getFilter1();
                int test_var2 = getAdmin$adminSessionBean().getRowCount();
            } catch (Exception e) {
                log("Exception occurred!!", e);
                error("Error: "+e.getMessage()); //null exception is being caught
        public void destroy() {
            customerDataProvider.close();
    adminSessionBean.java
    package soulsurfing.admin;
    import com.sun.rave.web.ui.appbase.AbstractSessionBean;
    import javax.faces.FacesException;
    import com.sun.sql.rowset.CachedRowSetXImpl;
    public class adminSessionBean extends AbstractSessionBean {
        private int __placeholder;
        private void _init() throws Exception {
            customerRowSet.setDataSourceName("java:comp/env/jdbc/SoulSurfing_User");
            customerRowSet.setCommand("SELECT * \nFROM customer ");
            customerRowSet.setTableName("customer");
        private CachedRowSetXImpl customerRowSet = new CachedRowSetXImpl();
        public CachedRowSetXImpl getCustomerRowSet() {
            return customerRowSet;
        public void setCustomerRowSet(CachedRowSetXImpl crsxi) {
            this.customerRowSet = crsxi;
        public adminSessionBean() {
        protected soulsurfing.ApplicationBean1 getApplicationBean1() {
            return (soulsurfing.ApplicationBean1)getBean("ApplicationBean1");
        public void init() {
            super.init();
            try {
                _init();
            } catch (Exception e) {
                log("adminSessionBean Initialization Failure", e);
                throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
        public void passivate() {
        public void activate() {
        public void destroy() {
        private String filter1 = "";
        public String getFilter1() {
            return this.filter1;
        public void setFilter1(String filter1) {
            this.filter1 = filter1;
        private String filter2 = "";
        public String getFilter2() {
            return this.filter2;
        public void setFilter2(String filter2) {
            this.filter2 = filter2;
        private int rowCount;
        public int getRowCount() {
            return this.rowCount;
        public void setRowCount(int rowCount) {
            this.rowCount = rowCount;
        private String msg;
        public String getMsg() {
            return this.msg;
        public void setMsg(String msg) {
            this.msg = msg;
    }

    Hi Harini,
    What I didn't explain in my initial post is that there are more than 2 views in my application.  There are a total of 9 jsp's so far, so I coded multiple controllers due to the high amount of views.  After taking the HTMLB training class, I noticed that the examples used contained no more than 2 jsp's, so only 1 controller was needed.
    However, I talked with another Portal developer, and he suggested that it would be simpler to code the application using only 1 controller.  The problem is, I will have 1 LOOOOONG controller since there are many buttons across all of the jsp's (hence many events that will need to be handled) and many beans that need to be populated.
    Harini, thanks very much for offering to view my par file.  I think I have solved the problem on my own, but could you let me know what the design standard is for an application of this size?  Think of an online banking application that needs to handle bill payment (paying the bill, viewing past payments, etc.,).
    Would you use 1 controller for this type of application?
    Thanks very much for your help.
    -Jamie

  • EJB3 session bean injection

    Hi,I have a problem about @EJB in session bean.
    There are 2 session beans, SessionBeanA & SessionBeanB
    in SessionBeanA:
    @EJB(beanName="SessionBeanB")
    SessionBeanBInterface sessionBeanB;
    in SessionBeanB:
    @EJB(beanName="SessionBeanA")
    SessionBeanAInterface sessionBeanA;
    when deploy the ejb, jboss will consider that SessionBeanA depends on SessionBeanA , and SessionBeanA depends on SessionBeanB, so jboss will output that:
    --- MBeans waiting for other MBeans ---
    What's the problem?How to solve it?
    Thanks.

    If they're both stateful session beans, it is an application error, since in that case injection has the side effect of creating a new stateful session bean identity. Allowing that would result in an infinite loop.
    If at least one is a stateless session bean, there's nothing wrong with the code. EJB references are always proxies. There is no notion of initialization ordering dependencies between such beans if they're packaged in the same application. In this case the JBoss container would be restricting something that is allowed by the EJB specification so it's a JBoss bug.

  • EJB3 Session Bean from webproject (Netbeans 5.5.1 with Visual Web)

    I've been using J2EE 2 Sessoin Beans for some time but looking into moving into the new JavaEE EBJ3. I'm attempting to create a new enterprise project in netbeans and instead of using the web project that it creates I've created a visual web project and attached it to the enterprise project. Everything works great other than the fact that I cannot looking any Session Beans in my context. The logic that is calling the session bean lookup in the Bean of the webpage using JSF. Upon an action being called I'm attempting to lookup the session bean but I get name NameNotFound everyway I try. Below is the sample code. I'm trying injection but it doesn't appear to work from with the JSF Model Bean.
    * Page1.java
    * Created on September 1, 2007, 1:00 AM
    * Copyright smileyq
    package demo;
    import com.demo.aps.ejb.session.AuthenticationManagerLocal;
    import com.demo.aps.ejb.session.HelloWorldLocal;
    import com.demo.aps.model.AuthCredentials;
    import com.sun.rave.web.ui.appbase.AbstractPageBean;
    import com.sun.rave.web.ui.component.Body;
    import com.sun.rave.web.ui.component.Button;
    import com.sun.rave.web.ui.component.Form;
    import com.sun.rave.web.ui.component.Head;
    import com.sun.rave.web.ui.component.Html;
    import com.sun.rave.web.ui.component.Link;
    import com.sun.rave.web.ui.component.Page;
    import com.sun.rave.web.ui.component.PasswordField;
    import com.sun.rave.web.ui.component.StaticText;
    import com.sun.rave.web.ui.component.TextField;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.ejb.EJB;
    import javax.faces.FacesException;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    * <p>Page bean that corresponds to a similarly named JSP page.  This
    * class contains component definitions (and initialization code) for
    * all components that you have defined on this page, as well as
    * lifecycle methods and event handlers where you may add behavior
    * to respond to incoming events.</p>
    public class Page1 extends AbstractPageBean
        // <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
        private int __placeholder;
        @EJB private HelloWorldLocal hwLocalRef;
         * <p>Automatically managed component initialization.  <strong>WARNING:</strong>
         * This method is automatically generated, so any user-specified code inserted
         * here is subject to being replaced.</p>
        private void _init () throws Exception
        private Page page1 = new Page ();
        public Page getPage1 ()
            return page1;
        public void setPage1 (Page p)
            this.page1 = p;
        private Html html1 = new Html ();
        public Html getHtml1 ()
            return html1;
        public void setHtml1 (Html h)
            this.html1 = h;
        private Head head1 = new Head ();
        public Head getHead1 ()
            return head1;
        public void setHead1 (Head h)
            this.head1 = h;
        private Link link1 = new Link ();
        public Link getLink1 ()
            return link1;
        public void setLink1 (Link l)
            this.link1 = l;
        private Body body1 = new Body ();
        public Body getBody1 ()
            return body1;
        public void setBody1 (Body b)
            this.body1 = b;
        private Form form1 = new Form ();
        public Form getForm1 ()
            return form1;
        public void setForm1 (Form f)
            this.form1 = f;
        private StaticText staticText1 = new StaticText ();
        public StaticText getStaticText1 ()
            return staticText1;
        public void setStaticText1 (StaticText st)
            this.staticText1 = st;
        private TextField usernameTxt = new TextField ();
        public TextField getUsernameTxt ()
            return usernameTxt;
        public void setUsernameTxt (TextField tf)
            this.usernameTxt = tf;
        private PasswordField passwordTxt = new PasswordField ();
        public PasswordField getPasswordTxt ()
            return passwordTxt;
        public void setPasswordTxt (PasswordField pf)
            this.passwordTxt = pf;
        private Button loginBtn = new Button ();
        public Button getLoginBtn ()
            return loginBtn;
        public void setLoginBtn (Button b)
            this.loginBtn = b;
        // </editor-fold>
         * <p>Construct a new Page bean instance.</p>
        public Page1 ()
         * <p>Callback method that is called whenever a page is navigated to,
         * either directly via a URL, or indirectly via page navigation.
         * Customize this method to acquire resources that will be needed
         * for event handlers and lifecycle methods, whether or not this
         * page is performing post back processing.</p>
         * <p>Note that, if the current request is a postback, the property
         * values of the components do <strong>not</strong> represent any
         * values submitted with this request.  Instead, they represent the
         * property values that were saved for this view when it was rendered.</p>
        public void init ()
            // Perform initializations inherited from our superclass
            super.init ();
            // Perform application initialization that must complete
            // *before* managed components are initialized
            // TODO - add your own initialiation code here
            // <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
            // Initialize automatically managed components
            // *Note* - this logic should NOT be modified
            try
                _init ();
            catch (Exception e)
                log ("Page1 Initialization Failure", e);
                throw e instanceof FacesException ? (FacesException) e: new FacesException (e);
            // </editor-fold>
            // Perform application initialization that must complete
            // *after* managed components are initialized
            // TODO - add your own initialization code here
         * <p>Callback method that is called after the component tree has been
         * restored, but before any event processing takes place.  This method
         * will <strong>only</strong> be called on a postback request that
         * is processing a form submit.  Customize this method to allocate
         * resources that will be required in your event handlers.</p>
        public void preprocess ()
         * <p>Callback method that is called just before rendering takes place.
         * This method will <strong>only</strong> be called for the page that
         * will actually be rendered (and not, for example, on a page that
         * handled a postback and then navigated to a different page).  Customize
         * this method to allocate resources that will be required for rendering
         * this page.</p>
        public void prerender ()
         * <p>Callback method that is called after rendering is completed for
         * this request, if <code>init()</code> was called (regardless of whether
         * or not this was the page that was actually rendered).  Customize this
         * method to release resources acquired in the <code>init()</code>,
         * <code>preprocess()</code>, or <code>prerender()</code> methods (or
         * acquired during execution of an event handler).</p>
        public void destroy ()
         * <p>Return a reference to the scoped data bean.</p>
        protected SessionBean1 getSessionBean1 ()
            return (SessionBean1)getBean("SessionBean1");
         * <p>Return a reference to the scoped data bean.</p>
        protected RequestBean1 getRequestBean1 ()
            return (RequestBean1)getBean("RequestBean1");
         * <p>Return a reference to the scoped data bean.</p>
        protected ApplicationBean1 getApplicationBean1 ()
            return (ApplicationBean1)getBean("ApplicationBean1");
        public String loginBtn_action ()
            // TODO: Process the button click action. Return value is a navigation
            // case name where null will return to the same page.
            AuthCredentials credentials = new AuthCredentials();
            credentials.setUsername (usernameTxt.getText ().toString ());
            credentials.setPassword (passwordTxt.getText().toString ());
            hwLocalRef.printHello ();
            return null;
    }

    Hi,
    I've had the very same problem with RAD.
    Try to set the Transaction attribute to SUPPORTS. With SUPPORTS the EJB method will use the same transaction as the caller.
    package hu.bme.ett.raktar.facade;
    import hu.bme.ett.raktar.ejbs.Raktar;
    import hu.bme.ett.raktar.ejbs.controller.RaktarManager;
    import javax.ejb.Stateless;
    import javax.ejb.TransactionAttribute;
    import javax.ejb.TransactionAttributeType;
    @Stateless
    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
    public class RaktarListazas implements RaktarListazasLocal {
         RaktarManager rm = new RaktarManager();
         * Default constructor.
        public RaktarListazas() {
            // TODO Auto-generated constructor stub
        public Raktar getRaktar(long raktId) {
             return rm.findRaktarByRaktId(raktId);
        public void createRaktar(long raktId) {
             Raktar r = new Raktar();
             r.setRaktId(raktId);
             r.setRaktAzonosito("Y1RAK-01" + raktId);
             r.setMegnevezes("Elso raktaram");
             try {
                   rm.createRaktar(r);
              } catch (Exception e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    }Cheers,
    Viktor

  • Add session bean problems

    i tried to add session bean sets, but when i reach the 'configure EJB methods' dialog box, i cannot proceed to click on button 'finish' because of the errors "one or more collection element types are not specified: [getAuthorizerId] ".
    how to fix it??? thanx.

    this is the getAuthorizerId methods that i have written.
    public List getAuthoId (String code)throws HibernateException{
              Session ses = null;
                   try{
                        boolean trace = logger.isTraceEnabled();
                        if(trace)
                             logger.trace("Begin to search Authorizer code " + code);                    
                        ses = ThreadLocalSession.currentSession();          
                        Query query = ses.createQuery("from Authorizer as authorizer where authorizer.authoId=?");
                        query.setString(0, code);
                        List result = query.list();
                        ses.flush();
                        if(trace)
                             logger.trace("End of searching authorizer code " + code);
                        return result;
                   } catch (HibernateException e) {
                        ctx.setRollbackOnly();
                        throw new HibernateException("Unable to search authorizer code " + code, e);
                   }finally{
                        try {
                             ThreadLocalSession.closeSession();
                        } catch (HibernateException e1) {
                             e1.printStackTrace();
    is it because jsc cannot support java.util.list??

  • Flex + Glassfish EJB3 stateless session bean

    Hi, I'm new to Flex. We´re in the process of adopting a
    front end web technology. In the Server side we have a JavaEE
    Application with several EJB3 session beans deployed in Glassfish
    V2ur1. I just wonder if someone could lead me to a sample flex
    application that access stateless EJB3 session beans that return
    Entity Beans. Which is the best approach? Could anybody share some
    sample code with me? Thanks a lot.
    My mail is [email protected]

    Hi,
    1) First of all you'll need to download and deploy LiveCycle
    Data Services or BlazeDS on your application server.
    2) Then download the Flex EJB factory from Adobe Exchange (
    http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=1089970)
    and add it to your Data Services.
    3) Declare your session beans as destinations in
    remoting-config.xml
    I remember having trouble to get it working on Glassfish so
    for Flex/EJB3 development I switched to JBoss. Maybe newer versions
    of Glassfish and Data Services will work together more easily.
    After setting up the server-side part you invoke session
    beans just like any other RemoteObjects (see Flex docs).
    Good luck :)

  • Session bean as web service using JAXB

    Hi all,
    can anybody answer my question:
    I have created java classes from XSD files using JDeveloper JAXB compilation. Is it possible to use these classes as parameters for webservice created as ejb3 session bean?
    I'have tried but got this error when invoked web service method:
    <env:Body>
    <env:Fault>
    <faultcode>env:Client</faultcode>
    <faultstring>Caught exception while handling request: deserialization error: java.lang.NullPointerException</faultstring>
    </env:Fault>
    </env:Body>
    </env:Envelope>
    thanks,
    Aigars

    Hi Torstein,
    <i>Seems to me that the problem is related to the msg sent to AE:
    "HTTP response contains status code 401 with the description Unauthorized XML tag Envelope missing in SOAP message header (SAP XI Extension)"
    </i>
    According to you, the problem occurs within the SOAP envelope. Does your incoming SOAP message looks like the one below here?
    If that's not the case, then make sure your SOAP/Web Service client is sending a valid SOAP envelope/request (like the sample below) to XI.
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <!--  Inbound Message -->
    <SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'>
    <SOAP:Header/>
    <SOAP:Body>
    <ns1:WebServiceRequest xmlns:ns1='http://company.com/xi/webservice/myws' SOAP:actor='http://schemas.xmlsoap.org/soap/encoding/' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
    <Customer xsi:type='xsd:string'>000025</Customer>
    <CompanyCode xsi:type='xsd:string'>BE01</CompanyCode>
    <KeyDate xsi:type='xsd:string'>20050310</KeyDate>
    <Selection>
    <OpenItems xsi:type='xsd:string'>X</OpenItems>
    <ClearItems xsi:type='xsd:string'></ClearItems>
    <GLItems xsi:type='xsd:string'></GLItems>
    <Dunning>
    <From xsi:type='xsd:string'>A</From>
    <To xsi:type='xsd:string'>Z</To>
    </Dunning>
    </Selection>
    </ns1:WebServiceRequest>
    </SOAP:Body>
    </SOAP:Envelope>
    Cheers,
    R.

  • Problem Deploying EJB3 Stateless session bean in Jboss4.0.3

    Hi All,
    I have developed an EJB 3 Stateless session bean and tried to deploy in JBoss 4.0.3 , But i get the following Exception.
    javax.naming.NameNotFoundException: ejb not bound
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
    at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
    at org.jnp.server.NamingServer.lookup(NamingServer.java:249)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
    at javax.naming.InitialContext.lookup(InitialContext.java:351)
    at org.apache.jsp.session_jsp._jspService(org.apache.jsp.session_jsp:69)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    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:81)
    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.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:157)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    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:856)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
    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)
    I am sorry if the question is silly..... My Remote Interface will be one like this
    import javax.ejb.Remote;
    @Remote
    public interface CityService {
         public String getCity();
    And My Bean Class will be
    import javax.ejb.EJB;
    import javax.ejb.Remote;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.EntityTransaction;
    import javax.persistence.PersistenceContext;
    import javax.persistence.Query;
    @EJB
    @Remote(CityService.class)
    @Stateless(mappedName="ejb/CityService")
    public class CityServiceBean implements CityService {
    public String getCity(){
    return "Chennai Metropolitan";
    And the client which invokes the bean will be
    InitialContext ctx = new InitialContext();
    CityService c = (CityService)ctx.lookup("ejb/CityService");
    System.out.println("Msg from Bean"+c.getCity());
    please help me out of this issue....
    Thanks in advance

    ford wrote:
    If you deploy your application in a .ear, you also can use this:
    You have to set a name to your EJBBean -> @Stateless(name = "XXX")
    The client for remote interface -> cxt.lookup(Name_of_your_own_ear_without_extension + "/XXX/Remote");
    The client for local interface -> cxt.lookup(Name_of_your_own_ear_without_extension + "/XXX/Local");the problem with this approach is that if you version your ears, the version numbers show up in the jndi names, and your client code will be hard coded to specific server versions.

  • Creating EJB 3.0 Session Bean under JDeveloper 10g.

    Hello im using JDeveloper 10 g all up 2 date.
    when i create EJB 2.x EJB everythink is ok .. there is a Wizzard(Designer) from which i can add methods variables and etc.
    all methods are become added to the session bean / remote interefeis etc.
    My Problem is when i create EJB 3.0
    when i do it the Bean class is created and the Remote interfeis with @remote is created too its ok BUT I CANT see Remote interfeis in my Application Naviagation its fine under 2.1 i cannot see remote interfeis and home interfeis too but inder 2.1 there is a wizzard(Designer) under 3.0 there is nothink.
    what am i wrong ? how can i make designer to work under 3.0 or how can i make Jdeveloper to show me all content of the EJBs

    another strange problem.
    i have an APplication server added ( JBOSS ).
    when i create deployment profile (EAR ) application server is showed in the ComboBox .
    But when i create Java Test Client for some EJB and when i check " Connect Remote Application server" there is 2 comboboxes
    J2EE Application
    App Server Connection.
    first combo is ok there is EJB applicaiton
    Secound is empty .. but i Have App Server.
    Another think is that when i create EJB 3.0 its BAD to see J2EE app it must be J EE 5 app or just Java EE app

  • EJB3 Design Patterns (Session Beans)

    I've been learning about EJB3 and JSF as a potential technology for a new web app. As part of my learning about EJB3 and JSF, I came across this tutorial on the NetBeans site:
    http://www.netbeans.org/kb/55/ejb30.html
    In the tutorial there is one entity class, NewsEntity, from which a session bean is created, NewsEntityFacade and the interface NewsEntityFacadeLocal. It seems a little weird to me that the interface is called NewsEntityFacadeLocal and the implementing class called NewsEntityFacade. I would think that the interface should be called NewsEntityFacade and the implementing class NewsEntityFacadeLocal.
    Question 1: Can anyone explain why the names are backwards (at least to my thinking)?
    Also, I've been trying to find some best practices on EJB3 design patterns, but haven't come up with much. I did find some at https://blueprints.dev.java.net/bpcatalog/ee5/persistence/ejbfacade.html. Based on this pattern and the NetBeans tutorial, I think I've come across two different patterns, but since most of the examples are very simple, it's hard to tell.
    Question 2: Are these two distinct patterns?
    1. Session facade/entity (NB example)
    2. Session facade which groups business logic and may reference multiple entity beans.
    Question 3: If I have identified two patterns, can anyone tell me what they consider the pros/cons of either/both?
    Thanks in advance!

    The SRDemo available as an automatic update in JDeveloper 10.1.3.0.4 shows an application using local EJB 3.0 session beans. To access them in the web application you will need an entry in the web.xml like:
      <ejb-local-ref>
        <ejb-ref-name>ejb/local/SRPublicFacade</ejb-ref-name>
        <ejb-ref-type>Session</ejb-ref-type>
        <local>oracle.srdemo.model.SRPublicFacade</local>
        <ejb-link>SRPublicFacade</ejb-link>
      </ejb-local-ref>To lookup the session bean within you presentation you need to do a JNDI lookup. In my example I have:
    new InitialContext().lookup("java:comp/env/ejb/local/SRPublicFacade");Doug

Maybe you are looking for

  • Gray screen after try to install 2 os in macbook pro

    Hi, I tried to isntall 2 mac os in my mac book pro and end up without  os in mac book now my machine is starting with sartup sound but after this it is reaching to gray screen and not going ahead. I hold the option key at time of sarting, my mac book

  • Updating to 2.0 fails

    i am trying to upgrade my iphone and when i hit the update button it says 1.1.4 is the current version. is there something wrong with the server? i waited all day to get my iphone upgraded and it fails can someone help?

  • Error installing Camera Raw 7.2 Update

    I am trying to install the Camera Raw 7.2 Update for Photoshop CS6. When I try to install I get this error message: Photoshop Camera Raw 7.2 There was an error installing this update. Please quit and try again later. Error Code: U44M2I218 I have rebo

  • Huge slowdown/clunkines/colored wheel

    I have no idea what has happened, but lately, my Mac's internal hard disk (1TB) can be clearly heard thrashing about doing god knows what, several times a day. It sounds like it is saving some colossal file or groups of files, but I have no such file

  • A few problems with install on Macbook 2,1

    I used diskutil to set a 4G SWAP partition, and a HFS+ Arch partition.  Did not make a separate boot partition.  I downloaded and installed rEFit.  Went through the Macbook Install wiki, but grub would not install on /dev/sda3 even with the sfdisk -c