Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to deploy #19

Closed
brhsasa opened this issue Feb 19, 2018 · 9 comments
Closed

Fails to deploy #19

brhsasa opened this issue Feb 19, 2018 · 9 comments

Comments

@brhsasa
Copy link

brhsasa commented Feb 19, 2018

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
Copy link
Member

BalusC commented Feb 24, 2018

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.

@BalusC BalusC closed this as completed Feb 24, 2018
@brhsasa
Copy link
Author

brhsasa commented Feb 24, 2018

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
Copy link
Author

brhsasa commented Feb 24, 2018

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
Copy link
Author

brhsasa commented Feb 24, 2018

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
Copy link
Member

BalusC commented Feb 25, 2018

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
Copy link
Author

brhsasa commented Feb 25, 2018

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
Copy link
Member

BalusC commented Feb 25, 2018

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
Copy link
Author

brhsasa commented Feb 25, 2018

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
Copy link
Author

brhsasa commented Feb 25, 2018

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants