Why does WildFly fail to create a data source because a deployed application's persistence context initialization fails?

时间:2018-01-14 22:06:39

标签: wildfly datasource

I created a data source java:/jdbc/project1 in WildFly 11.0.0.Final's web frontend (in a fresh installation after creation an admin user using bin/add-user.sh) which I couldn't use because I specified Apache Derby's client data source implementation instead of the client driver[1]. Since it's not possible to edit data source definitions, but necessary to delete and re-create them, I specified the client driver and created the data source. This fails due to

 Sun Jan 14 22:54:21 GMT+100 2018
Unknown error

Unexpected HTTP response: 500

Request
{
    "name" => "project1",
    "use-ccm" => true,
    "jta" => true,
    "password" => "project1",
    "enabled" => true,
    "jndi-name" => "java:/jdbc/project1",
    "pool-name" => "project1_Pool",
    "connection-url" => "jdbc:derby://localhost:1527/project1",
    "driver-class" => "org.apache.derby.jdbc.ClientDriver",
    "driver-name" => "derbyclient.jar",
    "user-name" => "project1",
    "operation" => "add",
    "address" => [
        ("subsystem" => "datasources"),
        ("data-source" => "project1")
    ]
}

Response

Internal Server Error
{
    "outcome" => "failed",
    "failure-description" => "WFLYCTL0441: Operation has resulted in failed or missing services 
WFLYCTL0186:   Services which failed to start:      service jboss.persistenceunit.\"project1-ear-1.0-SNAPSHOT.ear/project1-web-1.0-SNAPSHOT.war#richtercloud_project1-web_war_1.0-SNAPSHOTPU\": org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
",
    "rolled-back" => true
}

which in my understanding means that the persistence unit of the previously deployed application project1 fails to initialize a Hibernate service/implementation/whatever which is odd because:

  • I'm not using hibernate in this application. WildFly might think that I do because I haven't figured out classloader delegation, yet, but that shouldn't matter because...
  • ... deployed applications use data sources and not vice versa, so making a data source creation fail because it's used by an application doesn't make sense

Is this a bug or am I missing something?

Note: I can re-create the data source after deleting the incomplete deployment, so this is not a support request to create the data source, but I'm seeking to confirm or deconstruct this unlogical behaviour.


[1] Data source creation in WildFly is the most unintuitive thing, I've seen in a while but it seems like I'm supposed to specify the client driver. I already started with a large number of necessary suggestions.

0 个答案:

没有答案