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

enunciate 2.0.0.M2 failing to generate docs #116

Closed
Garagoth opened this issue Aug 26, 2015 · 9 comments
Closed

enunciate 2.0.0.M2 failing to generate docs #116

Garagoth opened this issue Aug 26, 2015 · 9 comments
Labels
Milestone

Comments

@Garagoth
Copy link

Cannot reopen #103 - opening as new.

With .M2 following happens:

[INFO] Reflections took 1975 ms to scan 209 urls, producing 13523 keys and 13523 values 
[INFO] [ENUNCIATE] Skipping generation of Java client sources as everything appears up-to-date...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.213 s
[INFO] Finished at: 2015-08-20T15:22:22+02:00
[INFO] Final Memory: 99M/340M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.webcohesion.enunciate:enunciate-maven-plugin:2.0.0-M.2:assemble (default-cli) on project API: Execution default-cli of goal com.webcohesion.enunciate:enunciate-maven-plugin:2.0.0-M.2:assemble failed: java.lang.IllegalStateException: OnError while emitting onNext value: com.webcohesion.enunciate.EnunciateContext.class -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Exception in thread "pool-1-thread-1" java.lang.NoClassDefFoundError: com/webcohesion/enunciate/modules/java_xml_client/EnunciateJavaXMLClientModule$2
        at com.webcohesion.enunciate.modules.java_xml_client.EnunciateJavaXMLClientModule.processTemplate(EnunciateJavaXMLClientModule.java:299)
        at com.webcohesion.enunciate.modules.java_xml_client.EnunciateJavaXMLClientModule.generateClientSources(EnunciateJavaXMLClientModule.java:169)
        at com.webcohesion.enunciate.modules.java_xml_client.EnunciateJavaXMLClientModule.call(EnunciateJavaXMLClientModule.java:117)
        at com.webcohesion.enunciate.io.InvokeEnunciateModule.onNext(InvokeEnunciateModule.java:31)
        at com.webcohesion.enunciate.io.InvokeEnunciateModule.onNext(InvokeEnunciateModule.java:10)
        at rx.internal.operators.OperatorDoOnEach$1.onNext(OperatorDoOnEach.java:79)
        at rx.internal.operators.OperatorSingle$ParentSubscriber.onCompleted(OperatorSingle.java:109)
        at rx.internal.operators.NotificationLite.accept(NotificationLite.java:140)
        at rx.internal.operators.TakeLastQueueProducer.emit(TakeLastQueueProducer.java:100)
        at rx.internal.operators.TakeLastQueueProducer.startEmitting(TakeLastQueueProducer.java:45)
        at rx.internal.operators.OperatorTakeLast$1.onCompleted(OperatorTakeLast.java:59)
        at rx.internal.operators.OperatorMerge$MergeSubscriber.drainAndComplete(OperatorMerge.java:521)
        at rx.internal.operators.OperatorMerge$MergeSubscriber.completeInner(OperatorMerge.java:486)
        at rx.internal.operators.OperatorMerge$InnerSubscriber.emit(OperatorMerge.java:658)
        at rx.internal.operators.OperatorMerge$InnerSubscriber.onCompleted(OperatorMerge.java:600)
        at rx.internal.operators.OperatorMerge$MergeSubscriber.drainAndComplete(OperatorMerge.java:521)
        at rx.internal.operators.OperatorMerge$MergeSubscriber.completeInner(OperatorMerge.java:486)
        at rx.internal.operators.OperatorMerge$InnerSubscriber.emit(OperatorMerge.java:673)
        at rx.internal.operators.OperatorMerge$InnerSubscriber.onCompleted(OperatorMerge.java:600)
        at rx.internal.operators.OperatorMerge$MergeSubscriber.drainAndComplete(OperatorMerge.java:521)
        at rx.internal.operators.OperatorMerge$MergeSubscriber.completeInner(OperatorMerge.java:486)
        at rx.internal.operators.OperatorMerge$InnerSubscriber.emit(OperatorMerge.java:673)
        at rx.internal.operators.OperatorMerge$InnerSubscriber.onCompleted(OperatorMerge.java:600)
        at rx.internal.util.ScalarSynchronousObservable$ScalarSynchronousAction.call(ScalarSynchronousObservable.java:117)
        at rx.schedulers.ExecutorScheduler$ExecutorAction.run(ExecutorScheduler.java:173)
        at rx.schedulers.ExecutorScheduler$ExecutorSchedulerWorker.run(ExecutorScheduler.java:99)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: com.webcohesion.enunciate.modules.java_xml_client.EnunciateJavaXMLClientModule$2
        at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
        ... 29 more

