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

jbossHome is missing slashes using windows #19

Closed
CSchulz opened this issue Jun 30, 2015 · 5 comments
Closed

jbossHome is missing slashes using windows #19

CSchulz opened this issue Jun 30, 2015 · 5 comments
Labels
Milestone

Comments

@CSchulz
Copy link

CSchulz commented Jun 30, 2015

Hello,

I have tried to set up my first project and got following exception. The folder exists if you add the directory seperator. But it seems to get lost under windows.

My arquillian.xml just contains the target.

Caused by: org.jboss.arquillian.container.spi.ConfigurationException: jbossHome 'C:businesstargetserverwildfly-dist_8.2.0.Finalwildfly-8.2.0.Final' must exist
        at org.jboss.arquillian.container.spi.client.deployment.Validate.configurationDirectoryExists(Validate.java:139)
        at org.jboss.as.arquillian.container.DistributionContainerConfiguration.validate(DistributionContainerConfiguration.java:99)
        at org.jboss.as.arquillian.container.managed.ManagedContainerConfiguration.validate(ManagedContainerConfiguration.java:73)
        at org.jboss.arquillian.container.impl.ContainerImpl.createDeployableConfiguration(ContainerImpl.java:115)
        at org.jboss.arquillian.container.impl.ContainerImpl.setup(ContainerImpl.java:181)
        at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$7.perform(ContainerLifecycleController.java:149)
        at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$7.perform(ContainerLifecycleController.java:145)
        at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.forContainer(ContainerLifecycleController.java:255)
@aslakknutsen
Copy link
Member

Hmm, not sure why this would happen.

The value should be resolved from here:
https://github.com/arquillian/arquillian-container-chameleon/blob/master/src/main/java/org/arquillian/container/chameleon/controller/DistributionController.java#L67

And set on this object and validated here:
https://github.com/wildfly/wildfly-arquillian/blob/master/common/src/main/java/org/jboss/as/arquillian/container/DistributionContainerConfiguration.java#L100

I currently don't have access to a Windows machine, but if you would be willing to debug this I'm happy to help/guide/fix it. 👍

@aslakknutsen aslakknutsen added this to the 1.0.0.Alpha3 milestone Jul 2, 2015
@CSchulz
Copy link
Author

CSchulz commented Jul 3, 2015

I have summarized the failsafe plugin execution http://pastebin.com/4KAuDwsX

If you have more details how I can deliver more debug information, tell me please.

@sfcoy
Copy link

sfcoy commented Jul 10, 2015

@CSchulz are you setting jbossHome in Java like this:

   String jbossHome = "C:\business\target\server\wildfly-dist_8.2.0.Final\wildfly-8.2.0.Final";
   ...
   // configure arquillian with jbossHome
   ...

?

All those single backslashes will disappear because they behave as escape characters. You need to double them up:

  String jbossHome = "C:\\business\\target\\server\\wildfly-dist_8.2.0.Final\\wildfly-8.2.0.Final";

@aslakknutsen
Copy link
Member

@sfcoy To my understanding he only defines the chameleonTarget configuration to 'something' managed, so chameleon should extract the dist zip into some folder and set the jbossHome automatically. The extraction is done here https://github.com/arquillian/arquillian-container-chameleon/blob/master/src/main/java/org/arquillian/container/chameleon/controller/DistributionController.java#L67 and the setting of the variable is here https://github.com/arquillian/arquillian-container-chameleon/blob/master/src/main/java/org/arquillian/container/chameleon/controller/DistributionController.java#L87

All that is File/String stuff in Java so with out debugging the running code i'm not sure where the slashes are removed. Unless new File(dist.getAbsolutePath()).exists is an issue..

@CSchulz
Copy link
Author

CSchulz commented Jul 13, 2015

@aslakknutsen is correct.

DistributionController.updateTargetConfiguration:
values: "dist" -> "C:\...\target\server\wildfly-dist_8.2.0.Final\wildfly-8.2.0.Final"

ContainerDefImpl.overrideProperty gets the value without backslashes. So the backslashes are "forgotten" when calling targetAdapter.resolveConfiguration(values).entrySet() in DistributionController.updateTargetConfiguration.

The cause can be found in ContainerAdapter.resolve(String parameter, String value, String target). The replaceAll is the reason.

I think it would be good to store the path escaped directly in the updateTargetConfiguration method.

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

No branches or pull requests

3 participants