Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1161428

Summary: When executing a groovy file with Admin shell, it doesn't handle nonexistent file
Product: [JBoss] JBoss Data Virtualization 6 Reporter: Juraj Duráni <jdurani>
Component: Teiid, DocumentationAssignee: Van Halbert <vhalbert>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: atangrin, jdurani, nshendye, vhalbert
Target Milestone: ER2Keywords: Documentation, QA-Closed
Target Release: 6.2.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Admin shell throws an IncompatibleClassChangeError when wrong path to groovy script is provided along with load command. This happens because Admin shell doesn't handle nonexistent file.
Story Points: ---
Clone Of: Environment:
OS: fedora 20 arch: x86_64 java: oracle 1.7
Last Closed: 2016-02-10 08:51:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Juraj Duráni 2014-11-07 06:23:15 UTC
Admin shell throws an IncompatibleClassChangeError when wrong path to groovy script is provided along with load command.

Steps to reproduce:
run: ./adminshell.sh load xxx


Actual result:
===> [import static org.teiid.adminshell.AdminShell.*; import static org.teiid.adminshell.GroovySqlExtensions.*; import org.teiid.adminapi.*;]
FATAL: java.lang.IncompatibleClassChangeError: the number of constructors during runtime and compile time for java.lang.Exception do not match. Expected 4 but got 5
java.lang.IncompatibleClassChangeError: the number of constructors during runtime and compile time for java.lang.Exception do not match. Expected 4 but got 5
at groovy.lang.MetaClassImpl.selectConstructorAndTransformArguments(MetaClassImpl.java:1406)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.selectConstructorAndTransformArguments(ScriptBytecodeAdapter.java:237)
at org.codehaus.groovy.tools.shell.CommandException.<init>(Command.groovy:60)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
....
....

Comment 1 Van Halbert 2014-11-07 13:11:01 UTC
Can you provide the version of JDV you are using?

I just tested the following on ER3 with no issue:

./adminshell.sh load ./examples/PrintAllVDBAndDatasources.groovy

Comment 2 Van Halbert 2014-11-10 13:35:43 UTC
Think I found the problem:
  issue: Teiid / adminshell is built with 1.6 (or 1.7 with 1.6 compatibility) and then run with JDK 1.7
https://jira.codehaus.org/browse/GROOVY-6080


I confirmed that running running with 1.6 and getting the correct error:
===> [import static org.teiid.adminshell.AdminShell.*; import static org.teiid.adminshell.GroovySqlExtensions.*; import org.teiid.adminapi.*;]
FATAL: org.codehaus.groovy.tools.shell.CommandException: File not found: xx.xx
org.codehaus.groovy.tools.shell.CommandException: File not found: xx.xx


And talked with Julian and crew, that Teiid is built with JDK 1.7, with 1.6 compatibility with groovy 1.7.2.  

Also, this also happens with DV 6.0.

My suggestion would be to create a KI for this.  As this is only an issue when a nonexistent file is given, in which an error should be produced (unfortunately, not the correct one).   And this error isn't stopping the user from executing an existing script file.

Comment 3 Juraj Duráni 2014-11-10 13:51:15 UTC
OK. I agree.

Comment 4 Van Halbert 2014-11-12 22:38:25 UTC
After further discussion with the engineers, it appears there is a bigger issue with this.   The problem being that every time there is an exception occurring, regardless if its the nonexistent file issue or some other type of exception, the IncompatibleClassChangeError will be seen, because it can't deal correctly with any thrown exception.   

Just a reminder, there was an issue with Teiid using what BOM13 specified, and that was groovy-all 2.0.5, which is the reason back peddled to 1.7.2.  But now this issue. However, Teiid did upgrade to 2.3.6 upstream, so that maybe an option.  Further testing with that version in DV 6.1 will be done.  Just wanted to get down what has occurred to this point.

Comment 5 Juraj Duráni 2015-01-07 13:52:36 UTC
Any update?

Comment 7 Van Halbert 2015-04-29 15:29:53 UTC
In working on JBDVPL-198, ran into this issue.  Have done the following:

-  Talked with Julian about teiid adminshell having the groovy and jline jar's upgraded to:  

groovy:  2.3.6  (groovy-all-2.3.6.jar)
jline:  2.9  (jline-2.9-redhat-0.jar)

-  Confirmed with Horia that modeshape doesn't depend on these, that the only impact will be to Teiid.

-  Performed tests with the new versions to confirm they work with an updated Teiid adminshell jar from upstream that has the fix needed (for which will need to be back ported).

Therefore, targeting this for DV 6.2 so that JBDVPL-198 can continue.

Comment 8 JBoss JIRA Server 2015-04-30 12:39:49 UTC
Steven Hawkins <shawkins> updated the status of jira TEIID-3204 to Resolved

Comment 9 Juraj Duráni 2015-06-22 11:21:33 UTC
Verified.
6.2.0.ER2, java 1.6, 1.7, 1.8

Comment 10 JBoss JIRA Server 2015-06-23 15:19:28 UTC
Van Halbert <vhalbert> updated the status of jira JBDVPL-198 to Resolved

Comment 11 JBoss JIRA Server 2015-09-16 18:54:26 UTC
Anne-Louise Tangring <atangrin> updated the status of jira JBDVPL-198 to Closed

Comment 12 JBoss JIRA Server 2015-10-09 17:11:13 UTC
Steven Hawkins <shawkins> updated the status of jira TEIID-3204 to Closed