Using EJB and CommandBean as Model in WD

Hi Experts,
I'm quite new to DI. My problem is, I created an EJB which is accessing a DB. Now I created a commandBean which accesses the EJB. I want to use this commandBean as beanModel in WD. I created public parts for the CommandBean but when I want to create the model in WD-Perspective and choose used dc as source, I can't find the jar file of the commandBean, that I wanted to expose with the public parts. Do I create public parts the wrong way? Or what could be the error? Is my approach correct in using a commandBean to access the EJB and use the CommandBean as Model?
When I want to create the jar file of the CommandBean I get the following messages:
JAR creation failed. See details for additional information.
  Problem writing /DI1_TP1IP1_Dzvejbhelpcom.bla/src/packages/com/sap/bla/MyCommandBean.jar to JAR: duplicate entry: com/sap/bla/MyCommandBean.jar
  Problem writing /DI1_TP1IP1_Dzvejbhelpcom.bla/bin/com/sap/bla/MyCommandBean.class to JAR: duplicate entry: com/sap/bla/MyCommandBean.class
  Problem writing /DI1_TP1IP1_Dzvejbhelpcom.chiron/src/packages/com/sap/bla/MyCommandBean.java to JAR: duplicate entry: com/sap/bla/MyCommandBean.java
But the jar file is created? Could it be corrupted?
Any help is appreciated
Regards Manuel

Hi Stefanie,
you're right. Web Services is the better approach. So I wanted to use a web service and created a session bean wich calls my entity bean. I created a web service around the session bean. But when I want to deploy the ear-Project with the web service I get the following exception. I already checked sdn for this problem, but I could'nt find the solution:
Caught exception during application deployment from SAP J2EE Engine's deploy service:
java.rmi.RemoteException: Cannot deploy application com.chiron/zv_ear.. Reason: Webservices common deployment exception! The reason is: Error occurred, trying to update web services for application com.chiron/zv_ear. . Additional info: none; nested exception is:      java.lang.Exception: com.sap.engine.interfaces.webservices.server.deploy.WSDeploymentException: Webservices common deployment exception! The reason is: Error occurred, trying to update web services for application com.chiron/zv_ear. . Additional info: none
     at com.sap.engine.services.webservices.server.deploy.ws.update.WSUpdateProcessor.updateWebServices(WSUpdateProcessor.java:164)
     at com.sap.engine.services.webservices.server.deploy.ws.update.WSUpdateProcessor.updateWebServices(WSUpdateProcessor.java:118)
     at com.sap.engine.services.webservices.server.deploy.ws.update.WSUpdateProcessor.updateWebServices(WSUpdateProcessor.java:86)
     at com.sap.engine.services.webservices.server.deploy.ws.update.WSUpdateManager.makeUpdate(WSUpdateManager.java:52)
     at com.sap.engine.services.webservices.server.deploy.WSDeployer.makeUpdate(WSDeployer.java:274)
     at com.sap.engine.services.deploy.server.application.UpdateTransaction.makeComponents(UpdateTransaction.java:400)
     at com.sap.engine.services.deploy.server.application.DeployUtilTransaction.commonBegin(DeployUtilTransaction.java:321)
     at com.sap.engine.services.deploy.server.application.UpdateTransaction.begin(UpdateTransaction.java:164)
     at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:292)
     at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhases(ApplicationTransaction.java:326)
     at com.sap.engine.services.deploy.server.DeployServiceImpl.makeGlobalTransaction(DeployServiceImpl.java:3184)
     at com.sap.engine.services.deploy.server.DeployServiceImpl.update(DeployServiceImpl.java:669)
     at com.sap.engine.services.deploy.server.DeployServiceImplp4_Skel.dispatch(DeployServiceImplp4_Skel.java:1278)
     at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:313)
     at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:199)
     at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:136)
     at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
     at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
     at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
     at java.security.AccessController.doPrivileged(Native Method)
     at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
     at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: com.sap.engine.interfaces.webservices.server.deploy.WSDeploymentException: Webservices deployment exception! The reason is: Error occurred, trying to generate web services deployment files for application com.chiron/zv_ear. . The error refers to application: none, jar: , web service: .
     at com.sap.engine.services.webservices.server.deploy.ws.update.WSUpdateProcessor.generateDeployFiles(WSUpdateProcessor.java:296)
     at com.sap.engine.services.webservices.server.deploy.ws.update.WSUpdateProcessor.deployWebServices(WSUpdateProcessor.java:262)
     at com.sap.engine.services.webservices.server.deploy.ws.update.WSUpdateProcessor.updateWebServices(WSUpdateProcessor.java:155)
     ... 21 more
