[jboss-jira] [JBoss JIRA] (WFLY-5682) Can't define absolute path for object store location

Ondřej Chaloupka (JIRA) issues at jboss.org
Wed Nov 18 05:44:00 EST 2015


    [ https://issues.jboss.org/browse/WFLY-5682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13130150#comment-13130150 ] 

Ondřej Chaloupka edited comment on WFLY-5682 at 11/18/15 5:43 AM:
------------------------------------------------------------------

Hi Amos,

thanks for the update. I've tried your fix and I have few remarks with me here.

First of all I do not know exactly what was first intention about these parameters so I will put here only my ideas and observation. Maybe [~tomjenkinson] would know more then?

This is what the current description and documentation taken from it says
{code}
object-store-path
Denotes a relative or absolute filesystem path denoting where the transaction manager object store should store data. By default the value is treated as relative to the path denoted by the \"relative-to\" attribute.
{code}
{code}
object-store-relative-to
References a global path configuration in the domain model, defaulting to the JBoss Application Server data directory (jboss.server.data.dir). The value of the \"path\" attribute will treated as relative to this path. Use an empty string to disable the default behavior and force the value of the \"path\" attribute to be treated as an absolute path.
{code}

Now what I can see as a possible trouble
* If I would start with the doc - there is one issue here in description of {{object-store-relative-to}} where is not possible to set it to empty string. This is probably fine when your PR provides the way how the {{object-store-relative-to}} could be undefine (for WFLY10.CR4 is not possible either set empty string or undefine the attribute as mentioned above).
* It's not possible to set the attribute {{object-store-relative-to}} to any other value than some global property like {{jboss.server.data.dir}} or {{jboss.server.log.dir}}. If I try to set value of absolute path {{/tmp/store}} or relative {{store}} server starts with exceptions. Is expected that property {{object-store-relative-to}} could be set out of the {{$JBOSS_HOME}} dir? If so it's not possible now. If not then the description needs to be updated to reflect expected behavior of the attribute.
* If I use your fix and undefine {{object-store-relative-to}}  then attribute {{object-store-path}} could be set as absolute path (e.g. {{/tmp/store}}) and the tx object store is saved there.
** If {{object-store-relative-to}} is undefined and the attribute {{object-store-path}} specifies relative path (e.g. only {{tx-object-store}}) then relative to is taken as {{$JBOSS_HOME}} directory - is that ok?
** If I decide to change standalone.xml and I add element {{<object-store path="/tmp/store" />}} and start the server then absolute path is used and {{object-store-relative-to}} is specified as undefined. That's nice. But if I change my mind and remove the {{object-store}} element from transaction subsystem xml definition and start container again then {{object-store-relative-to}} is left undefined (and base path is taken as {{{$JBOSS_HOME}}}) which I think is wrong ...?

My commands are
{code}
./bin/jboss-cli.sh -c --command="/subsystem=transactions:read-attribute(name=object-store-path)"
./bin/jboss-cli.sh -c --command="/subsystem=transactions:read-attribute(name=object-store-relative-to)"
{code}


was (Author: ochaloup):
Hi Amos,

thanks for the update. I've tried your fix and I have few remarks with me here.

First of all I do not know exactly what was first intention about these parameters so I will put here only my ideas and observation. Maybe [~tomjenkinson] would know more then?

This is what the current description and documentation taken from it says
{code}
object-store-path
Denotes a relative or absolute filesystem path denoting where the transaction manager object store should store data. By default the value is treated as relative to the path denoted by the \"relative-to\" attribute.
{code}
{code}
object-store-relative-to
References a global path configuration in the domain model, defaulting to the JBoss Application Server data directory (jboss.server.data.dir). The value of the \"path\" attribute will treated as relative to this path. Use an empty string to disable the default behavior and force the value of the \"path\" attribute to be treated as an absolute path.
{code}

Now what I can see as a possible trouble
* If I would start with the doc - there is one issue here in description of {{{object-store-relative-to}}} where is not possible to set it to empty string. This is probably fine when your PR provides the way how the {{{object-store-relative-to}}} could be undefine (for WFLY10.CR4 is not possible either set empty string or undefine the attribute as mentioned above).
* It's not possible to set the attribute {{{object-store-relative-to}}} to any other value than some global property like {{{jboss.server.data.dir}}} or {{{jboss.server.log.dir}}}. If I try to set value of absolute path {{{/tmp/store}}} or relative {{{store}}} server starts with exceptions. Is expected that property {{{object-store-relative-to}}} could be set out of the {{{$JBOSS_HOME}}} dir? If so it's not possible now. If not then the description needs to be updated to reflect expected behavior of the attribute.
* If I use your fix and undefine {{{object-store-relative-to}}}  then attribute {{{object-store-path}}} could be set as absolute path (e.g. {{{/tmp/store}}}) and the tx object store is saved there.
** If {{{object-store-relative-to}}} is undefined and the attribute {{{object-store-path}}} specifies relative path (e.g. only {{{tx-object-store}}}) then relative to is taken as {{{$JBOSS_HOME}}} directory - is that ok?
** If I decide to change standalone.xml and I add element {{{<object-store path="/tmp/store" />}}} and start the server then absolute path is used and {{{object-store-relative-to}}} is specified as undefined. That's nice. But if I change my mind and remove the {{{object-store}}} element from transaction subsystem xml definition and start container again then {{{object-store-relative-to}}} is left undefined (and base path is taken as {{{$JBOSS_HOME}}}) which I think is wrong ...?

My commands are
{code}
./bin/jboss-cli.sh -c --command="/subsystem=transactions:read-attribute(name=object-store-path)"
./bin/jboss-cli.sh -c --command="/subsystem=transactions:read-attribute(name=object-store-relative-to)"
{code}

> Can't define absolute path for object store location
> ----------------------------------------------------
>
>                 Key: WFLY-5682
>                 URL: https://issues.jboss.org/browse/WFLY-5682
>             Project: WildFly
>          Issue Type: Bug
>          Components: Transactions
>    Affects Versions: 10.0.0.CR4
>            Reporter: Ondřej Chaloupka
>            Assignee: Amos Feng
>             Fix For: 10.0.0.Final
>
>
> As trying to set absolute path for location of transaction log store I've got to suspicion that's not possible.
> If I try to set `object-store-relative-to` to some absolute path or set `object-store-relative-to` to empty string and then `object-store-path` to some absolute path the server starts with exceptions [1][2].
> [1]
> {code}
> ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.txn.ArjunaObjectStoreEnvironment: org.jboss.msc.service.StartException in service jboss.txn.ArjunaObjectStoreEnvironment: 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.IllegalArgumentException: WFLYCTL0256: Could not find a path called '/home/ochaloup/tmp/'
>  at org.jboss.as.controller.services.path.PathManagerService.resolveRelativePathEntry(PathManagerService.java:87) at org.jboss.as.txn.service.ArjunaObjectStoreEnvironmentService.start(ArjunaObjectStoreEnvironmentService.java:76)
>  at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
>  ...
> ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("subsystem" => "transactions")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.txn.ArjunaObjectStoreEnvironment" => "org.jboss.msc.service.StartException in service jboss.txn.ArjunaObjectStoreEnvironment: Failed to start service
>     Caused by: java.lang.IllegalArgumentException: WFLYCTL0256: Could not find a path called '/home/ochaloup/tmp/'"}}
> INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status reportWFLYCTL0186:   Services which failed to start:      service jboss.txn.ArjunaObjectStoreEnvironment: org.jboss.msc.service.StartException in service jboss.txn.ArjunaObjectStoreEnvironment: Failed to start service
> {code}
> [2]
> {code}
> ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0085: Failed to parse configuration
>  at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:131)
>  at org.jboss.as.server.ServerService.boot(ServerService.java:356) at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:299)
>  at java.lang.Thread.run(Thread.java:745)
> Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[348,13]
> Message: "WFLYCTL0113: '' is an invalid value for parameter relative-to. Values must have a minimum length of 1 characters"
>  at org.jboss.as.controller.SimpleAttributeDefinition.parse(SimpleAttributeDefinition.java:161) at org.jboss.as.controller.SimpleAttributeDefinition.parseAndSetParameter(SimpleAttributeDefinition.java:186)
>  at org.jboss.as.txn.subsystem.TransactionSubsystem14Parser.parseObjectStoreEnvironmentElementAndEnrichOperation(TransactionSubsystem14Parser.java:205)
>  at org.jboss.as.txn.subsystem.TransactionSubsystem30Parser.readElement(TransactionSubsystem30Parser.java:67) at org.jboss.as.txn.subsystem.TransactionSubsystem14Parser.readElement(TransactionSubsystem14Parser.java:111)
>  at org.jboss.as.txn.subsystem.TransactionSubsystem14Parser.readElement(TransactionSubsystem14Parser.java:54) at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
>  at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.handleAny(XMLExtendedStreamReaderImpl.java:69) at org.jboss.as.server.parsing.StandaloneXml_4.parseServerProfile(StandaloneXml_4.java:547)
>  at org.jboss.as.server.parsing.StandaloneXml_4.readServerElement(StandaloneXml_4.java:244) at org.jboss.as.server.parsing.StandaloneXml_4.readElement(StandaloneXml_4.java:143)
>  at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:69) at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:47) at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
>  at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69) at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:123)
>  ... 3 more
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)



More information about the jboss-jira mailing list