3

I am running my local dev Wildfly 9.0.1 server and faced a problem that after I deploy my .war application via IntelliJ IDEA I cant open Deployments tab it says "Unable to load deployments".

And in logs there is a record:

16:20:15,868 ERROR [org.jboss.as.controller.management-operation] (XNIO-1 task-10) WFLYCTL0013: Operation ("read-attribute") failed - address: ([
    ("deployment" => "modules-journal"),
    ("subsystem" => "datasources"),
    ("data-source" => "java:jboss/datasources/mj2")
]) - failure description: "WFLYJCA0065: No DataSource exists at address [
    (\"deployment\" => \"modules-journal\"),
    (\"subsystem\" => \"datasources\"),
    (\"data-source\" => \"java:jboss/datasources/mj2\")
]"

Yes, my application contains datasource definition in WEB-INF folder:

<?xml version="1.0" encoding="UTF-8"?>
<datasources xmlns="http://www.jboss.org/ironjacamar/schema"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.jboss.org/ironjacamar/schema http://docs.jboss.org/ironjacamar/schema/datasources_1_0.xsd">
   <!-- The datasource is bound into JNDI at this location. We reference 
      this in META-INF/persistence.xml -->
   <datasource jndi-name="java:jboss/datasources/mj2"
      pool-name="hibernate4-quickstart" enabled="true"
      use-java-context="true">
      <connection-url>jdbc:h2:~/test:mj2</connection-url>
      <driver>h2</driver>
      <security>
         <user-name>test</user-name>
         <password>test</password>
      </security>
   </datasource>
</datasources>

And my deployed application works successfully with it.

Why Wildfly Deployments tab says that "No DataSource exists" and doesn't open but my application still works?

Also everything works well if I don't use IntelliJ IDEA but deploy my app with Wildfly web interface.

Possibly it is an IntelliJ IDEA issue but it looks very strange from Wildfly side.

Could anyone explain why Wildfly reports that it doesn't see datasource when it exists and why it prevents Wildfly from loading "Deployments tab"? I missing something in how Wildfly works or it is a bug in Wildfly?

1 Answers1

0

Do you see your datasource through admin interface? File-based datasource deployments are deprecated and are not available for management at runtime [1]. IDEA probably tries to check for datasource using jboss management and gets an error.

[1] http://www.mastertheboss.com/jboss-server/jboss-datasource/jboss-as-7-deployable-datasources

Tair
  • 3,779
  • 2
  • 20
  • 33
  • No, datasource is not shown in admin interface but when I try to add it I get an error `org.jboss.msc.service.DuplicateServiceException: Service jboss.data-source.java:jboss/datasources/mj2 is already registered`. IDEA doesn't get an error, but Wildfly does when I want to see all deployments. – Николай Митропольский Aug 29 '15 at 16:46
  • you can't bind 2 datasources to same jndi name. Remove the one in WEB-INF and configure datasource through admin console – Tair Aug 29 '15 at 16:49
  • I know, I do not want. I just want Wildfly Deployments administration tab to open ) – Николай Митропольский Aug 29 '15 at 16:51
  • ok :) then you should probably report it to IDEA jboss-as plugin issue tracker – Tair Aug 29 '15 at 16:55
  • Maybe. but it will be better to Wildfly to fail to deploy artifact (if IDEA do something wrong) then to fail to show deployments – Николай Митропольский Aug 29 '15 at 17:47
  • Looks like I answered your question. I think you should accept it or update your question, so that I can update my answer – Tair Aug 30 '15 at 14:01
  • Maybe I was not very precise in formulation but the question was why Wildfly reports that it doesn't see datasource when it exists and why it prevents it from loading "Deployments tab", but your answer doesn't explain it. – Николай Митропольский Aug 30 '15 at 15:21
  • @НиколайМитропольский Ok I see your point, but you should reflect that in your question. Google will show this Q/A, and people will think you didn't accept the answer because it is wrong. But the answer is right, you just asked the wrong question. We should keep in mind that this is not private discussion forum. This is community effort of people looking for and providing help. It is not about you and me. Peace! – Tair Aug 31 '15 at 10:00
  • @tail, I've corrected question a bit. I really don't know how to make it better... maybe it is easier for me to delete question if you think that it is misleading for someone. – Николай Митропольский Aug 31 '15 at 10:30