javaeekickoff / java-ee-kickoff-app

javaee-kickoff-app
Other
179 stars 54 forks source link

Fails to deploy #19

Closed brhsasa closed 6 years ago

brhsasa commented 6 years ago

Service jboss.data-source is already registered web.xml:

   <data-source>
    <name>java:jboss/datasources/MysqlDSXA</name>
    <class-name>org.omnifaces.persistence.datasource.SwitchableXADataSource</class-name>
    <property>
        <name>configFile</name>
        <value>datasource-settings.xml</value> <!-- Driver/url/user/password are defined over there. -->
    </property>
    <transactional>true</transactional>
    <isolation-level>TRANSACTION_READ_COMMITTED</isolation-level>
    <initial-pool-size>2</initial-pool-size>
    <max-pool-size>10</max-pool-size>
    <min-pool-size>5</min-pool-size>
    <max-statements>0</max-statements>
</data-source>

persistence.xml

<persistence-unit name="kickoff">
            <jta-data-source>java:jboss/datasources/MysqlDSXA</jta-data-source>

    <mapping-file>META-INF/LoginToken.xml</mapping-file>
    <mapping-file>META-INF/User.xml</mapping-file>

    <properties>
        <property name="javax.persistence.schema-generation.database.action" value="drop-and-create" />
        <property name="hibernate.cache.use_second_level_cache" value="true" />
        <property name="hibernate.cache.use_query_cache" value="true" />
        <property name="wildfly.jpa.twophasebootstrap" value="false" /> <!-- https://issues.jboss.org/browse/WFLY-2727 -->
    </properties>
</persistence-unit>
BalusC commented 6 years ago

That will happen when datasource is already configured in server. You should then remove one of the both configurations.

The new <data-source> entry in web.xml is intented to remove the need to create server-specific datasource configurations for every different server.

brhsasa commented 6 years ago

I have already remove it, the tables has been created, but not completed, issues in entites, espacialy the token, also that is not the main issue, the main issue is that the apps is not deployed, it show errors like this one:

 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."java-ee-kickoff-app.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."java-ee-kickoff-app.war".WeldStartService: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Caused by: java.lang.reflect.MalformedParameterizedTypeException

brhsasa commented 6 years ago

You said the new <data-source> entry in web.xml is intented to remove the need to create server-specific datasource configurations for every different server. I know that, but you should know that is not compatible with other databases, like MySQL, oracle... you should create other classes instead of using SwitchableXADataSource because will raise error of casting

brhsasa commented 6 years ago

I used MySQL as database, but it does not deployed at all, it show cant not start services... like .WeldStartService and .Install example:

ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service 
jboss.deployment.unit."java-ee-kickoff-app.war".WeldStartService: org.jboss.msc.service.StartException 
in service jboss.deployment.unit."java-ee-kickoff-app.war".WeldStartService: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

also these errors:

Unable to execute JPA schema generation create command [alter table loginToken add constraint ....]
BLOB/TEXT column 'tokenHash' used in key specification without a key length.
WFLYCT0412: required services that are not installed: jboss.persistenceunit \ java-eekickoff-
app.war#kickoff
WFLYCT0180: Services with missing/unvailable dependencies => undefined
WFLYCT018: servce which failed to start service.jboss.persistenceunit
BalusC commented 6 years ago

Caused by: java.lang.reflect.MalformedParameterizedTypeException

Already reported in #17.

You said the new entry in web.xml is intented to remove the need to create server-specific datasource configurations for every different server. I know that, but you should know that is not compatible with other databases, like MySQL, oracle... you should create other classes instead of using SwitchableXADataSource because will raise error of casting

You just need to install JDBC driver yourself and edit driver class/url/username/password in datasource-settings.xml.

Unable to execute JPA schema generation create command [alter table loginToken add constraint ....]

Already reported in #20.

brhsasa commented 6 years ago

The tables are being generated as I alrready mentioned which means nothing to do with database configurations: driver, url, username, or password or with MySQL JDBC Driver, that I have also already added in pom.xm,, if it is, tables won't be generated. the problem is in your entities that are not coded well, alter table adding some constraints, tokenHash used without key length... Besides that I get errors related to starting services, that I have mentioned above.

BalusC commented 6 years ago

As commented on #20, it's a Hibernate bug.

Frankly, if you continue to behave angry and rude to me about your own mistakes and misunderstandings when using this project, which is written and open sourced for completely free and nothing, then I honestly don't really feel the urge to hint a solution to your specific problem with Hibernate.

Try again later.

brhsasa commented 6 years ago

That is a misunderstanding of my way of speaking, and those are not my mistakes, I think it is your project, and your code there?, I only mentioned your bugs no more so at the end to get solutions for them. and get the chance for others to use your own project with no misktakes. and I apologize for the misunderstanding.

brhsasa commented 6 years ago

After changing Hibernate version to either older or newer version, same errors occured, so I think that has nothing to do with Hibernate. what hibernate version did you used, and what version of WF also did you used?