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

Script1.groovy: Static type checking extension 'typecheckhttpconfig.groovy' was not found on the classpath. #144

Closed
tommyli opened this Issue Jun 29, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@tommyli

tommyli commented Jun 29, 2017

Getting below exception when using this library as part of an application but works fine in a Groovy script. The application is typical Groovy and Spring stack, packaged into WAR and deployed to Tomcat. The war/WEB-INF/lib does contain http-builder-ng-core-0.16.1.jar.

The following statement is triggering the problem:

      http = configure {
        request.uri = url
        request.auth.basic username, password
      }

I initially had this statement in the constructor of an @component bean but moving this to within the method whether I need HttpBuilder is still causing the same problem.

Any ideas?

Caused by: java.lang.ExceptionInInitializerError: null
	at groovyx.net.http.HttpObjectConfigImpl.<init>(HttpObjectConfigImpl.java:34)
	at groovyx.net.http.HttpBuilder.configure(HttpBuilder.java:163)
	at groovyx.net.http.HttpBuilder.configure(HttpBuilder.java:139)
	at groovyx.net.http.HttpBuilder$configure.callStatic(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:56)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:194)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:206)
...

Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script1.groovy: Static type checking extension 'typecheckhttpconfig.groovy' was not found on the classpath.
@cjstehno

This comment has been minimized.

Collaborator

cjstehno commented Jun 29, 2017

Can you upgrade your Tomcat version? This seems to be an issue on older versions. If not, please let me know what version you are using and provide a full stand-alone example.

This issue has been raised a few times now... if nothing else, I guess we need to document the work-around (upgrading, which has worked with the other instances).

@tommyli

This comment has been minimized.

tommyli commented Jun 30, 2017

You're correct, upgrading to Tomcat 8.0.44 from 7.0.34 fixed the issue.

The other workaround I tried that also worked was to extract the files typecheckhttpconfig.groovy and 59f7b2e5d5a78b25c6b21eb3b6b4f9ff77d11671.groovy and placed them onto my application's war root classpath. Upgrading is obviously the better solution.

Thanks for your help.

@tommyli tommyli closed this Jun 30, 2017

@cjstehno

This comment has been minimized.

Collaborator

cjstehno commented Jun 30, 2017

I am going to keep this open as a reminder to note this issue in the user guide.

@cjstehno cjstehno reopened this Jun 30, 2017

@cjstehno

This comment has been minimized.

Collaborator

cjstehno commented Jul 3, 2017

Added notes about this to a new troubleshooting section of the user guide.

@cjstehno cjstehno closed this Jul 3, 2017

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