2016-02-19 55 views
0

我已经加入从书掌握的XPages第二版,以我的应用程序之一的富文本自定义控件,但我一直在得到以下几点:的XPages“自制”不承认自定义控件

2016-02-19T15:20:30.546-05:00 SEVERE CLFAD0095E: Format error reading the class mxpd2.component.InputRichText 
2016-02-19T15:20:30.547-05:00 WARNING CLFAD0090W: The component-class (mxpd2.component.InputRichText) could not be resolved for the component with component-type com.ibm.xsp.InputRichText. 

的应用当我在项目上做了一个“干净的”时,以前可以编译,但现在我总是得到这个错误。

这里是我的mxpd2.xsp-config文件:

<faces-config> 

<faces-config-extension> 
    <namespace-uri>http://www.ibm.com/xsp/mxpd2</namespace-uri> 
    <default-prefix>mxpd2</default-prefix> 
</faces-config-extension> 

<component> 
    <description>A specialized Rich Text Editor control for Intact Financial Corp</description> 
    <display-name>In‌tact Rich Text</display-name> 
    <component-type>com.ibm.xsp.InputRichText</component-type> 
    <component-class>mxpd2.component.InputRichText</component-class> 
    <group-type-ref>com.ibm.xsp.group.core.prop.styleClass</group-type-ref> 
    <group-type-ref>com.ibm.xsp.group.core.prop.title</group-type-ref> 
    <group-type-ref>com.ibm.xsp.group.events.prop.onclick</group-type-ref> 
    <group-type-ref>com.ibm.xsp.group.events.onkey</group-type-ref> 
    <group-type-ref>com.ibm.xsp.group.focus</group-type-ref> 
    <group-type-ref>com.ibm.xsp.group.i18n</group-type-ref> 
    <group-type-ref>com.ibm.xsp.group.input.prop.disabled</group-type-ref> 
    <group-type-ref>com.ibm.xsp.group.input.prop.onchange</group-type-ref> 
    <group-type-ref>com.ibm.xsp.group.input.prop.readonly</group-type-ref> 
    <group-type-ref>com.ibm.xsp.group.outerStyleClass</group-type-ref> 
    <group-type-ref>com.ibm.xsp.group.filter</group-type-ref> 
    <group-type-ref>com.ibm.xsp.group.dojoUsage.deprecated</group-type-ref> 
    <group-type-ref>com.ibm.xsp.group.aria.role</group-type-ref> 
    <property> 
     <display-name>CSS Style</display-name> 
     <property-name>style</property-name> 
     <property-class>java.lang.String</property-class> 
     <property-extension> 
     <pass-through>true</pass-through> 
     <designer-extension> 
      <category>styling</category> 
      <editor> 
      com.ibm.workplace.designer.property.editors.StylesEditor 
      </editor> 
      <styles-excluded>background, font</styles-excluded> 
     </designer-extension> 
     </property-extension> 
    </property> 
    <component-extension> 
     <javadoc-description> 
     <p>Rich Text Control</p>providing rich text editing functionality 
     </javadoc-description> 
     <base-component-type>com.ibm.xsp.UIInputRichText</base-component-type> 
     <renderer-type>com.ibm.xsp.InputRichText</renderer-type> 
     <tag-name>inputRichText</tag-name> 
     <designer-extension> 
     <category>Intact FC</category> 
     </designer-extension> 
    </component-extension> 
</component> 

</faces-config> 

它的源代码从本书的示例文件几乎一模一样的副本(第11B)。 Java文件已经被复制到我的应用程序(同一个包),在faces-config.xml的SHA被修改为以下几点:

