facebook

how to create JSF project

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #353752 Reply

    amir55
    Participant

    hi all genius staff

    i was using MyEclipse for so many years but now using Myeclipse for spring 14.

    I am trying to create jsf project but in your help there is noting called dynamic project facet so I can follow.

    simply guide me please to the right links.

    I want ultimately to create a jsf primefaces project via scaffolding with the use of spring and hibernate capabilities.

    Thanks for all

    Amir

    #353753 Reply

    support-swapna
    Moderator

    Amir,

    Here is the tutorial for scaffolding JSF/Primes with Spring :
    https://www.genuitec.com/products/myeclipse/learning-center/spring/jsfprimefaces-and-spring-scaffolding-tutorial/

    Hope it helps. Let us know if you have any questions.

    #353772 Reply

    amir55
    Participant

    hi dear

    yea I could run the scaffolding spring and run but when selecting jsf and finish there is a failure.

    message said configuration failed see error.log

    I could not place where such error.log even after searching

    I chose database Derby Customer table in both app. It worked with spring selection and failed in jsf one

    thanks

    #353779 Reply

    support-swapna
    Moderator

    Amir,

    Please send us the .log file which is located at <workspace dir>/.metadata/.log for further investigation.

    #353784 Reply

    amir55
    Participant

    hi dear

    I hsve next error in deployment to JBoss7 as I never use tomcat any more

    so how to configure my server to derby then I try again to recreate app
    **************************************************************************************
    3:03:19,093 INFO [org.hibernate.ejb.Ejb3Configuration] (MSC service thread 1-3) HHH000204: Processing PersistenceUnitInfo [
    name: MyEclipse_Derby
    …]
    23:03:19,265 WARN [org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator] (MSC service thread 1-3) HHH000181: No appropriate connection provider encountered, assuming application will be supplying connections
    23:03:19,281 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.persistenceunit.”Scaffolding_JSF.war#MyEclipse_Derby”: org.jboss.msc.service.StartException in service jboss.persistenceunit.”Scaffolding_JSF.war#MyEclipse_Derby”: Failed to start service
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
    at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
    Caused by: javax.persistence.PersistenceException: [PersistenceUnit: MyEclipse_Derby] Unable to build EntityManagerFactory
    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914)
    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:889)
    at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
    at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162)
    at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    … 3 more
    Caused by: org.hibernate.HibernateException: Connection cannot be null when ‘hibernate.dialect’ not set
    at org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:97)
    at org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:67)
    at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:176)
    at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
    at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:71)
    at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2270)
    at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2266)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1735)
    at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:84)
    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904)
    … 9 more

    23:03:19,531 INFO [org.jboss.as.server] (DeploymentScanner-threads – 2) JBAS015870: Deploy of deployment “Scaffolding_JSF.war” was rolled back with failure message {“JBAS014671: Failed services” => {“jboss.persistenceunit.\”Scaffolding_JSF.war#MyEclipse_Derby\”” => “org.jboss.msc.service.StartException in service jboss.persistenceunit.\”Scaffolding_JSF.war#MyEclipse_Derby\”: Failed to start service”}}
    23:03:19,906 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment Scaffolding_JSF.war in 379ms
    23:03:19,906 INFO [org.jboss.as.controller] (DeploymentScanner-threads – 2) JBAS014774: Service status report
    JBAS014777: Services which failed to start: service jboss.persistenceunit.”Scaffolding_JSF.war#MyEclipse_Derby”: org.jboss.msc.service.StartException in service jboss.persistenceunit.”Scaffolding_JSF.war#MyEclipse_Derby”: Failed to start service

    23:03:19,906 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads – 1) {“JBAS014653: Composite operation failed and was rolled back. Steps that failed:” => {“Operation step-2” => {“JBAS014671: Failed services” => {“jboss.persistenceunit.\”Scaffolding_JSF.war#MyEclipse_Derby\”” => “org.jboss.msc.service.StartException in service jboss.persistenceunit.\”Scaffolding_JSF.war#MyEclipse_Derby\”: Failed to start service”}}}}
    *********************************************************************

    many thanks really

    Amir

    #353789 Reply

    support-swapna
    Moderator

    Amir,

    The tutorial is designed to work with Tomcat. If you want to deploy to JBoss then you will have to modify couple of things :

    1. In the persistence.xml add the below lines :

    <properties>
    <property name=”hibernate.dialect” value=”org.hibernate.dialect.HSQLDialect”/>
    </properties>

    2. Make sure the JBoss 7 supports JSF 2.0 applications and the expression language (EL) libraries are updated.

    If you see exception about EL, then please check if this suggestion helps :
    http://blog.moes.as/2008/09/how-to-remove-jsp-el-error.html

    I suggest you look up on the development forums to understand what jars needed to be included in the JBoss server for the EL to work.

    Hope this helps.

    #353790 Reply

    amir55
    Participant

    dear sir

    I managed to deploy and run app with spring option selected in scaffolding.using my JBos7 with your highly appreciated help.

    now next I created another app using same customer table from derby and yes deploys and run first page BUT once I select view customers I get this error

    An Error Occurred:
    /jsf/customer/listCustomers.xhtml @15,160 action=”#{CustomerComponent.newCustomer()}” Error Parsing: #{CustomerComponent.newCustomer()}

    something wrong in jsf code scaffolding creation

    thanks again

    Amir

    #353792 Reply

    amir55
    Participant

    dear sir

    here are my solution findings to my scaffolding queries with new ones at the bottom.

    1 – to import from derby selecting spring on JBoss7 // working
    a – add in src/resources/META-INF/persistence.xml next
    <properties>
    <property name=”hibernate.dialect” value=”org.hibernate.dialect.HSQLDialect”/>
    </properties>

    b- no jar needed

    2 – to import from derby selecting jsf on JBoss7 // working
    a – add in src/resources/META-INF/persistence.xml next
    <properties>
    <property name=”hibernate.dialect” value=”org.hibernate.dialect.HSQLDialect”/>
    </properties>
    b – add to lib
    el-api-2.2.0-SNAPSHOT.jar
    el-impl-2.2.0-SNAPSHOT.jar
    jboss-el-api_2.2_spec-1.0.0.Final.jar
    mysql-connector-java-5.0.3-bin.jar

    3 – to import from mysql selecting jsf on JBoss7 // working
    a – add in src/resources/META-INF/persistence.xml next
    <<properties>
    <property name=”hibernate.dialect” value=”org.hibernate.dialect.MySQLDialect”/>
    </properties>
    b – add to lib
    el-api-2.2.0-SNAPSHOT.jar
    el-impl-2.2.0-SNAPSHOT.jar
    jboss-el-api_2.2_spec-1.0.0.Final.jar
    mysql-connector-java-5.0.3-bin.jar

    thanks for your help and here are my notices on the app.

    but I have 3 questions so please answer clearly regarding each

    1 – does, by selecting jsf, mean we have automatically selected spring or we still can add spring capablities ?

    2 – how to create scaffolding selecting jsf, spring and hibernate ?

    3 – As for mapping, how to use xml mapping as hbm.xml in stead of annotation mapping?

    so many thanks and wishes

    Amir

    #353801 Reply

    support-swapna
    Moderator

    Amir,

    Apologies for the delay. Thank you for posting your findings.

    Here are the answers :

    1. When you are scaffolding a JSF project, the Spring capabilities are automatically added to the project. You can verify the same from the project properties > MyEclipse > Project Facets.

    2. The scaffolding JSF wizard generates JPA entities and adds the Hibernate properties files to the project. Please check this link to understand what is generated during the scaffolding : http://www.skywayperspectives.org/documentation/me4s90/html/ME4STutorialScaffoldingJSF/scaffoldingjsfarticle.html

    3. You can go through the Hibernate tutorials to understand how to use the hbm.xml instead of annotations.

    Here is a link for your reference :
    http://www.mkyong.com/hibernate/how-to-add-hibernate-xml-mapping-file-hbm-xml-programmatically/

    Here are couple of links which discuss Annotations Vs hbm.xml :
    https://forum.hibernate.org/viewtopic.php?f=1&t=989014
    https://forum.hibernate.org/viewtopic.php?f=1&t=988955

    For development related queries I suggest you check on development forums like stackoverflow.com for bettter support.

    Let us know if you see any issues.

    #353816 Reply

    amir55
    Participant

    thanks for all replies

    but my question was meant about why scaffolding does not have the option of hibrtnate like spring as you have in reverse engineering as I remember.

    in this way we get hibernate mapping instead of jpa annotation

    .scaffolding is one reason we pay higher than standard MYEclipse then it should have option of mapping.

    I like mainly to use jsf spring and hibernate so how I can do this in scaffolding code generation

    thanks again

    Amir

    #353820 Reply

    support-swapna
    Moderator

    Amir,

    I have escalated your request to the dev team. We will get back to you soon about the support for hibernate mapping.

    Thanks for your patience.

    #353831 Reply

    support-swapna
    Moderator

    Amir,

    I have filed an enhancement request for the dev team to support Hibernate mapping during scaffolding. I am afraid I cannot give any timeline at this point of time. I will keep you posted when I hear from the team.

    Sorry for any inconvenience caused.

Viewing 12 posts - 1 through 12 (of 12 total)
Reply To: how to create JSF project

You must be logged in to post in the forum log in