创建自己的脚手架插件:仅当在Forge控制台中运行时,metawidget资源加载异常 [英] Creating own scaffold plugin: metawidget resource loading exception only when run within forge console

查看:90
本文介绍了创建自己的脚手架插件:仅当在Forge控制台中运行时,metawidget资源加载异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于某些原因,我尝试分别重建一个scaffold Faces插件,但是发现了一个非常烦人的错误,我无法解决.

I try to rebuild a scaffold faces plugin separately for some reasons, but found a really annoying bug, that I cannot solve.

java.lang.NoSuchMethodException: class org.metawidget.inspector.impl.BaseObjectInspectorConfig.setPropertyStyle(ForgePropertyStyle). Did you mean setPropertyStyle(PropertyStyle)?
    at org.metawidget.config.impl.BaseConfigReader$ConfigHandler.classGetMethod(BaseConfigReader.java:1633)

尝试了一些技巧之后,请查看metawidget配置代码,但未找到解决问题的方法.

After trying some tricks, review the metawidget config codes, not found how to solve the problem.

scaffold setup --scaffoldType customfaces

工作正常,但

scaffold from-entity com.domain.entity.* --scaffoldType customfaces 

失败.

有人有同样的问题吗?我可以把东西弄乱吗?

Is anybody has a same issue? May I mess-up something?

更新#1 :

仅在Forge控制台中运行时,资源加载失败. JUnit测试工作正常.我假设metawidget插件资源加载器尝试不从新插件而是从原始scaffold-api的上下文中加载metawidget-*.xml.

The resource loading fails only, when run within forge console. JUnit test works fine. I assume, that metawidget plugin resource loader try to load metawidget-*.xml not from the new plugin but from the original scaffold-api's context.

更新#2 :

问题在元部件和伪造关系中深处存在.我发现如果直接使用SimpleResourceResolver.openResource(),则结果有效.但是,如果我添加StaticHtmlWidget.setConfig(),则在第一个write()调用中结果为Unable to locate com/domain/customfaces/metawidget-entity.xml on CLASSPATH.我不知道如何解决此问题.

The problem is somewehere deep in metawidget and forge relation. I found that if I use directly the SimpleResourceResolver.openResource(), the result is valid. But If I add the StaticHtmlWidget.setConfig(), the result is Unable to locate com/domain/customfaces/metawidget-entity.xml on CLASSPATH at the firs write() call. I have no idea, how to resolve this behavior.

推荐答案

可能您多次包含Metawidget JAR? Forge使用JBoss模块,因此您必须小心如何构造类路径.

Possibly you're including the Metawidget JARs more than once? Forge uses JBoss Modules, so you must be careful how your classpath gets constructed.

Metawidget错误基本上是说'ForgePropertyStyle'不是'PropertyStyle'类型的.但是(除非您在自定义样式中更改了该代码),ForgePropertyStyle确实确实扩展了PropertyStyle.因此,您必须以某种方式在类路径上具有两个PropertyStyles?

The Metawidget error is basically saying that 'ForgePropertyStyle' is not of type 'PropertyStyle'. But (unless you've changed that code in your customfaces) ForgePropertyStyle does indeed extend PropertyStyle. So you must have two PropertyStyles on your classpath somehow?

这篇关于创建自己的脚手架插件:仅当在Forge控制台中运行时,metawidget资源加载异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