2016-02-19 33 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控件,您將不會再遇到這種情況。 (但也有其他煩惱!) –