Config to use JPA 2.0 in eclipse for weblogic portal 10.3.2

Hi,
can anyone help me to config eclipse for WLP 10.3.2 for using JPA 2.0
Thanks!

Hi,
The following EclipseLink JPA tutorial for WebLogic 10.3.2 (EclipseLink 1.2 is shipped in the modules directory on WebLogic) is Eclipse IDE based and includes details on getting your EAR deployed and debuggable via the Eclipse 3.4/3.5 EE edition IDE. This is via the WebLogic server plugin or via the OEPE. Source is included for all EAR, EJB and WAR projects as well as the SE DDL generation project to setup your database.
The following tutorial and EclipseLink 2.0 wiki sites are the most current versions
http://wiki.eclipse.org/EclipseLink/Examples/JPA/WebLogic_Web_Tutorial
http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/weblogic
thank you
/michael
http://www.eclipselink.org

Similar Messages

  • How to integrate Oracle Enterprise Pack for Eclipse with Weblogic Portal

    Hi
    I am following this documentation http://download.oracle.com/docs/cd/E15919_01/wlp.1032/e14252/setup_dev_env.htm#i1013214
    to setup my development environment for developing portal applications, but I cannot set it up, my eclipse does not have PORTAL perspective.
    I have downloaded the Oracle Enterprise Pack for Eclipse 11gR1 (11.1.1.5) and the Oracle WebLogic Portal 10.3 as mentioned in the documentation.
    The Oracle Weblogic Portal 10.3 includes a workshop version of eclipse, but that is not based on a recent Eclipse, that is why I would like to use the Oracle Enterprise Pack for Eclipse 11gR1 (11.1.1.5).
    It is weird int he Oracle Portal 10.3 installation that I cannot install the Weblogic Portal without the Workshop.
    Could you help me in this? How can I integrate the Oracle Enterprise Pack for Eclipse with Weblogic Portal?
    Thank you.

    For WebLogic Portal tooling you have a couple of options. For WebLogic Portal 10.3 and older, Workshop for WebLogic will be your tooling environment.
    Starting in WebLogic Portal 10.3.2, which released this year, the development tools have migrated to Oracle Enterprise Pack for Eclipse. The WebLogic Portal 10.3.2 installer will install both the runtime and the IDE configured with additional WebLogic Portal Eclipse features (Portal Project Configuration, Perspecitives, Palettes, Deployment, etc).
    If you are interest in the latest version, you can download from the WebLogic Portal OTN page - http://www.oracle.com/technology/products/weblogic/portal/index.html

  • Using common httpsession in Remote Portlets of Weblogic Portal

    I am using Oracle's Weblogic Portal and I am using multiple remote Producers in Portal application, I want too know if I can use common Http Session among multiple Producer Portlets?
    I am consuming Portlets from Producers in one portal and I have one common Login for Portal.

    There is a much easier pattern for this, but it may or may not serve your needs. You can use Community Preferences. You can set/get them from portlets, control who sets it using portlet security, etc. The one difference is that you won't see it enumerated with the other community properties when you edit a community in the admin view.
    Another option is to do as you planned; you would need to use the plumtree server API to update the data, but you should be able to fetch it using the remote search API. might want to post questions on the respective discussions (native API and prc) for those questions...

  • How to import projects from workshop 8.1 to eclipse for weblogic 11.1

    I see a few howto's for migrating from workshop 8.1 to workshop for 10 but it is not obvious how to import existing 8.1 projects into enterprise pack for eclipse. If there is a how to out there could someone point it to me or maybe give me a quick walk through.
    Jerry

    There is no tooled support for project migration from Workshop to OEPE (regardless of version).
    The biggest question when contemplating such migration is whether you are using Beehive components (NetUI, Controls, etc.). Oracle support for Beehive ended with Workshop. If your application uses these technologies, you will need to stay with Workshop. The last version of Workshop was for WLS 11gR1 (10.3.1). No future versions are planned.
    If your application does not use Beehive components (or you can migrate away from them), then you can move to OEPE. The only supported approach is to recreate necessary projects in OEPE and copy your source code over.
    - Konstantin

  • Problem using ant 1.6.2 scripts for weblogic 8.1

    hai,
    i downloaded ant 1.6.2 and started writting ant scripts. these ran fine when i am doing jobs related to websphere application server but they are failing when i am running the same targets in weblogic.
    i know that this problem is mainly due to the old version of inbuilt ant provided by the weblogic.
    i use import,input,condition tasks in my code and when ever run the ant scripts in weblogic its saying that these targets can not be found.
    i am in great need for help, any one please help me how to make these newer version of ant scripts to work in weblogic.i have no choice but to use these tasks as the design requires using them.
    i will be greatly indebted to the replier as i am wasting lot of time for this.

    Hello,
    I could not find an easy way to get the wls version of ant to start using the tasks you mention from ant 1.6.2.
    I tried defining the tasks using taskdef and also adding them to wls ant.jar and updating the deafult.properties file but the ant complained about unexpected elements in the build.xml file where I added the new tags (e.g import)
    If your really up against it you can try adding wls tasks to ant 1.6.2, they are listed here:
    http://e-docs.bea.com/wls/docs81/toolstable/ToolsTable.html#1009580
    Although I could not located exactly which jar they are in. Good luck.
    Cheers
    Hussein Badakhchani
    www.orbism.com

  • JPA Error "No Persistence provider for EntityManager",using org.eclipse.per

    Hello Colleagues,
    I have created JPA project, with out any error have done mapping also. with orm.xml and persistense .xml
    I am getting No Persistence provider for EntityManager error when calling Entity Manager in Entity class
    Error >>> EntityManagerFactory emf = Persistence.createEntityManagerFactory("Personalization_JPA");
    { No Persistence provider for EntityManager named Personalization_JPA }
    Persistence Provider as "org.eclipse.persistence.jpa.PersistenceProvider
    In persistence.xml for my JPA project , I have included following in respective tabs
    1) GENERAL Tab of Persistence.xml
    a) Persistence Provider as "org.eclipse.persistence.jpa.PersistenceProvider"
    b) In Managed classes included my Entity class and test application that calls the entity manager
    c) orm.xml in xml mapping files
    2) Connections Tab of Persistence.xml
    a) Transaction Type as Resource Local, not using any JTA datasourse name in database field
    3) Properties Tab of Persistence.xml
    property name="driver" value="com.sap.dbtech.jdbc.DriverSapDB"
    property name="url" value="jdbc:sapdb://localhost/w15"
    property name="username" value="SAPW15DB"
    property name="password" value="sapsapr3"
    If anything wrong is specified please kindly inform me.

    Hello colleague,
    As per your suggestion I removed Persistence Provider as "org.eclipse.persistence.jpa.PersistenceProvider", made it blank in persistence.xml, but still I get the same error saying No Persistence provider for EntityManager, please have a look at other attributes of persistence.xml
    In persistence.xml for my JPA project , I have included following in respective tabs
    1) GENERAL Tab of Persistence.xml
    a) Persistence Provider as  blank or "org.eclipse.persistence.jpa.PersistenceProvider" makes no difference
    b) In Managed classes included my Entity class and test application that calls the entity manager
    c) orm.xml in xml mapping files
    2) Connections Tab of Persistence.xml
    a) Transaction Type as Resource Local, not using any JTA datasourse name in database field
    3) Properties Tab of Persistence.xml (connecting to maxdb, so is this necessary or not )
    property name="driver" value="com.sap.dbtech.jdbc.DriverSapDB"
    property name="url" value="jdbc:sapdb://localhost/w15"
    property name="username" value="SAPW15DB"
    property name="password" value="sapsapr3"
    If anything wrong is specified please kindly inform me.

  • How to get the TransactionManager in a stateful EJB (using JPA toplink)

    I use weblogic 10.3
    This is my stateful EJB and I need to get the TransactionManager because I want to suspend my transaction...
    Here it is ok for the UserTransaction ut but I got an error with the TransactionManager
    EJB Code
    //@Stateless(name = "MyFacadeEJB", mappedName = "MyFacadeEJB")
    @Stateful(name = "MyFacadeEJB", mappedName = "MyFacadeEJB")
    @TransactionManagement(TransactionManagementType.BEAN)
    @Remote
    @Local
    public class MyFacadeEJBBean implements MyFacadeEJB, MyFacadeEJBLocal, Serializable {   
    @Resource javax.transaction.UserTransaction ut;
    @Resource javax.transaction.TransactionManager tm;
    Error Message at the deploy EJB
    Unable to deploy EJB: MyFacadeEJB from PocJTA-PEJB-ejb:
    [EJB:011026]The EJB container failed while creating the java:/comp/env namespace for this EJB deployment.
    weblogic.deployment.EnvironmentException: [EJB:010176]The resource-env-ref 'test.ejb.MyFacadeEJBBean/tm' declared in the ejb-jar.xml descriptor or annotation has no JNDI name mapped to it. The resource-ref must be mapped to a JNDI name using the resource-description element of the weblogic-ejb-jar.xml descriptor or corresponding annotation.
         at weblogic.ejb.container.deployer.EnvironmentBuilder.addResourceEnvReferences(EnvironmentBuilder.java:639)
         at weblogic.ejb.container.deployer.EJBDeployer.setupEnvironmentContext(EJBDeployer.java:247)

    Chpruvos,
    Hi, I ran into a similar issue when specifying WebLogic specific descriptors in ejb-jar.xml and the corresponding weblogic-ejb-jar.xml. I no longer use this approach in our example code - we just use annotations. see: http://wiki.eclipse.org/EclipseLink/Examples/JPA/WebLogic_Web_Tutorial#Tutorial_Source
    My session bean is stateless - I don't know how much it will help with your statefull bean managed config but here are copies of the ejb.jar configuration xml I used to use. All the resource*ref elements (see the resource-description* element) ended up in the weblogic specific weblogic-ejb-jar.xml descriptor file.
    ejb-jar.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:ejb="http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee [http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd]" version="3.0">
    *<enterprise-beans>*
    *<session>*
    *<ejb-name>ApplicationService</ejb-name>*
    *<ejb-class>org.eclipse.persistence.example.unified.business.ApplicationService</ejb-class>*
    *<session-type>Stateless</session-type>*
    +<!-- default to CMP Container managed transations not BMP -->+
    +<!-- transaction-type>Bean</transaction-type-->+
    +<!-- resource-env-ref id="ResourceEnvRef_1080980284303">+
    +<resource-env-ref-name>localOracle10RemoteDS</resource-env-ref-name>+
    +<resource-env-ref-type>javax.sql.DataSource</resource-env-ref-type>+
    +</resource-env-ref-->+
    +<!-- resource-ref>+
    +<res-ref-name>localOracle10RemoteDS</res-ref-name>+
    +<res-type>javax.sql.DataSource</res-type>+
    +<res-auth>Application</res-auth>+
    +</resource-ref-->+
    *</session>*
    *</enterprise-beans>*
    </ejb-jar>
    weblogic-ejb-jar.xml
    <?xml version="1.0"?>
    <weblogic-ejb-jar>
    *<weblogic-enterprise-bean>*
    *<ejb-name>ApplicationService</ejb-name>*
    *<stateless-session-descriptor>*
    *<pool>*
    *<max-beans-in-free-pool>8</max-beans-in-free-pool>*
    *<initial-beans-in-free-pool>2</initial-beans-in-free-pool>*
    *</pool>*
    *</stateless-session-descriptor>*
    {color:#008000}<resource-description>
    <res-ref-name>localOracle10RemoteDS</res-ref-name>
    <jndi-name>localOracle10RemoteDS</jndi-name>
    </resource-description>
    <resource-env-description>
    <resource-env-ref-name>localOracle10RemoteDS</resource-env-ref-name>
    <jndi-name>localOracle10RemoteDS</jndi-name>
    </resource-env-description>
    {color}+<!-- jndi-name>localOracle10RemoteDS</jndi-name-->+
    *</weblogic-enterprise-bean>*
    </weblogic-ejb-jar>
    thank you
    /michael
    [http://www.eclipselink.org|http://www.eclipselink.org/]
    Edited by: michael_obrien on Feb 26, 2009 9:56 AM

  • Problem when using Logger with Tomcat and eclipse

    Hi, Iam using Tomcat 5.5.7 and my IDE is eclipse.Iam using java.util.logging.Logger class for logging.Iam putting the properties file in Appname/WEB-INF directory.The properties file is not identified.The error Iam getting is Error initialising log file java.lang.NullPointerException and java.io.FileNot FoundException
    The content of my logging.properties file is
    java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.level=SEVERE java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
    java.util.logging.FileHandler.level=ALL java.util.logging.FileHandler.pattern=%h/javalogs%u.log java.util.logging.FileHandler.append=true java.util.logging.FileHandler.count=1
    My servlet is
    import java.io.*;
    import java.util.logging.*;
    import java.util.logging.Logger;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class HelloWorldServlet extends HttpServlet
          public void init(ServletConfig config) throws ServletException
               try
                         String file=getServletConfig().getInitParameter("java.util.logging.config.file");
                        InputStream is = getServletContext().getResourceAsStream(file);
                        LogManager.getLogManager().reset();
                          LogManager.getLogManager().readConfiguration(is);
               catch(Exception e)
                    System.out.println("Error initialising log file"+e);
          public void doGet (HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException 
                   final Logger fLogger =
                 Logger.getLogger(HelloWorldServlet.class.getName());
                 PrintWriter  out; 
                 String title = "Simple Servlet Output";
                // set content type and other response header fields first                                   
                // then write the data of the response
                 response.setContentType("text/html");
                 fLogger.finest("this is finest");
                 fLogger.finer("this is finer");
                 fLogger.fine("this is fine");
                 fLogger.config("this is config");
                 fLogger.info("this is info");
                 fLogger.warning("this is a warning");
                 fLogger.severe("this is severe");
                 out = response.getWriter();
                out.println("<P>This is output from SimpleServlet!!!!!!!!.");  
    }My web.xml file is
    <!DOCTYPE web-app
      PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
      "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
      <servlet>
        <init-param>
         <param-name>java.util.logging.config.file</param-name>
         <param-value>/WEB-INF/classes/logging1.properties</param-value>
        </init-param>
        <servlet-name>HelloServlet</servlet-name>
        <servlet-class>HelloWorldServlet</servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>HelloServlet</servlet-name>
        <url-pattern>/hello</url-pattern>
      </servlet-mapping>
    </web-app>Can anybody help me out.

    Hi, Iam using Tomcat 5.5.7 and my IDE is eclipse.Iam using java.util.logging.Logger class for logging.Iam putting the properties file in Appname/WEB-INF directory.The properties file is not identified.The error Iam getting is Error initialising log file java.lang.NullPointerException and java.io.FileNot FoundException
    The content of my logging.properties file is
    java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.level=SEVERE java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
    java.util.logging.FileHandler.level=ALL java.util.logging.FileHandler.pattern=%h/javalogs%u.log java.util.logging.FileHandler.append=true java.util.logging.FileHandler.count=1
    My servlet is
    import java.io.*;
    import java.util.logging.*;
    import java.util.logging.Logger;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class HelloWorldServlet extends HttpServlet
          public void init(ServletConfig config) throws ServletException
               try
                         String file=getServletConfig().getInitParameter("java.util.logging.config.file");
                        InputStream is = getServletContext().getResourceAsStream(file);
                        LogManager.getLogManager().reset();
                          LogManager.getLogManager().readConfiguration(is);
               catch(Exception e)
                    System.out.println("Error initialising log file"+e);
          public void doGet (HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException 
                   final Logger fLogger =
                 Logger.getLogger(HelloWorldServlet.class.getName());
                 PrintWriter  out; 
                 String title = "Simple Servlet Output";
                // set content type and other response header fields first                                   
                // then write the data of the response
                 response.setContentType("text/html");
                 fLogger.finest("this is finest");
                 fLogger.finer("this is finer");
                 fLogger.fine("this is fine");
                 fLogger.config("this is config");
                 fLogger.info("this is info");
                 fLogger.warning("this is a warning");
                 fLogger.severe("this is severe");
                 out = response.getWriter();
                out.println("<P>This is output from SimpleServlet!!!!!!!!.");  
    }My web.xml file is
    <!DOCTYPE web-app
      PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
      "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
      <servlet>
        <init-param>
         <param-name>java.util.logging.config.file</param-name>
         <param-value>/WEB-INF/classes/logging1.properties</param-value>
        </init-param>
        <servlet-name>HelloServlet</servlet-name>
        <servlet-class>HelloWorldServlet</servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>HelloServlet</servlet-name>
        <url-pattern>/hello</url-pattern>
      </servlet-mapping>
    </web-app>Can anybody help me out.

  • Why can't i use JPA?

    i am using Eclipse. i installed Java EE 1.6.24.
    However, i cannot access: javax.persistence.*, it doesn't even show up in content assist. i realized this could be an Eclipse thing, but does anyone have anything else i can check?
    should i go look in the actual java jar file and see if the package exists?
    any help is appreciated....

    Kayaman wrote:
    pedron wrote:
    in Eclipse the entire API is (usually) available and ready for import. However, for me the entire javax.persistence.* is NOT available at all. Since when? Also what do you consider "the entire API"?
    All my projects have a suitable library in the project path (usually with the source code or at least the javadoc attached). Which library does your project have?Look, like i said, i'm new to this, that's why i came to the forum to ask the question. i've used a bunch of different stuff in Eclipse. I know about importing jars, libraries, all that stuff.
    However, i've googled how to use JPA and it says that it's part of Java EE 6, which i've installed and am now using in Eclipse as my active JRE. (I've been using 1.6 for awhile, but i just installed 1.6.24.)
    As far as i have seen in my, albeit limited, experience, is that libraries that are said to be in the Java EE 6 (like, for instance, annotations) are just there, with no special library import. I can get content assist to find, for instance, javax.annotation.*, but not javax.persistence.*, and that's where i'm confused.
    So, maybe i don't know libraries very well, that's fine. But i've never seen it said anywhere that i've read that i need to import some special library to run JPA. Is this the case? I'm not trying to burden the forum. i've done some research and am looking to find what i'm lacking in information. the snide comments don't help anyone... (not yours)
    thanks

  • If an app uses JPA with a WAR, where does persistence.xml go?

    If I'm constructing an app using JPA entities, but just in a WAR file, not an EAR file, as I'm not using the other EJB components, where does the persistence.xml file get deployed to? Is it just WEB-INF/classes, or do I have to do something like WEB-INF/classes/META-INF (one resource i saw implied this)?

    david.karr wrote:If I'm constructing an app using JPA entities, but just in a WAR file, not an EAR file, as I'm not using the other EJB components, where does the persistence.xml file get deployed to? Is it just WEB-INF/classes, or do I have to do something like WEB-INF/classes/META-INF (one resource i saw implied this)?Yes, put it in WEB-INF/classes/META-INF. If you're using JDeveloper or Eclipse Webtools and you put the persistence.xml in src\META-INF compiling will put it into WEB-INF\classes\META-INF for you.
    --Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Can't use JPA facet in a Workshop 10.3 EJB project

    Greetings,
    I'm using Oracle Workshop for WebLogic 10.3 to migrate an enterprise application from JBoss 5.0 to WebLogic 10.3. I'm a bit confused as, while I can add the JPA facet to a Dynamic Web project, I cannot do the same with an EJB project. I'd need to take advantage of the IDE automatic facets management instead to manually dealing with libraries and dependencies. I beleive that this is the reason these facets exist. However, after having created a EJB 3.0 project, it is impossible to add to it the JPA facet. I had to define the JPA entities in a Dynamic Web project as this is the only one to which I can add the JPA facet. This is not regular. Additionally, the SLSB facades may only be defined in an EJB project. They reference the JPA entities in the Dynamic Web project which, given the class loading hierarchy, is not possible. So my question is: how is one supposed to use JPA with WTP projects ?
    Many thanks in advance for any help,
    Nicolas

    This isn't supported in Workshop 10.3 and prior, the JPA tooling only works with Dynamic Web Projects in those releases to my knowledge.
    I think this changed in OEPE 11g. Check out this article that shows JPA being used in the context of a Utility Project:
    http://www.oracle.com/technology/pub/articles/cioroianu-eclipse-jpa.html
    OEPE 11g Download: http://www.oracle.com/technology/software/products/oepe/index.html

  • How to create a iview in eclipse for connecting  R/3 using JCA?

    Hi everybody,
           I want to create a iview in eclipse for connecting  R/3 using JCA. Can any body send me java code for this purpose. i tried one example from sdn in eclipse but i did't get any code for the same.
    thanking you
    Rajendra

    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/documents/a1-8-4/sap connector examples download.htm

  • How to use JPA in a worker thread?

    I'm using WebLogic 10.3.5.0 with JPA 2.0 and have the following scenario:
    - user needs to start a task takes some time to complete;
    - this task needs to read and write to DB;
    One solution would be to write a worker and use the WorkManager feature to start this from an session EJB.
    How should I use JPA from this worker to access the DB in a transactional manner?

    You should be able to use it as normal.
    Your worker class is probably not injected like your SessionBean, so you would either need to pass the EntityManager, or look it up either through JNDI if container managed, or Persistence if application managed.
    For transactions, you either need to use JTA directly if using JTA, or use JPA transactions if using RESOURCE_LOCAL.

  • Using JPA Entity-Objects defined in other EJB-Development Component

    Hello Community,
    I'm working on a Java-Application on NW CE 7.1, using JEE5 Beans in the Business-Logic-Layer and WebDynpro/Java in the UI-Layer.
    I designed a Bean for working with data, stored in a database-table of the system-database.
    For that addtionally i created a class, representing the Entity-Object, in the same Development-Component of Type EJB 3.0.
    It looks like this:
    @NamedQueries ({
         @NamedQuery (name="findAllSdCust", query="SELECT c from SdCust c ORDER BY c.kdnr"),
         @NamedQuery (name="findSdCustByKdnr", query="SELECT c from SdCust c WHERE c.kdnr = :kdnr"),
         @NamedQuery (name="findSdCustByIlnnr", query="SELECT c from SdCust c WHERE c.ilnnr = :ilnnr")
    @Entity
    @Table(name="ZKALL_SD_CUST")
    public class SdCust implements Serializable {
         @Id
         @TableGenerator (name="idGenerator", table="ZKALL_ID_GEN", pkColumnName="GEN_KEY", valueColumnName="GEN_VALUE", initialValue=100)
         @GeneratedValue (strategy=GenerationType.TABLE, generator="idGenerator")
         private long id;
         private String name;
         private String lname;
         private String kdnr;
         private String ilnnr;
         private long connid;
         private long cnt;
         @Version
         private long version;
          Constructor, Getter and Setter methods follow here
    The corresponding bean looks like this
    @Stateless(name="SdCustBean")
    public class SdCustBean implements SdCustLocal {
         @PersistenceContext (unitName="xyz")
         private EntityManager em;
         public SdCust getSdCustByKdnr (String kdnr)
              SdCust result = new SdCust();
              // List<Manufacturer> resultList = new ArrayList<Manufacturer>();
              Query  myQuery = em.createNamedQuery("findSdCustByKdnr");
              myQuery.setParameter("kdnr", kdnr);
              result = (SdCust) myQuery.getSingleResult();
              return result;
         public void setEM (EntityManager iem)
              em = iem;
           // other methods .....
    After that i created a new Development-Component of Enterprise Application-Type and added above DC to this EAR-DC. I also supplied the nessecary descriptor-files/Enries in EJB-DC and EAR-DC.
    When now using this bean from WebDynpro with the Web-Dypro EJB-Model-Import everything works fine.
    The bean returns the desired object(s).
    But now i created a new DC of type EBJ 3.0
    This DC contains a Message Driven Bean. That MDB is a Job-Bean which i want to schedule. That  Bean uses JRA to connect to an SAP-Abap-System to read some Data and should use JPA to insert/upate/delete the read data in the Database. This should work as a simple replication for my application.
    I assigned that EJB-DC containing the MDB to a new EAR-DC together with job-definition-xml and the neccessary entries in deployment-descriptors.
    After deploying i see the corresponding job-defition in the NW scheduler using the administrator-views.
    I'm also able to schedule the job and it executes fine. Connecting to SAP-Abap System also works fine using JRA.
    But JPA does not work!!!!!
    I created an dependency from my EAR-DC containing the Job EJB-DC and to the EJB-DC containing the Entity-Class.
    I tried three diferent things to get i running, but all of them failed.
    1.)
    The part  looks like:
    public class MasterDataReplicateJobBean extends MDBJobImplementation implements MessageListener
      @EJB SdCustBean mybean;
       public void onJob(JobContext ctx) throws Exception {
            SdCust sdCust = mybean.getSdCustByKdnr (mykdnr);
    Compiles fine. But this fails because the Data is stored in the system-database. The exception says, that i have to use a datasource which supports 2-Phase commit. I know, that i could possibly solve this problem by annotation the Method getSdCustByKdnr with the Annotation for the Transaction-Manager to use REQUIRES_NEW Transaction. But i dont want to generally annotate my methods this way.
    2.)
    This part looks like this
    public class MasterDataReplicateJobBean extends MDBJobImplementation implements MessageListener
    @PersistenceContext (unitName="xyz")
    private EntityManager em;
       public void onJob(JobContext ctx) throws Exception {
         SdCust cust = new SdCust();
         Query  myQuery = em.createQuery("SELECT c from SdCust c WHERE c.kdnr = :kdnr");
         myQuery.setParameter("kdnr", dbkdnr);
         cust = (SdCust) myQuery.getSingleResult();
    This also results in a runtime-exception because the entity-Manager cant resolve SdCust from the Query as an Object. The Exception is:
    java.lang.IllegalArgumentException: line 1: Abstract Schema Type 'SdCust' doesn't exist
    SELECT c from SdCust c WHERE c.kdnr = :kdnr
    3.) and last try so far:
    public class MasterDataReplicateJobBean extends MDBJobImplementation implements MessageListener
    @PersistenceContext (unitName="xyz")
    private EntityManager em;
       public void onJob(JobContext ctx) throws Exception {
         SdCustBean custBean = new SdCustBean();
         custBean.setEM(em);
         SdCust cust = custBean.getSdCustByKdnr(kdnr);
    In this example i use the Bean from the beginning not as a bean itself but as a normal class. that class has an addtional Method setEM to set the Entity-Manager (which is injected when using the class as a bean)
    In that way i got the exception, that the named Query "findSdCustByKdnr" cannot be found by the entity-manager.
    It seems to me, that i can access the class, but that all annotations belonging to JPA for that class are not recognized.
    Does anybody can give me a hint to solve this problem? Did i forgot something important?
    best regards
    matthias hayk
    Edited by: Matthias Hayk on Feb 5, 2009 9:38 AM

    I was already on wright trace.
    My class "SdCust" was not recognized by the Entity-Manager as an Entity-Class.
    This relies on the storage of the entity-class and where the Entity-Manager looks for entity-classes.
    By default it seems to look for all classes in the same jar file. thats the reason why everything works fine when the using bean and the entity-class are in the same project.
    In my last case, the using bean is in another  development-component and so also in anohter jar file. in this case the entity-manager must be told where to find entity-classes.
    this is done in the persistence.xml file.
    i added the line
    <jar-file>xxx.yyy.com~mdata_beans.jar</jar-file>
    underneath the <persistence-unit>-tag.
    This works.
    regards
    Matthias Hayk

  • How to Use Step with Filters in Eclipse

    Hello, everyone!
    I have a question. How do I keep myself from accessing methods outside my own class? See, when I use the debug feature of Eclipse, (I am using Eclipse 3.0), and start debugging, I often "Step Into" methods of classes like String.class and the like. Doing so produces errors that I need to click on to for numerous times! =( It hinders me from doing what I want to do. Can anyone help me? How do I prevent Eclipse from doing that again? After all, my only concern is seeing the methods I wrote in action, and I don't really want to bother with the ones already defined in Java (like Integer.Class and such).
    I also did a search on google, but the sites that turned up are only those that say Use Step with Filters, and nothing specific (most of them are copy-pastes, so different sites end up saying exactly the same thing ). I did that already, and the same thing happens. What do I have to do in
    Window->Preferences->Java->Debug? Do I have to add packages, classes or filters? If so, how should I do it?
    Sorry for the long entry, but I'm getting frustrated with clicking on the errors... I hope someone can help me. =)
    Thanks in advance! =D

    Go to Window-Preferences-Java-Debug-Step Filtering. When the dialog opens, press F1 for help. Good luck!

Maybe you are looking for