Caused by: com.sap.engine.interfaces.webservices.server.deploy.WSDeploymentException: Webservices common deployment exception! The reason is: Error occurred, parsing com.sap.engine.services.webservices.server.deploy.descriptors.sapwebservices.WSDescriptor descriptor, application com.chiron/zv_ear, web service zvglWS, location message: type: jar file, location: F:\usr\sap\TP1\JC00\j2ee\cluster\server0\.\temp\deploy\work\deploying\reader1197465981374\com.chiron~zv_model3.jar . . Additional info:
     at com.sap.engine.services.webservices.server.deploy.ws.WSDefinitionFactory.parseWSDescriptor(WSDefinitionFactory.java:907)
     at com.sap.engine.services.webservices.server.deploy.ws.WSDefinitionFactory.loadWebService(WSDefinitionFactory.java:176)
     at com.sap.engine.services.webservices.server.deploy.ws.WSDefinitionFactory.loadWebServices(WSDefinitionFactory.java:158)
     at com.sap.engine.services.webservices.server.deploy.ws.update.WSUpdateProcessor.generateDeployFiles(WSUpdateProcessor.java:284)
     ... 23 more
Caused by: com.sap.engine.interfaces.webservices.server.deploy.WSDeploymentException: Webservices common deployment exception! The reason is: Error occurred, trying to parse documentation for web service zvglWS. . Additional info:
     at com.sap.engine.services.webservices.server.deploy.ws.WSDefinitionFactory.parseDocumentation(WSDefinitionFactory.java:1590)
     at com.sap.engine.services.webservices.server.deploy.ws.WSDefinitionFactory.parseWSDAndDocumentation(WSDefinitionFactory.java:1564)
     at com.sap.engine.services.webservices.server.deploy.ws.WSDefinitionFactory.parseWSDescriptor(WSDefinitionFactory.java:814)
     ... 26 more
<b>Caused by: java.io.FileNotFoundException</b>: .\temp\webservices\deploy\com.chiron_zv_ear\webservices\com1\com\sap\chiron\zvglWSWsd.wsdef (The system cannot find the path specified)
     at java.io.FileOutputStream.open(Native Method)
     at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
     at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
     at com.sap.engine.lib.jar.JarExtractor.extractFile(JarExtractor.java:232)
     at com.sap.engine.services.webservices.server.deploy.ws.WSArchiveFilesLocationHandler.getWsdInputStream(WSArchiveFilesLocationHandler.java:184)
     at com.sap.engine.services.webservices.server.deploy.ws.WSDefinitionFactory.parseDocumentation(WSDefinitionFactory.java:1574)
     ... 28 more
(message ID: com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.performAction(DeploymentActionTypes).REMEXC)
Deployment exception : The deployment of at least one item aborted
I already removed the ear and deployed again. That works one time, after that I get the exception again. But even when it works one time, I can't find the web service in the web service navigator of the j2ee engine.
Regards Manuel

