Problem returning Vector in Bean Model

Hi All,
I am returning a Vector from my bean.I have a EJB which connects to an RFC.To use this EJB, I have created a java bean(plain java bean) which executes this RFC in the EJB.The result is returned by the RFC in a SAP Table.I extract all returned data in a Vector in my java bean.When i create a Model from this java bean jar file , I am able to get the string variables which i had defined in my bean and am able to map them to my Controller context but am not able to map my Vector which contains the outpout.
Could you please let me know how i can map the vector from the model to the context.I dont get the option of choosing the vector for mapping when i am creating the Model.
Thanks a lot.
Saurav

Hi,
Normally, the MApping does not leave out the context attributes in this fashion.
Anyways, a DTO is simply a class that groups all the parameters of a method together in one class. For Example:
Original: public void someMethod(String one, int two, Vector three, Employee four){
//code
New: Create a class called Something.java with attributes:
public class Something{
String one; int two; Vector three; Employee four;
// blank constructor, parameterized constructor and getters and setters for attributes are all necessary
Finally re-expose the web service and  reimport the model.
You will se the parameter.
Note: The main reason that you are not seeing the Vector class is probably because you may not have a DTO with a blank and parameterized constructor in the EJB.
Hope that helps.
Thanks.
p256960

Similar Messages

  • Problem when importing the complex bean model into webdynpro

    hi all,
    when importing the complex bean model into the webDynpro, it was returning the blank.
    Thanks in advance

    Hi,
      show your code for see and understand what could be wrong.
    Here one mine example:
    The model class
    * Created on 27-ott-2006
    * To change the template for this generated file go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    package tmp.userslist.comp.model.userslist;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import javax.sql.DataSource;
    import java.util.Collection;
    import java.util.ArrayList;
    import java.io.Serializable;
    * @author rtagliento
    * To change the template for this generated type comment go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    public class AllUsers {
    // implements Serializable {
         private Connection con;
         private ResultSet rs;
         private Statement stmt;
         private String SqlQuery;
         private Collection usersList = null;
         private UserElement users = null;
    //     private Collection empDetailsList=null;
    //     private EmpDetailsHelperClass  empdetails=null;
         public AllUsers(){
              con = null;     
              java.sql.ResultSet rs = null;
              rs = null;
              SqlQuery  = "SELECT * FROM TMP_USERSLIST ; ";
         public Connection getConnection (){
                   return con;
         public void setConnection (Connection c){
              con = c;
         public Collection getUsersList()
              return usersList;
         public UserElement getUsers()
              return users;
         public void setUsers(UserElement class1)
              users = class1;
         public void execute() throws Exception {
              String DEBUG = new String("");
              try {
                   stmt = con.createStatement();
                   rs = stmt.executeQuery(SqlQuery);
                   usersList = new ArrayList();
                   usersList.clear();
                   while (rs.next()){
                        users = new UserElement();
                        users.setID(rs.getString("ID"));
                        DEBUG += "ID: " + rs.getString("ID") + " | ";
                        users.setName(rs.getString("NAME"));
                        DEBUG += "NAME: " + rs.getString("NAME") + " | ";
                        users.setSurname(rs.getString("SURNAME"));
                        DEBUG += "SURNAME: " + rs.getString("SURNAME") + " | ";
                        users.setBirthDay(rs.getDate("BIRTHDAY"));
                        DEBUG += "BIRTHDAY: " + rs.getDate("BIRTHDAY").toString() + " ---------- ";
                        usersList.add(users);
                   rs.close();
              } catch (Exception e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
                   throw new Exception(e.toString() + DEBUG);
    //          throw new Exception(new Integer(usersList.size()).toString() + DEBUG);
    when use it:
         AllUsers AllU = new AllUsers();
    //     AllU.setConnection(myJdbc.getConnection());
         wdContext.nodeAllUsers().bind(AllU);
         wdContext.currentAllUsersElement().setConnection(myJdbc.getConnection());
         try {
              wdContext.currentAllUsersElement().modelObject().execute();
         } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
    Hope can help.
    Bye

  • A simple problem with sateful Session beans

    Hi,
    I have a really novice problem with stateful session bean in Java EE 5.
    I have written a simple session bean which has a counter inside it and every time a client call this bean it must increment the count value and return it back.
    I have also created a simple servlet to call this session bean.
    Everything seemed fine I opened a firefox window and tried to load the page, the counter incremented from 1 to 3 for the 3 times that I reloaded the page then I opened an IE window (which I think is actually a new client) but the page counter started from 4 not 1 for the new client and it means that the new client has access to the old client session bean.
    Am I missing anything here???
    Isn�t it the way that a stateful session bean must react?
    This is my stateful session bean source.
    package test;
    import javax.ejb.Stateful;
    @Stateful
    public class SecondSessionBean implements SecondSessionRemote
    private int cnt;
    /** Creates a new instance of SecondSessionBean */
    public SecondSessionBean ()
    cnt=1;
    public int getCnt()
    return cnt++;
    And this is my simple client site servlet
    package rezaServlets;
    import java.io.*;
    import java.net.*;
    import javax.ejb.EJB;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import test.SecondSessionRemote;
    public class main extends HttpServlet
    @EJB
    private SecondSessionRemote secondSessionBean;
    protected void processRequest (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 main</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<h1>Our count is " + Integer.toString (secondSessionBean.getCnt ()) + "</h1>");
    out.println("</body>");
    out.println("</html>");
    out.close ();
    protected void doGet (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    processRequest (request, response);
    protected void doPost (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    processRequest (request, response);
    }

    You are injecting a reference to a stateful session bean to an instance variable in the servlet. This bean instance is shared by all servlet request, and that's why you are seeing this odd behavior.
    You can use type-leve injection for the stateful bean, and then lookup the bean inside your request-processing method. You may also save this bean ref in HttpSession.
    @EJB(name="ejb/foo", beanName="SecondBean", beanInterface="com.foo.foo.SecondBeanRemote")
    public MyServlet extends HttpServlet {
    ic.lookup("java:comp/env/ejb/foo");
    }

  • Expose EJB through Java Bean model importer in Web Dynpro

    Hi,
    I am planning to expose EJB like following:
    1. Create Stateless session bean as a façade for DAO access.
    2. Create DAO to access database. In my case is Oracle DB
    3. Create Java Bean to encapsulate session bean
    4. Import java bean model to web dynpro
    Few of my business method return the object array e.g. Customer[] which contains all properties of customer, and getter, setter.
    Has anyone done this before? Is there any sample code?
    Best Regards,
    Zhang Yan

    Hi
    I think u can refer to the following link
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/java/simple java bean generator for database.pdf
    Thought this link is also Useful
    Creating and Deploying Web Services for an EJB
    Wishes
    Krishna kanth

  • Calling Portal Service using result as Java Bean Model impossible?

    Hello folks,
    we try to achieve to call a portal service (working) which gives as a result a list of object of type com.foo.Report. We want to make use of this class as a model class, so we have the class as a model node in the context. The class itself is part of the service DC.
    Unfortunately at run time it gives us a NoClassDefFound Exception of com.foo.Report.
    As the com.foo.Report is part of the same DC as the service, it is no option to add the PAR public part to the used DCs of the WD DC because then there is this type conflict when we call the service (service look up). Or am I wrong and this is the way to do it? I mean I struggled quite a while to get the service look up right and needed to remove all the PAR/lib used DCs from the used DCs of the WD Project, when I got it working this Model error came up. I also tried to put the Model class in a separate DC but that caused the same error.
    how is it possible to call a Portal service from WD and using it's return vale as a Model class
    our system iis 7.0.17
    best
    Stefan

    Hi,
    Refers the following docs..
    EJBs in Web Dynpro Application Using Wrapper Class
    Here Java Bean Model used in web dynpro.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00be903b-8551-2b10-c28a-8520400c6451
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1f5f3366-0401-0010-d6b0-e85a49e93a5c
    Accessing database table using EJB and web dynpro
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70929198-0d36-2b10-04b8-84d90fa3df9c
    Oracle Connectivity with EJB using WebDynpro Application
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdjava/oracle%2bconnectivity%2bwith%2bejb%2busing%2bwebdynpro%2bapplication
    Hope it will help u.
    thanks
    Abhilasha

  • Return vector for points done of check buffer status in onboard program

    Background
    I am trying to develop a trigger application based on the current position of a contour profile.
    I can not use breakpoints as the application is using hydraulic cylinders with analog feedback
    for the primary position. In order to make sure the trigger happens relative to the motion regardless
    of host load I want to run the application as an onboard program.
    My idea is to read the buffer status points done and generate a pulse out as a trigger when the
    points done is greater than the programmed trigger point. For example if I want to trigger on the 42
    point of a 100 point profile, I would read points done of the main contour buffer. When points done
    is greater than or equal to 42, I would generate a short pulse as a trigger.
    Question
    My problem is, I cannot find the order that the check buffer status VI returns the data to an onboard program
    return vector. As I understand it, I need 3 variables to hold the returned data. One each for State, Backlog, and
    Points Done. If I set the return vector to 10, does State get stored in 10, Backlog in 11, and Points done in 12, or
    is there a different order?
    If you could provide the return vector mapping order for all the motion VIs, it would be greatly appreciated.

    Hello,
    This is a very good question. I checked in the help for the LabVIEW VI, and it does not explicitly state the answer. The VI calls the FlexMotion function "flx_check_buffer_rtn". In the "NI-Motion Function Help" (Start>>Programs>>National Instruments>>NI Motion>>Documentation), the information for the functions states that it "...returns data in the following order: backlog, bufferState, and pointsDone." It also tells you the size of each of the elements. I will be filing a report so that the LabVIEW documentation includes this information in the future. I hope this helps. Take care!
    Regards,
    Aaron B.
    National Instruments

  • SOS problem using one Entity bean for editing records. please help me

    Hello
    I have one great problem using one entity bean 2.1 and i am working with this problem several days and i dont solve it.
    i am using this jb 2.1 for add new records to one oracle database and for editing records.
    I have one great problem for editing records
    I have one objets that is as one of my database table. (PersonaObj.java)
         //personaObj.java
         public class PersonaObj implements Serializable{
              private Integer id_persona; //this ishte database table autonumeric
              private java.lang.String nombre;
              now the set/get methods.
         One field of this objets (bean) is the primary key of the table, and this field is one part of the pk from the entity bean.
         From one session bean i call the entity bena passing the objet
         into the entity bean (interface) i have one methods:
              public getPersona getT56aaat04();
         public void setPersona(PersonaObj obj);
         into the entitybean bean i have:
         public PersonaEntityPK ejbCreate(PersonaObj obj) throws CreateException {
              this.setT56aaat04(obj);
              public abstract Integer getId_persona();
         public abstract void setId_persona(Integer Id_persona);
         public abstract java.lang.String getNombre();
         public abstract void setNombre(java.lang.String Nombre);
         public PersonaObj getPersona() {
              PersonaObj obj = new PersonaObj();
              obj.setId_persona(getId_persona());
              obj.setNombre(getNombre());
              return obj;
         public void setPersona(PersonaObj obj) {
              setId_persona(obj.getId_persona());
              setNombre(obj.getNombre());
    But i have one graet problem.
    adding new record to the database i runs well but if i want to edit one recor appears this error:
    => Error <=
    java.rmi.RemoteException: EJB Exception: ; nested exception is: javax.ejb.EJBException: EJB Exception: : java.lang.IllegalStateException:[EJB:010144]The setXXX method for a primary key field may only be called during ejbCreate.
    at PersonasEJB_a43o8n__WebLogic_CMP_RDBMS.setId_persona(PersonasEntityEJB_a43o8n__WebLogic_CMP_RDBMS.java:328)
    at PersonasEntityBean.setPersona(PersonasEntityBean.java:114)
    at PersonasEntityEJB_a43o8n_ELOImpl.setPersona(PersonasEntityEJB_a43o8n_ELOImpl.java:45)
    at PersonasSessionBean.editarPersona(PersonasSessionBean.java:849)
    at PersonasSessionBean_bszo9t_EOImpl.editarPersona(PersonasSessionBean_bszo9t_EOImpl.java:208)
    at PersonasSessionBean_bszo9t_EOImpl_WLSkel.invoke(Unknown Source)
    into the session bean i make this (the session recibes one PersonaObj obj):
    T56aContactosEntityLocal personaLocal ;
                   try {
                        personaLocal = personaHome.findByPrimaryKey(new T56aContactosEntityPK(obj.getId_a04()));
                        T56aaat04Obj objTmp = new T56aaat04Obj();
                        objTmp.setAp1_a04(obj.getAp1_a04());
                        objTmp.setEstado_a04("false");
                        personaLocal.setT56aaat04(obj);
    Please can you help me to solve this problem?

    Hello Werner,
    The mappings seem to be alright at a first glance.
    Have you tried out un- and redeploying your application? Sometimes values appear to be cached in the server. So if you have deployed the application before you entered DB_BANK as alias this might solve the problem...
    BR
    Daniel

  • Problems with a java bean in Weblogic 5.1

    Hello,
              I am having a problem deploying a java bean in Weblogic 5.1:
              I have been given a .class and a .jar file for a java bean (not an EJB). I
              placed the .class file into e:\temp\WEB-INF\classes and added the following
              line to my weblogic.properties file:
              weblogic.httpd.webApp.testApp=e:/temp/
              I have also updated the web.xml file in the WEB-INF directory as follows:
              <?xml version="1.0" encoding="UTF-8"?>
              <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
              Application 1.2//EN"
              "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
              <web-app>
              <servlet>
              <servlet-name>EdIface</servlet-name>
              <jsp-file>test.jsp</jsp-file>
              </servlet>
              <servlet-mapping>
              <servlet-name>EdIface</servlet-name>
              <url-pattern>EdIface</url-pattern>
              </servlet-mapping>
              </web-app>
              When I try to access my http:\\server:port\testApp\test I get an "Error
              500 - internal server error".
              Has anyone had experice with deploying a java bean with jsut the .class and
              .jar file? Where should I put the .jar file?
              I appreciate any advice!
              

    Bump

  • Importing Java Bean Model in Webdynpro Development Component

    Hi All,
    Is there any simple tutorial, example  to import java bean model in webdynpro development component.
    I am using NWDS 7.0 SP14 and WAS 7.0.
    it really helps if you can  provide simple EJB as a development component with details how to create a public part and using this bean as java bean model in Webdynpro development component.
    what are the steps to be followed with precautions
    Thanks in Advance,
    Murali

    Hi,
    [Using the Java Bean Model in Web Dynpro|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4072c0d0-c21e-2b10-ab84-e2c183d355de]
    [Using EJBs in Web Dynpro|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1f5f3366-0401-0010-d6b0-e85a49e93a5c]
    you will get more if you search in the forum.
    more help on EJB's
    Re: Help needed in EJB
    http://help.sap.com/saphelp_nw70/helpdata/EN/19/f9bc3d8af79633e10000000a11405a/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70929198-0d36-2b10-04b8-84d90fa3df9c
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1f5f3366-0401-0010-d6b0-e85a49e93a5c
    PradeeP

  • Problem returning a two-dimensional array in web service

    Hello. I'm having problems returning a two dimensional array in my web service. The service returns a MyClass[][] correctly, but the client receives a different one.
    I've done a test that returns a MyClass[1][1] an the client shows a MyClass[1][20]. All the MyClass objects returned in the array are the same and all it's fields are null. There's even an element of the array containing null instead of the object. As I say, the service creates the array ok, but the client gets other thing.
    I have other methods returning one-dimensional arrays MyClass[] and I have no problem.
    My system:
    WindowsXP
    Tomcat 5.5 (Axis 1.3?)
    JDK 1.5
    Eclipse 3.3
    My wsdl is generated with eclipse, although I've had to update my wsdd manually.
    Any Ideas?
    Thanks.

    Does it have to be stored in an array?
    Because you could use the java.awt.Point class, and a
    java.util.Set to create random points until you have
    the correct number of unique points.Of course it is no must to store it in an array. it was just my first thought of approaching the problem. I will try the Point.class. Thanks for that hint.

  • Unable to use bean model in a Callable Object

    Hello,
      I'm trying to use a bean model in a callable object but at runtime I'm allways getting null pointer exception.
      If I test it in a WebDynpro application everything goes right (I only have to add a sharing reference to my EJB Application). But if I Implement a Callable Object and I try to use a EJB bean model it doesn't works.
    (I have added the sharing reference in the callable object DC)
    I have made somes test and the command bean class never finds the EJB using home interface.
    At the moment I would like to use a bean model instead Web Service model because of testing propouses.
    Please, Do you know If I'm missing something? Do I have to add more reference or use DC?
    Is possible to use bean models in Callable Objects?
    Thanks in advance,
    Regards

    Hi,
    Not sure if it will work.
    Try creating the view object with a single query, and once after creating it, edit the view object, and change the SQL query in the source.
    Something like
      <SQLQuery>
        <![CDATA[select * from emp]]>
      </SQLQuery>to
      <SQLQuery>
        <![CDATA[select * from emp where deptno=10 union all select * from emp where deptno=20]]>
      </SQLQuery>-Arun
    P.S : I am able to create the view object with union declaratively in JDev 11g. Probably you can upgrade to 11g ;) .

  • Has anyone else had problems returning a macbook to Apple?

    I apologize if this is not the right place to be asking such a question, but I was not sure where else to go for information. I returned my macbook on December 29th 2014, the day after it was purchased. I had the receipt, all the cords and accessories, everything I needed to return the computer. The amount that was owed to me was over 1400 dollars and so they said it would have to come by check in the mail. The Apple return policy says that this should take 10 days. The apple store I went to (the retail store at South Shore Plaza in Braintree, MA) said to allow 2 weeks for the check to come in. It's been two weeks and still no refund. I am getting very worried now. I went back to the store and they just told me to call apple support. When I called apple support they transferred me back to the same store. Then someone at that store told me to just wait longer and that there was nothing they could do about it. This company owes me 1400 dollars. Has anybody else had problems returning items? How long did you have to wait for your refund to come in the mail?

    I usually purchase by CC and refunds do take longer than purchases.  This is not just Apple - it's everybody!  I returned diamond ear ring ($1200) also on the 29th of December and made a purchase while at the store.  My CC reported the purchase immediately but the refund took a week.
    Today is EXACTLY two weeks since you returned the unit.  If I were you, I'd give it a few days and then take a trip to the store.

  • Problems using Vector in Flex Builder 3

    I've been using Vector with no problems in Flash Builder Beta, but when I try the same thing in Flex Builder 3, the compiler throws a fit when I use it. 
    public function PuzzleEvent(type:String, pieces:Vector.<Sprite>, bubbles:Boolean=false, cancelable:Boolean=false)
         //handle PuzzleEvent
    The other strange thing is, Flex automatically adds this line when I use vector:
    import __AS3__.vec.Vector;
    An import shouldn't be necessary should it?  Vector is in the top level package right?  With or without that import statement, I get compile errors.  Has anyone else had such problems with vector in Flex Builder?
    Dan

    The only way I was ever able to solve this problem was to use Flex builder Beta and now Flash Builder 4.  I did target flash player 10.0.0, but I still never could get it to work.  At least it works in Flash Builder 4.

  • Import Java Bean model in Web dynpro DC

    Hi all,
    I have created the following DC's on a track:
    1. EMPDic (Type: Dictionary) - DC that contains the database table.
    2. EMPEjb (Type J2EE) - DC that contains the EJBs that have business logic. Created a public part EMPpp that containd the bean classes.
    3. EMPEar (Type J2EE) - DC that contains the EMPEjb module.In Used Dcs added EMPpp
    4. EMPCmd (Type: Java) - DC that acts as the command bean.
    Created 2 public parts 'compile'(Type:compilation) and 'deploy' (Type:assembly). In Used DCs added EMPpp.
    5. EMPWd (Type: Webdynpro) - DC that will contain the Java Bean Model and the application. In Used DCs added 'compile' and 'deploy'.
    Q1.) Now when i try to import the Java bean model by selecting the radio button "public parts of used DCs" and look at the dropdown, i am not able to see any of the jar's related to my command bean DC.
    If i select the radio button "project(source folder)" and click Next it says 'No JavaBeans for import'. Am i missing something?
    Q2) Could someone tell me the exact steps from pt. 4 onwards. ie. whether it is necessary to create the 2 public parts for EMPCmd DC and what should it contain.
    Thanking you in advance.

    Hi Melwyn,
    check the NWDI tutorial, it will help you:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c0b53558-6df6-2910-cfbf-a63316bb0fad
    kind regards
    Stefanie

  • HELP-Problem with Vector type in Applet

    Hi,
    I am writing an Java applet which uses Vector. It won't run in IE browser, simply does not respond.
    However, when I tested the program using Appletviewer it runs prefectly.
    Is there a way to make Vector work in applet ?
    I have investigated the code and I'm pretty sure it's the Vector that causes problem in the applet.
    Pls your idea. Thanks.
    Hadi

    Hi,
    I use Applet, not JApplet. There are 3 deprecated things in this applet (mouseDown, keyDown, action) but I have used them all in my previous applet with no problem at all.
    I suspected the problem is Vector related by inserting several showDialogs as below:
    showDialog("1111");
    t.clear();     // to clear the vector
    showDialog("222222");
    I can see that the applet displays the 1111, but does not display 222222 at all. It seems like it simply ignores all commands after the first showDialog. Therefore, I suspect the t.clear() as the source of problem. But it does not display any error.
    't' is defined at the top as:
    static Vector t = new Vector();
    And t is manipulated by such: t.add(new Task()); and other regular Vector methods in jdk 1.3. I also checked that there is no deprecated methods for Vector from 1.2 to 1.3.
    I use MS Internet Explorer to run my applet.
    Any other things I should check ?
    Thanks.

Maybe you are looking for

  • Apple Mac query

    I'm thinking of buying an apple Mac.   I'm presently using windows seven on a PC and lightroom 4 and have bought the upgrade to lightrooom five.  On the box it says it can be used with windows or a Mac so I presume this software will work on a Mac. 

  • Photo booth is looping

    Photo booth app is looping and does not stop. How do I fix it?

  • In weblogic server when I Setting Up a User and Tablespace for the Server M

    In weblogic server when I Setting Up a User and Tablespace for the Server Migration Leasing Table in Sql Plus I got an error. ORA-00972: identifier is too long

  • Preview not updated in 3.2?

    If I edit a picture, i.e. change contrast etc. the preview (to see the whole picture) gets fuzzy and will be updated and getting sharp again only if I change to another picture and come back or if I display the picture in 100% size and switch back to

  • Clustering in Arch

    Hi Archers: I've used this distro since 3 years in workstations and my netbook Toshiba NB200 and everything works fine. Now the challenge is to build a cluster with 3 server machines. Everyone is a DELL PowerEdge The Master: PowerEdge R710 The Node: