apache / apache/grails-intellij-plugin

Debugging always throws java.lang.ClassNotFoundException: javax.mail.internet.InternetAddress

Open
#198 0 comments 0 reactions 0 assignees View on GitHub
bug imported-from-youtrack
Dominant language
Java
Stars
17
Forks
4
Avg merge
5d 15h
Merged PRs (30d)
4

Description

While trying to debug an integration test done with Spock, it always throws an Exception which doesn't seem related to the project. On the non-EAP version, the same test can be debugged without any problems.

Using:
- Grails 2.4.5
- JDK 1.8.0 u25

At line 278 in the Config.groovy file there is a SMTPAppender configured (I have hidden the original to, from, subject and SMTPHost with dashes):
line 275: appender new SMTPAppender(
line 276: name: 'mail', to: '—', from: '—', subject: '—',
line 277: SMTPHost: '—',
line 278: layout: pattern(conversionPattern: '[%d{yyyy-MM-dd HH:mm:ss,SSS} / %X{ipAddress} / %X{sessionId} / %X{user}(%X{userId},%X{userType}) / %X{appVersion}] %X{controllerName}.%X{actionName}%n params: %X{params}%n%m%n%n'),
line 279: threshold: Level.ERROR
line 280: )

**Console output**:
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java -Dgrails.home=/Users/<hidden-personal-data>/.gvm/grails/2.4.5 -Dbase.dir=/Users/<hidden-personal-data>/Projects/api-redesign -Dtools.jar=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/lib/tools.jar -Dgroovy.starter.conf=/Users/<hidden-personal-data>/.gvm/grails/2.4.5/conf/groovy-starter.conf -Dgrails.full.stacktrace=true -Xmx768M -Xms768M -XX:MaxPermSize=256m -XX:PermSize=256m -Dgrails.build.listeners=org.jetbrains.groovy.grails.rt.GrailsIdeaTestListener -Dfile.encoding=UTF-8 -classpath /Users/<hidden-personal-data>/.gvm/grails/2.4.5/lib/org.codehaus.groovy/groovy-all/jars/groovy-all-2.3.11.jar:/Users/<hidden-personal-data>/.gvm/grails/2.4.5/dist/grails-bootstrap-2.4.5.jar org.codehaus.groovy.grails.cli.support.GrailsStarter –classpath "/Applications/IntelliJ IDEA 14 EAP.app/Contents/plugins/Grails/lib/grails-rt.jar" –main org.codehaus.groovy.grails.cli.GrailsScriptRunner –conf /Users/<hidden-personal-data>/.gvm/grails/2.4.5/conf/groovy-starter.conf "test-app unit: nl.quince.platinum.api.controller.UserControllerSpec -echoOut -plain-output –stacktrace -Dgrails.project.fork.test.debugArgs=-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=49409 -Dgrails.project.fork.run.debugArgs=-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=49409"
Testing started at 08:37 ...
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=256m; support was removed in 8.0
|Loading Grails 2.4.5
|Configuring classpath
.
|Environment set to test
.....................................................objc[12494]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
Listening for transport dt_socket at address: 49409
Connected to the target VM, address: '<hidden-personal-data>:49409', transport: 'socket'
| Error Error running forked test-app: javax/mail/internet/InternetAddress (NOTE: Stack trace has been filtered. Use –verbose to see entire trace.)

java.lang.NoClassDefFoundError: javax/mail/internet/InternetAddress

```
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2693)
at java.lang.Class.getDeclaredMethods(Class.java:1967)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlClassGetDeclaredMethods(ReflectiveInterceptor.java:145)
at org.codehaus.groovy.reflection.CachedClass$3$1.run(CachedClass.java:85)
at java.security.AccessController.doPrivileged(Native Method)
at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:82)
at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:80)
at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
at org.codehaus.groovy.reflection.CachedClass.getMethods(CachedClass.java:251)
at groovy.lang.MetaClassImpl.populateMethods(MetaClassImpl.java:361)
at groovy.lang.MetaClassImpl.fillMethodIndex(MetaClassImpl.java:340)
at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3224)
at groovy.lang.ExpandoMetaClass.initialize(ExpandoMetaClass.java:484)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:222)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:253)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:255)
at org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:859)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallConstructorSite(CallSiteArray.java:84)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
at Config$_run_closure5_closure19.doCall(Config.groovy:278)
at Config$_run_closure5_closure19.doCall(Config.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1206)
at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1120)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1015)
at groovy.lang.Closure.call(Closure.java:423)
at Config$_run_closure5_closure19.call(Config.groovy)
at groovy.lang.Closure.call(Closure.java:417)
at Config$_run_closure5_closure19.call(Config.groovy)
at org.codehaus.groovy.grails.plugins.log4j.Log4jConfig.appenders(Log4jConfig.groovy:324)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1206)
at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1120)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1015)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1118)
at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1120)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1015)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at Config$_run_closure5.doCall(Config.groovy:249)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1206)
at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1120)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1015)
at groovy.lang.Closure.call(Closure.java:423)
at Config$_run_closure5.call(Config.groovy)
at groovy.lang.Closure.call(Closure.java:439)
at Config$_run_closure5.call(Config.groovy)
at org.codehaus.groovy.grails.plugins.log4j.Log4jConfig.configure(Log4jConfig.groovy:230)
at org.codehaus.groovy.grails.plugins.log4j.Log4jConfig.initialize(Log4jConfig.groovy:74)
at org.codehaus.groovy.grails.plugins.logging.LoggingInitializer.initialize(LoggingInitializer.java:31)
at org.codehaus.groovy.grails.plugins.logging.LoggingInitializer$initialize.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.grails.project.packaging.GrailsProjectPackager.startLogging(GrailsProjectPackager.groovy:319)
at org.codehaus.groovy.grails.project.packaging.GrailsProjectPackager.packageApplication(GrailsProjectPackager.groovy:297)
at org.codehaus.groovy.grails.project.packaging.GrailsProjectPackager$packageApplication.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
at org.codehaus.groovy.grails.cli.fork.testing.ForkedGrailsTestRunner.runInstance(ForkedGrailsTestRunner.groovy:127)
at org.codehaus.groovy.grails.cli.fork.ForkedGrailsProjectClassExecutor.run(ForkedGrailsProjectClassExecutor.groovy:74)
at org.codehaus.groovy.grails.cli.fork.testing.ForkedGrailsTestRunner.main(ForkedGrailsTestRunner.groovy:75)
Caused by: java.lang.ClassNotFoundException: javax.mail.internet.InternetAddress
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 88 more
```

| Error Error running forked test-app: javax/mail/internet/InternetAddress
Disconnected from the target VM, address: '<hidden-personal-data>:49409', transport: 'socket'
Error |
Forked Grails VM exited with error

Process finished with exit code 1

---

*Imported from [IDEA-139101](https://youtrack.jetbrains.com/issue/IDEA-139101) · Type: Bug · Votes: 0*
*Comments, attachments, dates and reporter are not part of the export — follow the link above for the full history.*

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with Config.groovy at line 278 and the forked test-app debug invocation shown in the console output. Trace how the SMTPAppender is loaded during Log4jConfig initialization and inspect the debug process classpath. Done means the Spock integration test can start debugging without the javax.mail.internet.InternetAddress error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.