Menu

ejb facade generated from crud generator not work on tomee 1.7 into netbeans 8.0.1

mauro
2014-10-23
2015-11-06
  • mauro

    mauro - 2014-10-23

    Hi i am a new user of sourceforge.
    i have tried the crud generator from netbeans 8.0.1 with tomer 1.7 .
    The ejbs facade and jsf page are generated.

    But i get error because tomee plus with openjpa and tomee plume with eclipselink use jpa 2.0 and not 2.1 jpa.
    So the features of query tuped created into the abstract ejb not is available .
    Do you have a workaround ?

    I have view the video on tomee and derby but not resolve my problem.

    From tomee the new features of jpa 2.1 are not available.

    when i compile and deploy on tomee 1.7 i get :
    .........................................
    /home/utente_javaee7/NetBeansProjects/ptrovacanc/src/java/mauro/ejbs/AbstractFacade.java:59: warning: [unchecked] unchecked method invocation: method createQuery in interface EntityManager is applied to given types
    javax.persistence.Query q = getEntityManager().createQuery(cq);
    required: CriteriaQuery<t>
    found: CriteriaQuery
    where T is a type-variable:
    T extends Object declared in method <t>createQuery(CriteriaQuery<t>) </t></t></t>

    Please how i can resolve ? I have:

    Netbeans 8.0.1
    Jdk 8
    Tomer 1.7 plus and plume ( with openjpa anf eclipse-link jpa )

    Tank you

    mauro

     

    Last edit: mauro 2014-10-23
  • Kay Wrobel

    Kay Wrobel - 2014-10-23

    Hi Mauro.

    Can you post your code somewhere (like pastebin)? I just checked the spec for JSR-317 and found that it does support CriteriaQuery. So maybe there's a syntactical error?
    Also, this might not be the right place to ask this kind of question since it seems for geared towards the OpenJPA team rather than the CRUD Generator. You could sign up for their mailing list and ask the question there.

    But let's see some code first. Ok?

     
    • mauro

      mauro - 2014-10-24

      the resources.xml and persistence.xml
      http://pastebin.com/J3sWuMN3

      the ejb facade abstract generated

      http://pastebin.com/5TTHpJkJ

      the error that i get at build time
      http://pastebin.com/ntZzB0nL

       

      Last edit: mauro 2014-10-24
  • Kay Wrobel

    Kay Wrobel - 2014-10-24

    Ahhhh. I looked at that build log of yours: you don't actually have compile errors, but warnings. It's just telling you that you're not checking for the returned types, which is fine. The code will run. If you scroll all the way down, you'll see that the build actually succeeded.

     
    • mauro

      mauro - 2014-10-24

      i have added into classpath the files_
      tomee/lib/javaee-api-6.0-6-tomcat.jar

      tomee/lib/openjpa-2.4.0-nonfinal-1598334.jar

      into the project- properties -libraries -compile . I have uncheched the option package (for not include it into the war finally but for get the classes at compile time) .

      It build but then i get:

      ant -f /home/utente_javaee7/NetBeansProjects/ptrovacanc -Dnb.internal.action.name=run -Ddirectory.deployment.supported=true -DforceRedeploy=false -Dnb.wait.for.caches=true -Dbrowser.context=/home/utente_javaee7/NetBeansProjects/ptrovacanc run
      init:
      deps-module-jar:
      deps-ear-jar:
      deps-jar:
      library-inclusion-in-archive:
      library-inclusion-in-manifest:
      compile:
      compile-jsps:
      Checking data source definitions for missing JDBC drivers...
      Incrementally deploying http://localhost:8080/ptrovacanc
      Completed incremental distribution of http://localhost:8080/ptrovacanc
      Incrementally redeploying http://localhost:8080/ptrovacanc
      Deploy is in progress...
      deploy?config=file%3A%2Ftmp%2Fcontext2668546616478258785.xml&path=/ptrovacanc
      FAIL - Deployed application at context path /ptrovacanc but context failed to start
      /home/utente_javaee7/NetBeansProjects/ptrovacanc/nbproject/build-impl.xml:1045: The module has not been deployed.
      See the server log for details.
      BUILD FAILED (total time: 6 seconds)
      ..............

      from the servbers tab i get int othe tomee server added the application deployed but it have the label [stopped] .
      if i right click and click on start it not run .

      i get : FAIL. The application at the path/ptrovacanc could not be start,

       
  • Kay Wrobel

    Kay Wrobel - 2014-10-24

    But your build was ok. Sounds to me like you have a deployment error. Also, you should not need to add those jars into the class path. They are automatically part of the class path since you're deploying into the TomEE container. When you click on the Libraries node and expand your TomEE node, you will see all of its jars listed there. So try not to add too much unnecessary jars.
    You should look at the TomEE server log to see what's up with your deployment. I found TomEE to be a little sketchy with deployments and frequently found myself undeploying my app and restarting TomEE then re-deploying my app. It's just not quite as stable as something like Glassfish 4. So try that. undeploy, stop & start Tomee, then deploy your app. If you get a failure, check out the TomEE log. It will tell you why it couldn't deploy.

    Ok?

     
    • mauro

      mauro - 2014-10-25

      i have found the problem .

      was because into web.xml the url pattern ve put jsf
      I have correct with
      .jsf and now deploy.

      The app it is deployed but when i click on list page , i get the following error:
      ...................................

      /pagine/discountCode/Create.xhtml: Property 'create' not found on type mauro.controller.DiscountCodeController$$OwbNormalScopeProxy0

      viewId=/pagine/discountCode/List.xhtml
      location=/home/utente_javaee7/NetBeansProjects/ptrovacanc/build/web/pagine/discountCode/List.xhtml
      phaseId=RENDER_RESPONSE(6)

      Caused by:
      javax.el.ELException - /pagine/discountCode/Create.xhtml: Property 'create' not found on type mauro.controller.DiscountCodeController$$OwbNormalScopeProxy0
      at org.apache.myfaces.view.facelets.compiler.AttributeInstruction.write(AttributeInstruction.java:55)


      you think that the error it is caused from the
      public static enum PersistAction {

          CREATE,
          DELETE,
          UPDATE
      }
      

      the enum it is a class static of JSFUtil class .
      ???????

       

      Last edit: mauro 2014-10-25
  • Anonymous

    Anonymous - 2015-10-06
    1. **Header | Header | Head


    Header Header Header
    Cell Cell Cell
    Cell Cell Cell er
    ---------- ---------- ------
    Cell Cell Cell
    Cell Cell Cell
     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.