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

Running Simple Servlet Test gives ClassCastException #48

Closed
arun-gupta opened this issue Dec 9, 2014 · 19 comments
Closed

Running Simple Servlet Test gives ClassCastException #48

arun-gupta opened this issue Dec 9, 2014 · 19 comments

Comments

@arun-gupta
Copy link

Cube workspace is locally checked out and built. Running a simple servlet test using them gives:

Running org.javaee7.servlet.metadata.complete.SimpleServletTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.712 sec <<< FAILURE! - in org.javaee7.servlet.metadata.complete.SimpleServletTest
org.javaee7.servlet.metadata.complete.SimpleServletTest Time elapsed: 1.707 sec <<< ERROR!
java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to java.lang.String
at org.arquillian.cube.impl.util.BindingUtil.binding(BindingUtil.java:44)
at org.arquillian.cube.impl.client.container.RemapContainerController.remapContainer(RemapContainerController.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
at org.jboss.arquillian.container.impl.ContainerImpl.setup(ContainerImpl.java:173)
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)
at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.setupContainer(ContainerLifecycleController.java:144)

@lordofthejars
Copy link
Member

Are you using alpha1 or the snapshot?

@arun-gupta
Copy link
Author

1.0.0.Final-SNAPSHOT

@lordofthejars
Copy link
Member

Ok can you paste here your ocnfiguration file? arquillian.xml

@arun-gupta
Copy link
Author

None, configuration all specified in pom.xml at https://github.com/javaee-samples/javaee7-samples/blob/docker/pom.xml

Start at line 728

@lordofthejars
Copy link
Member

The problem is here:

 portBindings:
     - exposedPort: 8080/tcp
       port: 8080
    - exposedPort: 9990/tcp
     port: 9990

In snapshot we have changed to make it more easy: see here an example https://github.com/arquillian/arquillian-cube/blob/master/ftest/src/test/resources/arquillian.xml

And concretely:

wildfly:
   buildImage:
   dockerfileLocation: src/test/resources/wildfly
   noCache: true
   remove: true
   exposedPorts: [8080/tcp, 9990/tcp]
   await:
         strategy: polling
   portBindings: [8081->8080/tcp, 9991->9990/tcp]

Note how port binding is using the -> notation. Also if both ports (the exposed one and the internal one is the same) you can do something like:

portBindings: [8089/tcp, 8081->8080/tcp]

In this case port 8089 will be exposed as 8089 and port 8080 will be exposed as 8081

@arun-gupta
Copy link
Author

And that was awesome, got my first test working now!

Waiting for 1.0.0.Final-SNAPSHOT to be pushed live now.

@lordofthejars
Copy link
Member

👍 A pleasure to help. I have not updated the documentation yet because O expect that users of alpha1 would like to see README of his version.

Of course nay suggestion you had about how to improve configuration are more than welcome.

@arun-gupta
Copy link
Author

Release Alpha2 and update the docs ?

I'd love to talk and showcase this. Requiring users to checkout and build the workspace is tricky.

@aslakknutsen
Copy link
Member

@lordofthejars We could add links in the Readme to the 1.0.0.Alpha1:README tag etc. Keep master always up to date, but redirect users to the 'old' doc. ?

@lordofthejars
Copy link
Member

@aslakknutsen Understood 👍
@arun-gupta about relese Aslak is working on two issues #40 and #43, we can release right now or we can wait.

@aslakknutsen
Copy link
Member

We could cut a A2 now, and just move those to A3.

@lordofthejars
Copy link
Member

Ok, then this night Iwill update the readme to latest changes and then tomorrow morning we can release. Does it fits to you?

@aslakknutsen
Copy link
Member

@arun-gupta Not sure why the SNAPSHOT doesn't show up in the public groups repo, checking with jboss.org. It's there, just not via the normal group; https://repository.jboss.org/nexus/service/local/repositories/snapshots/content/org/arquillian/cube/arquillian-cube-spi/1.0.0.Final-SNAPSHOT/arquillian-cube-spi-1.0.0.Final-20141209.084123-2.pom

@aslakknutsen
Copy link
Member

@lordofthejars 👍

@arun-gupta
Copy link
Author

@aslakknutsen sounds good, LMK once the coords are available.

@lordofthejars
Copy link
Member

BTW @arun-gupta have you used Arquilian Cube with Boot2Docker?

@arun-gupta
Copy link
Author

Yes, filed a new issue for that.

When is Alpha2 going live?

@lordofthejars
Copy link
Member

ok boot2docker is gonna be complicated because we need a MacOSx machine, and I am not sure that mine is powerful enough, but well I have some idea on how to do it :)

@lordofthejars
Copy link
Member

@aslakknutsen is the one that can release a new version I guess.

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

No branches or pull requests

3 participants