<?xml version="1.0" encoding="UTF-8"?> 
<faces-config> 
    <converter> 
    <converter-id>InputRichTextConverter</converter-id> 
    <converter-class>mxpd2.converter.InputRichTextConverter</converter-class> 
    </converter> 
    <managed-bean> 
    <managed-bean-name>rteBean</managed-bean-name> 
    <managed-bean-class>mxpd2.bean.InputRichTextBean</managed-bean-class> 
    <managed-bean-scope>view</managed-bean-scope> 
    <managed-property> 
     <property-name>debug</property-name> 
     <value>false</value> 
    </managed-property> 
    </managed-bean> 
    <managed-bean id="Appconfig"> 
    <managed-bean-name>AppConfig</managed-bean-name> 
    <managed-bean-class>com.intact.xpages.utils.AppConfig</managed-bean-class> 
    <managed-bean-scope>application</managed-bean-scope> 
    </managed-bean> 
    <managed-bean id="SessionConfig"> 
    <managed-bean-name>SessionConfig</managed-bean-name> 
    <managed-bean-class>com.intact.xpages.utils.SessionConfig</managed-bean-class> 
    <managed-bean-scope>session</managed-bean-scope> 
    </managed-bean> 
    <managed-bean> 
    <managed-bean-name>EmailBeanV2</managed-bean-name> 
    <managed-bean-class>com.intact.xpages.utils.EmailBeanV2</managed-bean-class> 
    <managed-bean-scope>request</managed-bean-scope> 
    <managed-property> 
     <property-name>debugMode</property-name> 
     <value>false</value> 
    </managed-property> 
    </managed-bean> 
    <!-- required for the lang switch 
    <lifecycle> 
    <phase-listener>ch.hasselba.xpages.jsf.core.LocalizationSetter</phase-listener> 
    </lifecycle> 
    --> 
    <!--AUTOGEN-START-BUILDER: Automatically generated by IBM Domino Designer. Do not modify.--> 
    <application> 
    <locale-config> 
     <default-locale>fr</default-locale> 
     <supported-locale>en</supported-locale> 
     <supported-locale>fr</supported-locale> 
    </locale-config> 
    </application> 
    <!--AUTOGEN-END-BUILDER: End of automatically generated section--> 
</faces-config> 

我复制everyhting两次,以确保,但仍然得到错误。

在原始文件中,我在源代码模式下没有任何错误,但是当在设计模式下查看时,我收到警告,标记mxpd2无法识别,控件是黄色而不是蓝色。

有人可以指出这个问题吗?


以下是我在跟踪日志中找到:

