-
1. Re: StackOverflowError in camel-sql-binding quickstart
dward Jan 24, 2013 5:37 PM (in response to igarashitm)Yup. Here's the top of the test. It's not 100%, but it seems like:
1. cd quickstarts/ ; mvn clean install = ERROR
2. cd quickstarts/camel-sql-binding/ ; mvn clean install = NO ERROR
3. cd quickstarts; mvn clean install -DskipTests=true ; mvn test = NO ERROR
- -------------------------------------------------------------------------------
- Test set: org.switchyard.quickstarts.camel.sql.CamelSqlRetrieveTest
- -------------------------------------------------------------------------------
- Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.913 sec <<< FAILURE!
- shouldRetrieveGreetings(org.switchyard.quickstarts.camel.sql.CamelSqlRetrieveTest) Time elapsed: 0.148 sec <<< ERROR!
- java.lang.StackOverflowError
- at java.util.concurrent.LinkedBlockingQueue.size(LinkedBlockingQueue.java:260)
- at org.switchyard.test.MockHandler.waitFor(MockHandler.java:172)
- at org.switchyard.test.MockHandler.waitForOKMessage(MockHandler.java:149)
- at org.switchyard.quickstarts.camel.sql.CamelSqlRetrieveTest.getContents(CamelSqlRetrieveTest.java:68)
- at org.switchyard.quickstarts.camel.sql.CamelSqlRetrieveTest.getContents(CamelSqlRetrieveTest.java:76)
- at org.switchyard.quickstarts.camel.sql.CamelSqlRetrieveTest.getContents(CamelSqlRetrieveTest.java:76)
-
2. Re: StackOverflowError in camel-sql-binding quickstart
mageshbk Jan 25, 2013 3:12 AM (in response to igarashitm)Well I had the same issue too. Thought that it could be a *Windows only* issue so kept quite. Here is what I do to solve it:
If I change the test like this it goes through
private List<Greeting> getContents(MockHandler handler) { handler.waitForOKMessage(); List<Greeting> greetings = new ArrayList<Greeting>(); for (Exchange exchange : handler.getMessages()) { Greeting[] content = exchange.getMessage().getContent(Greeting[].class); if (content != null) { greetings.addAll(Arrays.asList(content)); } try { Thread.sleep(100); } catch (InterruptedException ie) { // Ignore } } return greetings.size() == 0 ? getContents(handler) : greetings; }
Magesh
-
3. Re: StackOverflowError in camel-sql-binding quickstart
dward Jan 25, 2013 10:57 AM (in response to mageshbk)Magesh, would you mind submitting a pull request to fix it?
-
4. Re: StackOverflowError in camel-sql-binding quickstart
dward Jan 25, 2013 11:12 AM (in response to dward)Actually, I see you're offline. Nevermind then, I'll submit one.
-
6. Re: StackOverflowError in camel-sql-binding quickstart
splatch Jan 25, 2013 11:40 AM (in response to mageshbk)Hey,
It's my fault. Hows about setting waitTimeout in MockHandler to 1000 ms?
Cheers,
Lukasz
-
7. Re: StackOverflowError in camel-sql-binding quickstart
dward Jan 25, 2013 11:52 AM (in response to splatch)- I'm having a hard time seeing how a race condition causes a stack overflow error...
- Would changing the waitTimeout in MockHandler be effectively the same thing as introducting a wait in the test per Magesh's fix?
- Can we envision any other fix that doesn't depend on an arbitrary wait, so it is dependable?
-
8. Re: StackOverflowError in camel-sql-binding quickstart
splatch Jan 25, 2013 12:03 PM (in response to dward)David,
The retrieve binding has 1 second initial delay and poll database every second. I think 2-4 second for wait timeout should be ok, however first poll may return empty result. That's why test code waits untill something is returned by SQL query.
-
9. Re: StackOverflowError in camel-sql-binding quickstart
yvrprasad Feb 22, 2014 1:04 AM (in response to mageshbk)Not able to test/run this quickstart: camel-sql-binding
Tried Magesh's fix - Did not work
Tried mvn -Dmaven.test.skip=true jboss-as:deploy - Did not work
[ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.5.Final:deploy (default-cli) on project switchyard-camel-sql-binding: Deployment failed and was rolled back. -> [Help 1]