loic911 / Rest-api-doc

MIT License
21 stars 32 forks source link

errors when swapping plugin inclusion with a dependency directive #36

Open rosemead opened 9 years ago

rosemead commented 9 years ago

Is this supposed to work? I'm getting:

ERROR BeanBuilder - WARNING: Your cache provider is set to 'net.sf.ehcache.hibernate.EhCacheRegionFactory' in DataSource.groovy, however the class for this provider cannot be found.
Using Grails' default cache region factory: 'org.hibernate.cache.ehcache.EhCacheRegionFactory'
16-10-2014 12:12:17,677 ERROR SchemaExport - HHH000389: Unsuccessful: alter table book drop constraint FK_4sac2ubmnqva85r8bk8fxdvbf if exists
16-10-2014 12:12:17,677 ERROR SchemaExport - Table "BOOK" not found; SQL statement:
alter table book drop constraint FK_4sac2ubmnqva85r8bk8fxdvbf if exists [42102-176]
Start build JSON doc restapidoc.json...
Custom doc class loading=org.restapidoc.CustomResponseDoc
16-10-2014 12:12:20,904  INFO APIUtils - Retrieve Controller...
16-10-2014 12:12:20,910  INFO APIUtils - Retrieve Domain...
16-10-2014 12:12:20,915  INFO APIUtils - Retrieve non-Domain pojo...
16-10-2014 12:12:20,925  INFO RestApiObjectDoc -    Process domain author ...
16-10-2014 12:12:20,925  INFO RestApiObjectDoc - classToProcess=class org.restapidoc.sample.Author
16-10-2014 12:12:20,975  INFO RestApiObjectDoc -        Find 4 fields...
16-10-2014 12:12:20,978  INFO RestApiObjectDoc -        Find field firstname...
16-10-2014 12:12:20,982  INFO RestApiObjectDoc -        Find field lastname...
16-10-2014 12:12:20,982  INFO RestApiObjectDoc -        Find field fullname...
16-10-2014 12:12:20,982  INFO RestApiObjectDoc -        Find field books...
16-10-2014 12:12:20,988  INFO RestApiObjectDoc -    Process domain book ...
16-10-2014 12:12:20,988  INFO RestApiObjectDoc - classToProcess=class org.restapidoc.sample.Book
16-10-2014 12:12:20,993  INFO RestApiObjectDoc -        Find 5 fields...
16-10-2014 12:12:20,993  INFO RestApiObjectDoc -        Find field author...
16-10-2014 12:12:20,993  INFO RestApiObjectDoc -        Find field category...
16-10-2014 12:12:20,993  INFO RestApiObjectDoc -        Find field id...
16-10-2014 12:12:20,993  INFO RestApiObjectDoc -        Find field title...
16-10-2014 12:12:20,994  INFO RestApiObjectDoc -        Find field year...
field=private static java.lang.Object org.restapidoc.CustomResponseDoc.stats
16-10-2014 12:12:20,999  INFO RestApiObjectDoc -    Process domain stats ...
field=private static org.apache.commons.logging.Log org.restapidoc.CustomResponseDoc.log
field=private static org.codehaus.groovy.reflection.ClassInfo org.restapidoc.CustomResponseDoc.$staticClassInfo
field=public static transient boolean org.restapidoc.CustomResponseDoc.__$stMC
field=private transient groovy.lang.MetaClass org.restapidoc.CustomResponseDoc.metaClass
field=public static long org.restapidoc.CustomResponseDoc.__timeStamp
field=public static long org.restapidoc.CustomResponseDoc.__timeStamp__239_neverHappen1413421776605
field=private static java.lang.ref.SoftReference org.restapidoc.CustomResponseDoc.$callSiteArray
16-10-2014 12:12:21,001  INFO JSONDocUtilsLight - Build path map...
16-10-2014 12:12:21,056  INFO JSONDocUtilsLight -   Process controller class org.restapidoc.sample.AuthorController ...
16-10-2014 12:12:21,057  INFO JSONDocUtilsLight -       Process method public java.lang.Object org.restapidoc.sample.AuthorController.list() ...
controllerName=author
actionWithPathParam=/list
groovy.lang.MissingMethodException: No signature of method: org.restapidoc.utils.JSONDocUtilsLight.getControllerDomainName() is applicable for argument types: (java.lang.Class) values: [class org.restapidoc.sample.AuthorController]
Possible solutions: getControllerDomainName(java.util.Set, java.lang.Class)
Error |
groovy.lang.MissingMethodException: No signature of method: org.restapidoc.utils.JSONDocUtilsLight.getControllerDomainName() is applicable for argument types: (java.lang.Class) values: [class org.restapidoc.sample.AuthorController]
Possible solutions: getControllerDomainName(java.util.Set, java.lang.Class)
// rest of stacktrace snipped

The change I've made:

--- grails-app/conf/BuildConfig.groovy  (revision 9b25fcee1953c447466e2be4462488cb612ce4d1)
+++ grails-app/conf/BuildConfig.groovy  (revision )
@@ -7,7 +7,7 @@
 grails.project.source.level = 1.6

-grails.plugin.location.restapidoc = "../restapidoc"
+//grails.plugin.location.restapidoc = "../restapidoc"

 //grails.project.war.file = "target/${appName}-${appVersion}.war"
@@ -64,6 +64,7 @@
        // compile ":rest-api-doc:0.3.1"
         build ':tomcat:7.0.54'
         compile (':hibernate4:4.3.5.5')
+        compile ":rest-api-doc:0.4"

         compile ':cache:1.1.7'

restapidoc.json isn't created

Out-of-the-box (i.e. with the reference to the plugin source), works fine.

loic911 commented 9 years ago

Can you try with 0.4.1?

And in DataSource.groovy, try to change the line: cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' // Hibernate 3 TO cache.region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' // Hibernate 4

rosemead commented 9 years ago

Thanks. With those changes applied - works :+1: