Bug 928979 - can add incompletely defined jdbc driver through cli, later it cannot be removed
Summary: can add incompletely defined jdbc driver through cli, later it cannot be removed
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: JCA
Version: 6.4.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: EAP 6.4.0
Assignee: Stefano Maestri
QA Contact: Martin Simka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-28 22:15 UTC by Aleksandar Kostadinov
Modified: 2019-08-19 12:48 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-19 12:48:18 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker AS7-6104 0 Major Resolved jboss-cli failed to remove PostgreSQL datasource module NullPointerException OperationContextImpl.doRemove() 2017-04-04 07:50:49 UTC

Description Aleksandar Kostadinov 2013-03-28 22:15:03 UTC
How to reproduce:
1. create this module:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="org.xerial">
	<resources>
		<resource-root path="sqlite-jdbc.jar" />
	</resources>
	<dependencies>
		<module name="javax.api" />
		<module name="javax.transaction.api"/>
	</dependencies>
</module>

2. add to that directory sqlite-jdbc.jar
3. through cli add the driver:
/subsystem=datasources/jdbc-driver=sqlite:add(driver-name="sqlite",driver-module-name="org.xerial")
{"outcome" => "success"}

4. There are no errors in CLI neither in server log. But driver is not actually installed because:
data-source add --name=SQLiteDS --connection-url="jdbc:sqlite:/tmp/sqlite.jboss1.db" --jndi-name=java:jboss/datasources/SQLiteDS --driver-name="sqlite"
JBAS010468: Driver named "sqlite" is not installed.


5. now I try to remove and redefine sqlite driver with:
[standalone@localhost:9999 /] /subsystem=datasources/jdbc-driver=sqlite:remove
 {
     "outcome" => "failed",
     "failure-description" => "JBAS014749: Operation handler failed: null",
     "rolled-back" => true
 }

There is also an exception in server log:
23:35:19,243 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 24) JBAS014612: Operation ("remove") failed - address: ([
    ("subsystem" => "datasources"),
    ("jdbc-driver" => "sqlite")
]): java.lang.NullPointerException
    at org.jboss.as.controller.OperationContextImpl.doRemove(OperationContextImpl.java:305) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
    at org.jboss.as.controller.OperationContextImpl.removeService(OperationContextImpl.java:300) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
    at org.jboss.as.connector.subsystems.datasources.JdbcDriverRemove.performRuntime(JdbcDriverRemove.java:66)
    at org.jboss.as.controller.AbstractRemoveStepHandler$1.execute(AbstractRemoveStepHandler.java:50) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
    at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:397) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
    at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:284) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
    at org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:211) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
    at org.jboss.as.controller.ModelControllerImpl$DefaultPrepareStepHandler.execute(ModelControllerImpl.java:473) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
    at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:397) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
    at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:284) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
    at org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:211) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
    at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:126) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
    at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:111) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
    at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler.doExecute(ModelControllerClientOperationHandler.java:139) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
    at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler$1.execute(ModelControllerClientOperationHandler.java:108) [jboss-as-controller-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
    at org.jboss.as.protocol.mgmt.AbstractMessageHandler$2$1.doExecute(AbstractMessageHandler.java:296) [jboss-as-protocol-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
    at org.jboss.as.protocol.mgmt.AbstractMessageHandler$AsyncTaskRunner.run(AbstractMessageHandler.java:518) [jboss-as-protocol-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_09-icedtea]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_09-icedtea]
    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09-icedtea]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.0.0.GA-redhat-2.jar:2.0.0.GA-redhat-2]


If driver is created with all necessary options in the first place though (i.e. driver-class-name=org.sqlite.JDBC needs to be set for this driver), then I see no such issue. Everything appears to be working fine.

The real bad thing is not that driver is created without a warning. The bad thing is that if something like a typo installs a jdbc-driver in a wrong way, then there is no other option to fix than stopping server and removing from xml (e.g. standalone.xml).

Comment 1 Aleksandar Kostadinov 2013-03-29 15:24:49 UTC
Changing component to domain management as advised by Jaikiran.

The issue is not present in AS8 latest build. This means that driver can be registered with insufficient parameters, data-source fails to be created but at least the *remove* command can remove it so one can define it again.

Comment 2 Jaikiran Pai 2013-03-29 16:01:26 UTC
Actually there might be 2 parts to this. The reason why I asked for this to be classified under the domain management component was due to the NPE in that stacktrace. The rest of the issue is specific to datasource subsystem.

Comment 3 Brian Stansberry 2013-06-01 23:23:49 UTC
The Domain Management issue is out of date; fixed in 6.1.0. See AS7-6104. I'm moving this to JCA team to check if the basic issue still exists.

Comment 5 Martin Simka 2014-08-26 15:04:41 UTC
6.3.0.GA

1. 
/subsystem=datasources/jdbc-driver=sqlite:add(driver-name=sqlite,driver-module-name=sqlite)
{"outcome" => "success"}

2. 
data-source add --name=SQLiteDS --connection-url="jdbc:sqlite:/tmp/sqlite.jboss1.db" --jndi-name=java:jboss/datasources/SQLiteDS --driver-name="sqlite"
{"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.driver-demander.java:jboss/datasources/SQLiteDS is missing [jboss.jdbc-driver.sqlite]"]}

3.
/subsystem=datasources/jdbc-driver=sqlite:remove
{"outcome" => "success"}


1. NPE while removing driver - resolved
2. can add incompletely defined jdbc driver through cli


Note You need to log in before you can comment on or make changes to this bug.