Vaadin SASS是否在Grails 2.4中工作?

时间:2014-08-13 14:50:30

标签: grails sass vaadin

我正在尝试使用Grails 2.4 上的grails-vaadin插件自定义主题,但每次显示我的页面时都会出现以下错误:

    août 13, 2014 4:38:50 PM com.vaadin.sass.internal.util.DeepCopy log
GRAVE: null
java.lang.ClassNotFoundException: com.vaadin.sass.internal.tree.BlockNode
    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)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:340)
    at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:626)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1613)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1518)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1774)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
    at java.util.ArrayList.readObject(ArrayList.java:776)
    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 sun.reflect.GeneratedMethodAccessor116.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at java.io.ObjectStreamClass.__sljlrmi(ObjectStreamClass.java)
    at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1896)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
    at com.vaadin.sass.internal.util.DeepCopy.copy(DeepCopy.java:60)
    at com.vaadin.sass.internal.tree.Node.copy(Node.java:157)
    at com.vaadin.sass.internal.tree.MixinDefNode.copy(MixinDefNode.java:74)
    at com.vaadin.sass.internal.visitor.MixinNodeHandler.replaceMixinNode(MixinNodeHandler.java:45)
    at com.vaadin.sass.internal.visitor.MixinNodeHandler.replaceMixins(MixinNodeHandler.java:40)
    at com.vaadin.sass.internal.visitor.MixinNodeHandler.traverse(MixinNodeHandler.java:30)
    at com.vaadin.sass.internal.tree.MixinNode.doTraverse(MixinNode.java:61)
    at com.vaadin.sass.internal.tree.NodeWithVariableArguments.traverse(NodeWithVariableArguments.java:95)
    at com.vaadin.sass.internal.tree.Node.traverseChildren(Node.java:169)
    at com.vaadin.sass.internal.ScssStylesheet.traverse(ScssStylesheet.java:307)
    at com.vaadin.sass.internal.ScssStylesheet.compile(ScssStylesheet.java:249)
    at com.vaadin.server.VaadinServlet.serveOnTheFlyCompiledScss(VaadinServlet.java:886)
    at com.vaadin.server.VaadinServlet.serveStaticResourcesInVAADIN(VaadinServlet.java:642)
    at com.vaadin.server.VaadinServlet.serveStaticResources(VaadinServlet.java:612)
    at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:230)
    at com.vaadin.grails.GrailsVaadinServlet.service(GrailsVaadinServlet.groovy)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at com.vaadin.grails.GrailsVaadinServlet.service(GrailsVaadinServlet.groovy)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.processFilterChain(UrlMappingsFilter.java:440)
    at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.doFilterInternal(UrlMappingsFilter.java:241)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:69)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.codehaus.groovy.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)
août 13, 2014 4:38:50 PM com.vaadin.sass.internal.tree.NodeWithVariableArguments traverse
GRAVE: null
java.lang.NullPointerException
    at com.vaadin.sass.internal.tree.Node.copy(Node.java:158)
    at com.vaadin.sass.internal.tree.MixinDefNode.copy(MixinDefNode.java:74)
    at com.vaadin.sass.internal.visitor.MixinNodeHandler.replaceMixinNode(MixinNodeHandler.java:45)
    at com.vaadin.sass.internal.visitor.MixinNodeHandler.replaceMixins(MixinNodeHandler.java:40)
    at com.vaadin.sass.internal.visitor.MixinNodeHandler.traverse(MixinNodeHandler.java:30)
    at com.vaadin.sass.internal.tree.MixinNode.doTraverse(MixinNode.java:61)
    at com.vaadin.sass.internal.tree.NodeWithVariableArguments.traverse(NodeWithVariableArguments.java:95)
    at com.vaadin.sass.internal.tree.Node.traverseChildren(Node.java:169)

我的用户界面已注释:

@Theme("mytheme")
class MyUI extends UI {
   ...
}

我关注this guide

所以我在这条路径中创建了一个styles.scss文件:

web-app/WEB-INF/themes/mytheme/styles.scss

是否有人在Grails 2.4上使用Vaadin scss汇编成功?

注意:我的插件配置是:

plugins {
    // plugins for the build system only
    build ":tomcat:7.0.55"

    // plugins for the compile step
    compile ":scaffolding:2.1.2"
    compile ':cache:1.1.7'
    compile ":asset-pipeline:1.9.6"
    compile ":vaadin:7.2.5"

    // plugins needed at runtime but not for compilation
    runtime ":hibernate4:4.3.5.5" // or ":hibernate:3.6.10.17"
    runtime ":database-migration:1.4.0"
    runtime ":jquery:1.11.1"
}

2 个答案:

答案 0 :(得分:1)

您应该尝试升级到Vaadin 7.3.0.beta1并查看它是否可以解决问题。

使用序列化/反序列化的有问题的DeepCopy部分已在最新的vaadin-sass-compiler版本(7.3.0依赖于此版本)中进行了重构。

或者,您可以强制使用较新的vaadin-sass编译器版本与Vaadin 7.2.6一起使用。

答案 1 :(得分:0)

这是插件本身或Vaadin内部的问题。感谢@ artur-signell的评论,现在的实际解决方法是在BuildConfig.groovy中添加更新版本的SASS编译器:

dependencies {
    // ...
    compile 'com.vaadin:vaadin-sass-compiler:0.9.9'
}

编辑 Grails 2.4.3和Vaadin插件7.3.0.1工作直接分叉我