And with another project this happens:

[INFO] --- enunciate-maven-plugin:2.0.0-M.2:assemble (default-cli) @ NewCRM ---
Downloading: http://10.10.20.11:8081/nexus/content/groups/public/com/google/code/findbugs/annotations/2.0.1/annotations-2.0.1-sources.jar
Downloading: https://repo.maven.apache.org/maven2/com/google/code/findbugs/annotations/2.0.1/annotations-2.0.1-sources.jar
[INFO] Reflections took 1087 ms to scan 94 urls, producing 9139 keys and 9139 values 
[WARNING] [ENUNCIATE] Java source file com/fasterxml/jackson/databind/introspect/VisibilityChecker.java will not be included on the classpath because it is found in multiple locations: 
/home/garagoth/.m2/repository/net/sf/ehcache/ehcache/2.10.0/ehcache-2.10.0-sources.jar(net/sf/ehcache/statistics/extended/ExtendedStatisticsImpl.java):39: error: cannot access Query
import org.terracotta.context.query.Query;
                                   ^
  bad source file: /home/garagoth/.m2/repository/net/sf/ehcache/ehcache/2.10.0/ehcache-2.10.0-sources.jar(org/terracotta/context/query/Query.java)
    file does not contain class org.terracotta.context.query.Query
    Please remove or make sure it appears in the correct subdirectory of the sourcepath.
/home/garagoth/.m2/repository/net/sf/ehcache/ehcache/2.10.0/ehcache-2.10.0-sources.jar(net/sf/ehcache/util/concurrent/LongAdder.java):40: error: duplicate class: net.sf.ehcache.util.concurrent.LongAdder
public class LongAdder extends Striped64 implements Serializable {
       ^
/home/garagoth/.m2/repository/net/sf/ehcache/ehcache/2.10.0/ehcache-2.10.0-sources.jar(org/terracotta/statistics/derived/EventParameterSimpleMovingAverage.java):27: error: cannot access LongAdder
import org.terracotta.statistics.jsr166e.LongAdder;
                                        ^
  bad source file: /home/garagoth/.m2/repository/net/sf/ehcache/ehcache/2.10.0/ehcache-2.10.0-sources.jar(org/terracotta/statistics/jsr166e/LongAdder.java)
    file does not contain class org.terracotta.statistics.jsr166e.LongAdder
    Please remove or make sure it appears in the correct subdirectory of the sourcepath.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.681 s
[INFO] Finished at: 2015-08-20T15:25:24+02:00
[INFO] Final Memory: 28M/241M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.webcohesion.enunciate:enunciate-maven-plugin:2.0.0-M.2:assemble (default-cli) on project NewCRM: Execution default-cli of goal com.webcohesion.enunciate:enunciate-maven-plugin:2.0.0-M.2:assemble failed: Enunciate compile failed. -> [Help 1]
@stoicflame stoicflame added the bug label Aug 26, 2015
@stoicflame stoicflame added this to the v2.0.0.M3 milestone Aug 26, 2015
@stoicflame
Copy link
Owner

I can't figure out how to reproduce this.

Will you please include the output of mvn -X?

Will you also please include the output of mvn dependency:tree?

Ultimately, I'm trying to figure out a way to reproduce the problem by creating some kind of a sample project that manifests this error...

@Garagoth
Copy link
Author

Here you go, on pastebin because of long content (1 month expiration time).

mvn -X enunciate:assemble on project one:
http://pastebin.com/s22bdWez
mvn -X enunciate:assemble on project two:
http://pastebin.com/hrGAwjwd

@stoicflame
Copy link
Owner

The first problem is a duplicate of #110.

Still working on the second...

@stoicflame
Copy link
Owner

Been debugging this all day. It has something to do with the ehcache sources jar. I haven't figured out what yet...

@stoicflame
Copy link
Owner

The sources jar of ehcache has a bunch of sources in it from projects outside of ehcache. The ehcache guys don't know how to build a sources jar, and it's breaking the Javac tool. The Javac tool has a bug, too, because the compile is completely failing without any kinds of error indications. It's like it core dumps or something...

@stoicflame
Copy link
Owner

Okay, the root of this issue has been tracked to a bug in the Javac tool. Unfortunately, I have no way to know what it is about the ehcache-sources.jar that actually breaks the Javac tool, so there's no programmatic way to detect the scenario.

When the ehcache-sources.jar is not on the classpath, the problem does not occur. In an effort to avoid getting that jar on the classpath, I have implemented a less-aggressive source jar lookup scheme in the Maven plugin at 4514851. This might be enough for most people to avoid the issue. If it is not enough, I have provided a means to explicitly exclude lookup of specific source jars.

I have opened #117 to track the other issue to people can have a place to go to report the problem if it occurs for their project. As such, I will close this issue.

@stoicflame
Copy link
Owner

@Garagoth
Copy link
Author

For project 1 there are some other issues, trying to get something meaningful to report.
For project 2 now I get the following:

$ mvn clean enunciate:docs
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building New CRM 1.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ NewCRM ---
[INFO] Deleting /home/garagoth/PRES/newcrm/target
[INFO] 
[INFO] --- enunciate-maven-plugin:2.0.0-M.3:docs (default-cli) @ NewCRM ---
[INFO] Reflections took 1115 ms to scan 49 urls, producing 100 keys and 100 values 
[INFO] [ENUNCIATE] No JAXB XML data types: C XML client will not be generated.
[INFO] [ENUNCIATE] No JAXB XML data types: C# XML client will not be generated.
[INFO] [ENUNCIATE] No Jackson JSON data types: Java JSON client will not be generated.
[INFO] [ENUNCIATE] No JAXB XML data types: Java XML client will not be generated.
[INFO] [ENUNCIATE] No JAXB XML data types: Objective-C XML client will not be generated.
[INFO] [ENUNCIATE] No Jackson JSON data types: PHP JSON client will not be generated.
[INFO] [ENUNCIATE] No JAXB XML data types: PHP XML client will not be generated.
[INFO] [ENUNCIATE] No Jackson JSON data types: Ruby JSON client will not be generated.
[INFO] [ENUNCIATE] No resource APIs registered: Swagger UI will not be generated.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.200 s
[INFO] Finished at: 2015-08-29T22:42:38+02:00
[INFO] Final Memory: 34M/268M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.webcohesion.enunciate:enunciate-maven-plugin:2.0.0-M.3:docs (default-cli) on project NewCRM: Execution default-cli of goal com.webcohesion.enunciate:enunciate-maven-plugin:2.0.0-M.3:docs failed: com.webcohesion.enunciate.EnunciateException: There are no data types, services, or resources to document. OnError while emitting onNext value: com.webcohesion.enunciate.EnunciateContext.class -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

Might be that this is a Spring project and enunciate does not recognize annotations there?

@stoicflame
Copy link
Owner

Enunciate doesn't not have support for a Spring annotations yet, no. That work is being tracked at #60, but it won't make it into the 2.0 release.

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

No branches or pull requests

2 participants