Similar Messages

  • How to handle audit columns using EJB and JPA.

    Hi,
    I am using JDev10.1.3.3 with Swing and EJB + JPA + TopLink.
    Every entity (POJO) has the same audit columns:
    @Column(name="CREATE_DATE", nullable = false)
    private Timestamp createDate;
    @Column(name="CREATE_USER_ID", nullable = false, length = 30 )
    private String createUserId;
    @Column(name="MODIFY_DATE", nullable = false)
    private Timestamp modifyDate;
    @Column(name="MODIFY_USER_ID", nullable = false, length = 30 )
    private String modifyUserId;
    Does JPA has a default feature/component that will auto populate this fields. (Similar to Business Components)?
    Thanks,
    Jim

    Hi,
    I am not aware of this being part of EJB/JPA. However, you may want to check here. Its the TopLink forum, but these guys are involved in the JPA standardization
    TopLink/JPA
    Frank

  • 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

  • How can I develop a web application using EJB design pattern?

    I have searched over the web and found quite a lot of tutorials on how to use the EJB design pattern.
    I know that there will be a home interface, EJB object interface and a SessionBean.
    But the tutorials often only cover a single class, this made me unable to get a complete picture of how EJB design pattern can be implemented into a whole system.
    I am now required to devleop an online shopping web application using EJB and JSP page.
    I think I will need to create a lot of classes: Member, ShoppingCart, Product...etc.
    What I want to ask is that, do I need to create a home interface, EJB object interface and a SessionBean for each of these classes?
    I really need some ideas on how to develop this system using EJB + JSP pages.
    Many thanks to you all.

    For every EJB that you want to create, you will need to code a home and remote interface and a bean class.
    You could start getting your ideas here
    http://www.theserverside.com/books/wiley/masteringEJB/
    http://www.coreservlets.com

  • What is the best way to use EJB modules with JAX-WS?

    Hi.
    I am doing a project that returns EAN13 encoded data to external java clients.
    I think I need to use a webservice that send response, a webservice client that send the request, and other project that transforms a data to an EAN encoded data, returns it and store it in MySql database.
    It is possible that I need to authenticate users for every request made.
    -I have created a EJB module contained into Glassfish for the webservice
    -I have created a Common Java project with 3 layers: Entities, bussines and data access layer for mysql database
    -I have a project for the webservice client with JAX-WS ( is the best choice? or Would be better JAX-RPC? )
    **How would you suggest me create the structure of the project with all the java power?*
    **Could you help me with goods tutorial of design patterns about webservices using EJB and the best way for use databases for this kind of projects ( I have heard about JNDI, Hibernate, Session EJB, ... )?*
    **Would be better use other EJB module instead of a Common java project that has classes?*
    h3. {color:#333399}I shall be pleased with your help{color}

    Kappy is dead on correct about Bridge Mode as a requirement for the Time Capsule.
    Do you know how to check to see if the Time Capsule is configured this way?
    Next question.....you really should not try to have two wireless networks....one Arris and another Time Capsule.....unless it is absolutely necessary. Two wireless routers in close proximity can create wireless interference effects that can cause problems with either...or both...networks.
    Best to turn off the wireless on one router to keep the chances of wireless interference between routers minimized.
    Are both the Arris and Time Capsule providing wireless signals?

  • Why do we use EJBs?

    Hi all,
    I am a student and trying my Hands on J2EE. The only question i have is why do we use EJBs when similar kind of functions can be done using Servlets also ...
    I may be sounding dumb, but i really wanna know when to use EJBs and when not to use them.
    Thanks,
    Raghuveer

    rags_raghuveer wrote:
    Hi all,
    I am a student and trying my Hands on J2EE. The only question i have is why do we use EJBs when similar kind of functions can be done using Servlets also ...
    Wrong. Servlets handle HTTP requests. There are four flavors of EJBs. Are you saying that servlets duplicate all that functionality? You understand neither servlets nor EJBs.
    I may be sounding dumb, Yes.
    but i really wanna know when to use EJBs and when not to use them.That's actually a very good question. Here's one person's answer:
    http://www.amazon.com/Expert-One-One-Development-without/dp/0764558315/ref=sr_1_1/104-2273680-6808730?ie=UTF8&s=books&qid=1192283013&sr=8-1
    %

  • How to use Ejb with Hibernate in netbeans

    hello everybody
    i am developing a project using ejb and hibernate as a persistance provider. i need some idea how to develop a web application in netbeans. I went through a example in netbeans but it's not helping me.If any body can give me some idea
    many thanks
    sri

    Well, I've never used a JProgressBar before, so I'm
    not sure. If I add it to the frame, can I call it
    whenever I need to use it like when I click the
    JMenuItem do I just call it?Questions like these are better answered by the tutorials:
    http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html

  • Oracle Database Lite deploying EJBs and struts

    I need to deploy my enterprise application on Mobile server. My application uses EJBs and struts, are EJBs and Struts supported by Oracle Database Lite Mobile server? If yes do we need to do anything different for deploying EJBs on Mobile Server?
    Regards
    Roomap

    Already posted a response to this here today
    New Application

  • Creating XML using EJB

    hi,
    i want to know if the following is possible using EJB and XML.
    using HTML/javascript, a form has been created. now the user makes selections using the form. i want to create a XML file that encapsulates the user selections ie this XML file should contain the selections made by the user. this XML file should also automatically change whenever the user makes new selections on the HTML form.
    someone suggested me that Beans are the best option to use. can u guide me on how to proceed using Beans.
    thanks in advance.

    Why not use a JSP? Much quicker.
    (When someone suggested you use Beans, I doubt they meant Enterprise Beans - cf. SledgeHammer vs Nut).

  • Using EJBs in Web Dynpro and others model tecnology patterns

    I'm having difficults in order to implement the business logic in Java.
    I did a simple application and I put all business rules inside de controller in the web dynpro. Everything is ok to users, but I know that this isn't indicate.
    I tried to encapsulate de business rules and dao in a session bea, but I'm not sucessfull. I'd like to receive advices/tutorial about model, I found some treads in the forum, but almost all links in the sdn are browke. I was thinking in using hibernate and spring, but I don't know with it's a good choive to sap world.

    Hi,
    try these tutorials:
    (ejb) https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1f5f3366-0401-0010-d6b0-e85a49e93a5c
    (hibernate) https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/14f55178-0801-0010-0bac-974ed17e51d3
    Regards
    Ladislav
    PS. Consider rewarding helpful answers

  • Is there a way to use EJBs directly inside WDJ without Model generation?

    Hello,
    Is there a way to use EJBs directly inside WDJ without Model generation, to avoid producing tonnes of code and reuse the JPA Entities?
    Thanks
    Sebastian
    Edited by: Sebastian Lenk on Nov 3, 2010 7:01 PM

    of course, you can.
    it's pure java programming.
    Context ctx = new InitialContext();
       Object o = ctx.lookup(
    "sap.com/HelloWorldEAR/REMOTE/HelloWorldBean/com.sap.sdn.ejb.HelloWorldRemote");
       HelloWorldRemote helloRef = (HelloWorldRemote) 
        PortableRemoteObject.narrow(o, HelloWorldRemote.class);

  • Using EJB Model in Web Dynpro

    I have to redeploy my EJB.ear (used as a Web Dynpro model) everytime the J2EE server is started (only the first time), after which My Web Dynpro program continues to work. In other words, the following code in my Command Bean is not successful without redeploying the EJB.ear for some reason. Can someone please tell me what I am doing wrong ?
    home = (MyLocalHome) context.lookup("localejbs/MySessBean");

    Walter, thanks for the reply.  When I checked the EJB Container in VA after starting up the J2EE server, my EJB shows a blue check mark already with the START button grayed out (STOP button is active).  So I would think the EJB is started already...  HOWEVER, I noticed that when I hit the DEPLOY button there, I see a warning message popping up which says :  "This Application hasn't J2EE modules, so it cannot be loaded. Proceeding with Deploy".  I go ahead and finish the Deploy and then my EJB works.  It seems I am not including a module when I deploy it ?
    Paul

  • Expose ADF-BC as ejb and use it in UI from the datacontroller

    Hi Experts.
    Here i am looking forward some experts view and guidelines on this deployment architecture question. Currently i have deploped one ADF Web fusion application which has ADF-BC and web. In that web project datacontroller side i can be able to see the view object instances under each business service. Also the web has some UI bindings too. Now the application is working fine fine on one weblogic instance.
    question1) Can i deploy this above project into two weblogic instances one with ADF-BC model ( if yes how to deploy that alone) and the other web into the another instance. ( If yes can to configure the project)
    question 2) Now can i expose the ADF-BC as ejb and use it in the same way in the web (like drag and drop from the Data controller). ? I tried the option expose the ADF-BC as ejb In this case if the VO instance access methods are not exposed. So how can i access them in the UI? For example, assume if we have 2 view object EmployeeView and DepartmentView in the application module, then after immediately create the AM, the datacontrol shows the view object instances name like EmployeeView1, DepartmentView1 and also in the web we just drag and drop to create appropriate UI. This is fine. Now i create the ejb based on the AM. In the Remote interface i have the
    void removeEntity(Object entityDTO)
    method. If i look at the datacontrol section still the data controls remains same. I think this datacontrol still shows the ADF-BC direct connectivity. If i try to create the new ejb data control which points to the same AM ejb for web, then i couldn't see the above view instance name called EmployeeView1, DepartmentView1, where i can drag and drop in the UI.
    I can only see methods like EJBHome etc.....
    So this means i cannot use the Exposed EJB from the ADF-BC Application Module to drag and drop in UI like the ADF-BC direct unless we explicitly create the view access methods in the interface. Am i correct?
    Or still am i getting the wrong assumption.
    Much appreciated if u point some code to understand this.
    -t

    Thanks for the reply.
    Basically we have found the way to expose the ADFBC as ejb and use it for data binding in the UI. I will update this thread soon about our finding. But now i have an architecture question, can we deploy as 3-tier deployment for ADF-BC using the exposed ejb interface? Because i am worrying we might run into some ADF issue in furture if we move this path. Oracle gurus please share your ideas or thoughts.
    -t

  • Using Timer and TimerTask classes in EJB's(J2EE)

    Does J2EE allow us to use Timer and TimerTask classes from java.util package in SessionBean EJB's ( Statless or Statefull )?.
    If J2EE does allow, I am not sure how things work in practical, Lets take simple example where a stateless SessionBean creates a Timer class
    and schedules a task to be executed after 5 hours and returns. Assuming
    GC kicks in many times in 5 hours, I wonder if the Timer object created by survives the GC run's so that it can execute the scheduled tasks.
    My gut feeling says that the Timer Object will not survive.. Just
    want to confirm that.
    I will be interested to know If there are any techiniques that can make
    the usage of Timer and TimeTask classes in EJB's possible as well as reliable with minmum impact on over all performance.

    Have a look at J2EE 1.4. I think they add a timer service for EJBs there...
    Kai

  • I need a clarification : Can I use EJBs instead of helper classes for better performance and less network traffic?

    My application was designed based on MVC Architecture. But I made some changes to HMV base on my requirements. Servlet invoke helper classes, helper class uses EJBs to communicate with the database. Jsps also uses EJBs to backtrack the results.
    I have two EJBs(Stateless), one Servlet, nearly 70 helperclasses, and nearly 800 jsps. Servlet acts as Controler and all database transactions done through EJBs only. Helper classes are having business logic. Based on the request relevant helper classed is invoked by the Servlet, and all database transactions are done through EJBs. Session scope is 'Page' only.
    Now I am planning to use EJBs(for business logic) instead on Helper Classes. But before going to do that I need some clarification regarding Network traffic and for better usage of Container resources.
    Please suggest me which method (is Helper classes or Using EJBs) is perferable
    1) to get better performance and.
    2) for less network traffic
    3) for better container resource utilization
    I thought if I use EJBs, then the network traffic will increase. Because every time it make a remote call to EJBs.
    Please give detailed explanation.
    thank you,
    sudheer

    <i>Please suggest me which method (is Helper classes or Using EJBs) is perferable :
    1) to get better performance</i>
    EJB's have quite a lot of overhead associated with them to support transactions and remoteability. A non-EJB helper class will almost always outperform an EJB. Often considerably. If you plan on making your 70 helper classes EJB's you should expect to see a dramatic decrease in maximum throughput.
    <i>2) for less network traffic</i>
    There should be no difference. Both architectures will probably make the exact same JDBC calls from the RDBMS's perspective. And since the EJB's and JSP's are co-located there won't be any other additional overhead there either. (You are co-locating your JSP's and EJB's, aren't you?)
    <i>3) for better container resource utilization</i>
    Again, the EJB version will consume a lot more container resources.

Maybe you are looking for