09:32:37.429 7 SEVERE com.ibm.xsp.registry.parse.ParseUtil 
getClassForName CLFAD0095E: Format error reading the class mxpd2.component.InputRichText 
java.lang.ClassFormatError: JVMCFRE113 EOF inattendu; classe=mxpd2/component/InputRichText, décalage=0 
    at java.lang.ClassLoader.defineClassImpl(Native Method) 
    at java.lang.ClassLoader.defineClass(Unknown Source) 
    at com.ibm.designer.runtime.server.util.DynamicClassLoaderVFS.doDefineClass(Unknown Source) 
    at com.ibm.designer.runtime.server.util.DynamicClassLoaderVFS.loadClass(Unknown Source) 
    at java.lang.ClassLoader.loadClass(Unknown Source) 
    at com.ibm.designer.runtime.Application.loadClass(Unknown Source) 
    at com.ibm.xsp.library.ApplicationFacesClassLoader.loadClass(Unknown Source) 
    at com.ibm.xsp.registry.parse.ParseUtil.getClassForName(Unknown Source) 
    at com.ibm.xsp.registry.parse.ParseUtil.loadClass(Unknown Source) 
    at com.ibm.xsp.registry.parse.definition.ComponentParser.getJavaClass(Unknown Source) 
    at com.ibm.xsp.registry.parse.definition.ComponentParser.createDefinition(Unknown Source) 
    at com.ibm.xsp.registry.parse.definition.AbstractDefinitionParser.parse(Unknown Source) 
    at com.ibm.xsp.registry.parse.ConfigParserImpl.createDefinition(Unknown Source) 
    at com.ibm.xsp.registry.parse.FacesConfigParserImpl.processChildElements(Unknown Source) 
    at com.ibm.xsp.registry.parse.FacesConfigParserImpl.parse(Unknown Source) 
    at com.ibm.xsp.registry.parse.ConfigParserImpl.createFacesLibraryFragment(Unknown Source) 
    at com.ibm.xsp.registry.parse.ConfigParserImpl.createFacesLibraryFragment(Unknown Source) 
    at com.ibm.xsp.registry.config.ConfigRegisterer.register(Unknown Source) 
    at com.ibm.xsp.registry.config.ConfigRegisterer.registerProjectConfig(Unknown Source) 
    at com.ibm.xsp.registry.config.ConfigRegisterer.registerProjectConfig(Unknown Source) 
    at com.ibm.xsp.library.ConfigFileMaintainerImpl.reloadAllConfigFiles(Unknown Source) 
    at com.ibm.designer.domino.ide.resources.project.FacesRegistryMaintainer.changedClassFile(Unknown Source) 
    at com.ibm.designer.domino.ide.resources.project.DesignerProjectSynchronizer.getAffectedDesignerProject(Unknown Source) 
    at com.ibm.designer.prj.resources.commons.CommonProjectSynchronizer.getAffectedDesignerProject(Unknown Source) 
    at com.ibm.designer.prj.resources.commons.CommonProjectSynchronizer.getAffectedDesignerProject(Unknown Source) 
    at com.ibm.designer.prj.resources.commons.CommonProjectSynchronizer.getAffectedDesignerProject(Unknown Source) 
    at com.ibm.designer.prj.resources.commons.CommonProjectSynchronizer.getAffectedDesignerProject(Unknown Source) 
    at com.ibm.designer.prj.resources.commons.CommonProjectSynchronizer.getAffectedDesignerProject(Unknown Source) 
    at com.ibm.designer.prj.resources.commons.CommonProjectSynchronizer.getAffectedDesignerProject(Unknown Source) 
    at com.ibm.designer.prj.resources.commons.CommonProjectSynchronizer.getAffectedDesignerProject(Unknown Source) 
    at com.ibm.designer.prj.resources.commons.CommonProjectSynchronizer.getAffectedDesignerProject(Unknown Source) 
    at com.ibm.designer.prj.resources.commons.CommonProjectSynchronizer.getAffectedDesignerProject(Unknown Source) 
    at com.ibm.designer.prj.resources.commons.CommonProjectSynchronizer.notifyChangedOrAddedDesignerProject(Unknown Source) 
    at com.ibm.designer.prj.resources.commons.CommonProjectSynchronizer.resourceChanged(Unknown Source) 
    at org.eclipse.core.internal.events.NotificationManager$2.run(Unknown Source) 
    at org.eclipse.core.runtime.SafeRunner.run(Unknown Source) 
    at org.eclipse.core.internal.events.NotificationManager.notify(Unknown Source) 
    at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(Unknown Source) 
    at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Unknown Source) 
    at org.eclipse.core.internal.resources.Workspace.endOperation(Unknown Source) 
    at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(Unknown Source) 
    at org.eclipse.core.internal.jobs.Worker.run(Unknown Source) 


09:32:37.430 7 WARNING com.ibm.xsp.registry.parse.definition.ComponentParser 
getJavaClass CLFAD0090W: The component-class (mxpd2.component.InputRichText) could not be resolved for the component with component-type com.ibm.xsp.InputRichText. 

回答

1

一些事情要检查:

你可以看到在帮助所有相关的错误 - >支持 - >显示日志 帮助 - >支持 - >显示跟踪 (抱歉,如果不是确切的,我不在我的电脑) 有时你会发现错误在这里与无效的xsp配置相关

我看不到您的Java组件的源代码,但是可以使用 仔细检查下的类名是否正确?如果你已经重命名了包或类名,那么它将不会找到它。

是包含在xpages源代码顶部的命名空间(mxpd)吗?如果它没有在顶部引用,那么它将不知道在该名称空间下找到该组件。

我还发现,有时当开发一个NSF内的一个组件时,我必须连续清理两次。设计师有时会感到困惑。

编辑 从跟踪,它看起来像你的。 java文件可能无法正确编译为.class文件。当注册表试图解析类文件时,它会得到一个意外的EOF。 尝试对Java文件进行小改动以触发另一个构建(添加注释或空白区域) 确保没有编译错误

+0

我在我的问题中添加了跟踪日志。该类的java包是mxpd2.component,类名是InputRichText。名称空间包含在xpages的顶部。 –

+0

感谢您的更新,但我已经尝试过。有效,但下次打开设计器时会出现错误。 :/ –

+0

是的,我担心,当你从NSF内部开发UI控件时,你必须自己辞职以频繁地遇到这种构建错误。这是非常烦人的,你只需要清除它们并继续前进。如果您转而从OSGi插件中开发UI控件,您将不会再遇到这种情况。 (但也有其他烦恼!) –