Problem importing java bean model

I had importing a lot of classes from my bussiness model but I have some problem with some classes. Those classes uses others from external jars, like common collection.
I imported common-collection.jar to wd project, but I got the same error. Is posible use external classes in my model? How can I import it? (external jars)

Hi,
You have to create a DC of type extyernal library.
And paste the external library in the libraries.
And craete public of both types SDA & API.
Right click on the pasted jars in the libraries folder.
Right click on the jar>Development Component->Add to public part(Create a one with API radio button selected).
Repeat the same step selecting SDAs radio button.
Now add the public part created by you in the Web dynpro DC ur working .
Thanks & Regards,
Lokesh

Similar Messages

  • 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

  • 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

  • Importing java Bean Model

    hai ,
    am new to webdynpro for java ... Am trying to import ejb bean jar to web dynpro ..
    Steps as follows
    i) copy the bean jar to wd project lib folder
    ii) Set classpath
    SampleWD - > Model
    Model -> create model
    Model name  :  Samplemodel
    Model package : com.sample
    Local jar file : C:\sap\workspace\SampleWD\lib\addbean.jar -- getting error in this step as Invalid Class - java bean not available for import
    can anybody help me ..
    Thanks in advance...
    regards,
    Krish

    Hi Krish,
    In addition to Madhu's suggestion,
    As per the Java Bean Model creation steps, you will need to add the Commanad Bean JAR too in your Project, and while creation of Model, you need to select this Command Bean JAR and not the Bean Project JAR.
    Regards,
    Alka.

  • Importing Java Bean Model (Command Bean) with Session Bean

    Hello all,
    I'm trying to import a CommandBean as a Java Bean Model in WebDynpro but I'm prompted with an error indicating that I cannot import the EJB (Session Bean) DC that is being accessed by my CommandBean - hence failing to import the CommandBean DC as well.
    How do I import this?
    Help please.
    -Regards,
    Jan

    HI,
    just add ejb20.jar as an external jar in your WD project.

  • 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

  • How can I include Java Bean model into the model outside the component

    Hi All,
    I am new to SAP portal. I wanted to create a bean for storing the data and to include that into the application model.
    Please help me with an example .
    Regards,
    Saroj

    Hi,
      Check these blogs.
    The specified item was not found.
    Importing Complex JavaBean model into WebDynpro by creating relationships for the model classes
    JavaBean Model Import: when it really works
    Issue in Importing Java Bean Model
    Regards,
    Harini S
    Consider rewarding points for helpful answers. Post this thread in WD forums for more results.

  • Diffrence b/w Deploy Time & Design time in Java bean model

    Hi all,
    I have craeted a model using java bean.
    create model->import java bean model->Add JAR->browse the jar.
    There i have got two Radio Buttons
    Design Time
    Deploy Time
    I have worked with this two i have not observed any difference.
    Can anyone give me some idea about this.If possible with an example to?
    Thanks & Regards,
    Lokesh.

    HI Lokesh,
    The basic difference between design time and deploy time is. design time jars are only used when building your aplication and considered to be present already on server. and at runtime application refer to it..
    while if you keep deploy time, then the application itself keeps that jar file with him and at runtime it refers to it.
    i.e. application deploy that jar file on server.
    When you run an application, application need all its dependencied to be present in webdynpro container of server.
    your javabean model needs those jar files at server. so when you chose deploy time. it personly deploy that file on server.
    Iif you keep it as design time then. then you will be  able to build it.
    but if those jar files are not present at the server then your application will not get deployed.
    e.g.
    let A & B are your two applications and they need xx.jar file of a EJB  which is created by you  to create a javabean model.
    now as this xx.jar file is not present at server.
    1. when you create model for A. Keep it as deploy time.
    as application A deploy that xx.jar file on server. B can refer it directly
    2._when you create model for B keep it as design time._

  • Complex Java Bean Model in WD

    I've revised the question.. to make it more simple.
    I have 2 wrapper classes, the first wrapper HAS the second wrapper as an object.
    When importing the Java Bean Model in WebDynpro, it seems okay - did the context binding, etc. -- until I did an "Apply Template" (as form) on the layout based on the CommandBean (which has the wrapper class).
    Now, the fields are not active fields.. I can't change the cardinality -- and I have played around with the relations of the model classes with each other.
    Nothing seems to work
    Please help.
    Edited by: Jan Michael Jaudian on Oct 8, 2008 8:07 AM

    problem solved.
    forgot to completely bind inner nodes.
    developers who need more info, do post here so I can help out in any way I can.
    Cheers!

  • Java Bean Model

    Is it possible to create a simple Java Bean (not EJBs) that connect to the data base where I can read/write to it??  And I want to hook it up to Web dynpro (import a java bean model).
    Please help!
    I have checked countless threads and tutorials, and am unable to put the pieces together.

    Hi Sana,
    I think  following links definitely help you to answer your queries
    PPt :-
    FEATURED EVENTS
    Demo link :-
    FEATURED EVENTS
    Best Regards,
    Anuj

  • 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

  • Simple Java Bean Model in Wed Dynpro

    Hello All,
    I have to develop a WD Java application with an Oracle DB as the backend. To application was designed to abstract the backend interaction into a Java bean model. The data connection and retrieval was successful. To move the data to the context following steps were performed:
    1. Create a java class with the variables to be used as context in the application. Ex: Name, Subject, Email
    2. On interting the ResultSet, set the values to the variables.
    But, only the last row of data is retained. We tried to use array but have not been able to move the ste of values to the context.
    Request your help in this regard to store the set of values into the context.
    Thank you.

    Hi,
    It looks like you are overwriting the same context element when populating it with the values from the resultset.
    Make sure you create every time a new context element and add it to the context root.
    while (rs.hasNext()) {
        ContextElement elem = new ContextElement();  // or something simular appropiate to your element
        elem.setName(rs.next().getName());
        contextRootNode.addElement(elem);
    Hope this helps a little.
    Regards,
    Alain

  • Problem with java beans and jsp on web logic 6.0 sp1

              HI ,
              I am using weblogic6.0 sp1.
              i have problem with jsp and java beans.
              i am using very simple java bean which stores name and email
              from a html form.
              but i am getting following errors:
              Full compiler error(s):
              D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:89:
              cannot resolve symbol
              symbol : class userbn
              location: class jsp_servlet._savename2
              userbn ud = (userbn) //[ /SaveName2.jsp; Line: 7]
              ^
              D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:89:
              cannot resolve symbol
              symbol : class userbn
              location: class jsp_servlet._savename2
              userbn ud = (userbn) //[ /SaveName2.jsp; Line: 7]
              ^
              D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:94:
              cannot resolve symbol
              symbol : class userbn
              location: class jsp_servlet._savename2
              ud = (userbn) java.beans.Beans.instantiate(getClass().getClassLoader(),
              "userbn"); //[ /SaveName2.jsp; Line: 7]
              ^
              3 errors
              in which directory should i place java bean source file(.java file)
              here is my jsp file:
              <%@ page language = "java" contentType = "text/html" %>
              <html>
              <head>
              <title>bean2</title>
              </head>
              <body>
              <jsp:usebean id = "ud" class = "userbn" >
              <jsp:setProperty name = "ud" property = "*" />
              </jsp:usebean>
              <ul>
              <li> name: <jsp:getProperty name = "ud" property = "name" />
              <li> email : <jsp:getProperty name = "ud" property = "email" />
              </ul>
              </body>
              <html>
              here is my bean :
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              import java.io.*;
              public class userbn implements Serializable
                   private String name ;
                   private String email;
                   public void setName(String n)
                        name = n;
                   public void setEmail(String e)
                        email = e;
                   public String getName()
                        return name;
                   public String getEmail()
                        return email;
                   public userbn(){}
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              pls help me.
              Thanks
              sravana.
              

              You realy can do it like Xiang says, but the better way is to use packages. That's
              the way BEA is designed for. If you use packages you can but your bean classes
              in every subfolder beneath Classes. Here for example we have the subfolders test
              and beans:
              You have to declare the package on top of your Bean Source Code:
              package test.beans;
              In your JSP you don't need the import code of Xiang. You only have to refer the
              path of your bean class:
              <jsp:useBean id="testBean" scope="session" class="test.beans.TestBean" />
              There are some other AppServers that only can deploy Java Beans in packages. So
              if you use packages you are always on the right side.
              ciao bernd
              "sravana" <[email protected]> wrote:
              >
              >Thank you very much Xiang Rao, It worked fine.
              >Thanks again
              >sravana.
              >
              >"Xiang Rao" <[email protected]> wrote:
              >>
              >><%@ page import="userbn" language = "java" contentType = "text/html"
              >>%> should
              >>work for you.
              >>
              >>
              >>"sravana" <[email protected]> wrote:
              >>>
              >>>HI ,
              >>>
              >>>I am using weblogic6.0 sp1.
              >>>
              >>>i have problem with jsp and java beans.
              >>>
              >>>i am using very simple java bean which stores name and email
              >>>
              >>>from a html form.
              >>>
              >>>but i am getting following errors:
              >>>
              >>>________________________________________________________________
              >>>
              >>>Full compiler error(s):
              >>>D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:89:
              >>>cannot resolve symbol
              >>>symbol : class userbn
              >>>location: class jsp_servlet._savename2
              >>> userbn ud = (userbn) //[ /SaveName2.jsp; Line: 7]
              >>> ^
              >>>D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:89:
              >>>cannot resolve symbol
              >>>symbol : class userbn
              >>>location: class jsp_servlet._savename2
              >>> userbn ud = (userbn) //[ /SaveName2.jsp; Line: 7]
              >>> ^
              >>>D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:94:
              >>>cannot resolve symbol
              >>>symbol : class userbn
              >>>location: class jsp_servlet._savename2
              >>> ud = (userbn) java.beans.Beans.instantiate(getClass().getClassLoader(),
              >>>"userbn"); //[ /SaveName2.jsp; Line: 7]
              >>> ^
              >>>3 errors
              >>>
              >>>____________________________________________________________
              >>>
              >>>in which directory should i place java bean source file(.java file)
              >>>
              >>>here is my jsp file:
              >>>--------------------------------------------------------
              >>>
              >>><%@ page language = "java" contentType = "text/html" %>
              >>><html>
              >>><head>
              >>><title>bean2</title>
              >>></head>
              >>><body>
              >>><jsp:usebean id = "ud" class = "userbn" >
              >>><jsp:setProperty name = "ud" property = "*" />
              >>></jsp:usebean>
              >>><ul>
              >>><li> name: <jsp:getProperty name = "ud" property = "name" />
              >>><li> email : <jsp:getProperty name = "ud" property = "email" />
              >>></ul>
              >>></body>
              >>><html>
              >>>
              >>>-------------------------------------------------------------
              >>>
              >>>here is my bean :
              >>>
              >>>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              >>>
              >>>import java.io.*;
              >>>
              >>>public class userbn implements Serializable
              >>>{
              >>>
              >>>     private String name ;
              >>>
              >>>     private String email;
              >>>
              >>>     public void setName(String n)
              >>>     {
              >>>
              >>>          name = n;
              >>>     }
              >>>
              >>>     public void setEmail(String e)
              >>>     {
              >>>
              >>>          email = e;
              >>>     }
              >>>
              >>>     public String getName()
              >>>     {
              >>>
              >>>          return name;
              >>>     }
              >>>
              >>>     public String getEmail()
              >>>     {
              >>>
              >>>          return email;
              >>>     }
              >>>
              >>>     public userbn(){}
              >>>}
              >>>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              >>>
              >>>pls help me.
              >>>Thanks
              >>>sravana.
              >>>
              >>
              >
              

  • Need help for traping imported java bean exception

    hi everyone
    i have imported a java bean into my forms 9i using java importer utility which tries to rename a file on a give path(bean works fine when executed through sql client).
    i have problem when called from when button pressed trigger, it throws me an ("FRM-40735 and ORA-105101 NON ORACLE EXCEPTION") error.
    i have imported java.lang.exception class and constructed an exception handler to trap java exception in the trigger
    as
    EXCEPTION
         WHEN ORA_JAVA.JAVA_ERROR then
              message('Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR);
              --check for ORA-105101
         WHEN ORA_JAVA.EXCEPTION_THROWN THEN
              ex:= ORA_JAVA.LAST_EXCEPTION;
              message('Java Exception --: '||BIException.toString(ex));
              ORA_JAVA.CLEAR_EXCEPTION;
         WHEN OTHERS THEN
              message('error :'||SQLERRM);
    when i imported java.lang.exception i did not find any wrapper pl/sql function or procedure declared to read or get the error messages except for the functions named "new" ,my exception handler failed.
    so i tried with BIException which also fails to trap the error i have no idea about BIException and its usage with in forms ,Please do help me out with this issue ASAP.
    thanks in advance
    Rgds
    yash

    Hi,
    don't understand what the BIException is supposed to do in your code, can you try
         WHEN ORA_JAVA.EXCEPTION_THROWN then
         ex := ORA_JAVA.LAST_EXCEPTION;
         message('Exception: '||Exception_.toString(ex));
    where Exception_ is the imported java.lang.Exception package.
    Frank

  • Java Bean Model in WebDynpro

    Hi,
    I have build am Java Bean Class which I use in a WebDynpro Model. In this Java Bean Class i want to call a remote method via RMI.
         public String calculate(int aFirst, int aSecond)
              float theResult = 0;
              try {
                   Properties p = new Properties();
                   p.put(Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");
                   p.put(Context.PROVIDER_URL, "nitse06u:50004");
                   p.put(Context.SECURITY_PRINCIPAL, "Administrator");
                   p.put(Context.SECURITY_CREDENTIALS, "admin");
                   Context initialContext = new InitialContext(p);
                   Object ob = initialContext.lookup("Calculator");
                   CalculatorHome home = (CalculatorHome) PortableRemoteObject.narrow(ob, CalculatorHome.class);
                   Calculator theCalculator = home.create();
                   theResult = theCalculator.add(aFirst, aSecond);
              catch (Exception ex)
                   ex.printStackTrace();
              return new Integer(((new Float(theResult))).intValue()).toString();
    At runtime following exception occurred.
    java.lang.NoClassDefFoundError: com.sap.examples.calculator.CalculatorHome
         at com.sap.calculator.helper.CalculatorHelper.calculate(CalculatorHelper.java:109)
         at caom.sap.webdynpro.CalculatorComponentView.onActionCalculate(CalculatorComponentView.java:150)
         at caom.sap.webdynpro.wdp.InternalCalculatorComponentView.wdInvokeEventHandler(InternalCalculatorComponentView.java:144)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
         at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleAction(WebDynproMainTask.java:100)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:299)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:635)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)
    How can I add the home and remote classes to my webdynpro?
    Regards 
    Richard

    You could try to put the ejbClient.jar (the jar file that was generated in your ejb project) into the lib directory of your webdynpro project.
    Everything in the lib directory is deployed with the Webdynpro application.
    To see the lib directory you have to change to the navigator view in the IDE.
    It is right under the Project root.
    If you have Development Component Projects this is a different story. You can add the public part in your ejb DC (of type assembly) to the DC usages in the WebDynpro DC. The type assembly means then, that the jar file from the ejb project is taken and packaged with the WebDynpro DC. But watch out. For this to work you have to do a real DC build and a real DC deploy not the deploy and run function. Hope this helps.

Maybe you are looking for

  • ITunes 10.6.1 install failed

    The system attempted to automatically update iTunes recently. It failed. I was busy at the time so I didn't really pay any attention to it. Fast forward a few days to now. When I launch iTunes, I am told "This copy of iTunes is corrupted or is not in

  • P1102w input tray doesnt seem to work

    I have two laptops that connect to my home network which my HP P1102w is also connected on. The laptops both run Windows 7. If I try to prin t anything now, the paper does not seem to be taken in via the input tray. It sounds like its trying to suck

  • Storing 2d array in ArrayList?

    Hi I'm storing a 2d int array (int[][]) in an ArrayList. But I cant convert it back to a 2d array again. Tried: indices.add(option.getIndexList()); indices.add(option[j].getIndexList()); int[][] Arr = (int[][])indices.toArray(new int[indices.size()][

  • EJB3 application error

    Hello, My EJB3 application is deployed (as an EAR file) in Oracel AS 10.1.3 on two Solaris boxes. The two environments are supposed to be identical. The application runs as designed in one environment, while throwing the following exception in the ot

  • Gmail Messages Garbled on iPhone?

    Below is an example of what some gmail messages appear like when I open them on my iPhone . . .any thoughts? {\rtf1\ansi\ansicpg1252\fromhtml1 \deff0{\fonttbl {\f0\fswiss\fcharset0 Arial;} {\f1\fmodern Courier New;} {\f2\fnil\fcharset2 Symbol;} {\f3\