如何在jar中打包库控件

时间:2012-11-22 12:41:49

标签: jsf xpages

我在Java中构建了一些库控件来扩展一些(JSF)控件,如Edit Box,Combobox等。我想在JAR文件中打包我的控件(只有java代码),但每次我用jar替换java文件时都会出错。

有人知道我为什么会收到此错误吗?我无法创建插件,因为扩展控件只能在一个NSF中使用。

  

错误500
  HTTP Web服务器:命令未处理异常

以下是日志文件中的完整错误:

<CommonBaseEvent creationTime="2012-11-22T12:28:27.960+01:00" globalInstanceId="ELc0a8643600013b27e0473d00000000" msg="CLFAD0131E: Unable to push data because: Could not open the document" severity="50" version="1.0.1">
    <extendedDataElements name="CommonBaseEventLogRecord:level" type="noValue">
        <children name="CommonBaseEventLogRecord:name" type="string"> 
            <values>SCHWERWIEGEND</values>
        </children>
    </extendedDataElements>
    <extendedDataElements name="CommonBaseEventLogRecord:sourceClassName" type="string">
        <values>com.ibm.commons.log.AbstractLogMgr</values>
    </extendedDataElements>
    <extendedDataElements name="CommonBaseEventLogRecord:sourceMethodName" type="string">
        <values>log</values>
    </extendedDataElements>
    <extendedDataElements name="CommonBaseEventLogRecord:Exception" type="string">
        <values>com.ibm.xsp.FacesExceptionEx: Could not open the document&#xD;&#xA;&#x9;at com.ibm.xsp.model.domino.DominoDocumentData.doOpenDocument(DominoDocumentData.java:505)&#xD;&#xA;&#x9;at com.ibm.xsp.model.AbstractDocumentDataSource.openDocument(AbstractDocumentDataSource.java:148)&#xD;&#xA;&#x9;at com.ibm.xsp.model.AbstractDocumentDataSource.load(AbstractDocumentDataSource.java:100)&#xD;&#xA;&#x9;at com.ibm.xsp.model.AbstractDataSource.getDataContainer(AbstractDataSource.java:474)&#xD;&#xA;&#x9;at com.ibm.xsp.model.domino.DominoDocumentData.getDataObject(DominoDocumentData.java:146)&#xD;&#xA;&#x9;at com.ibm.xsp.model.AbstractDataSource.pushData(AbstractDataSource.java:576)&#xD;&#xA;&#x9;at com.ibm.xsp.util.DataPublisher.publishControlData(DataPublisher.java:181)&#xD;&#xA;&#x9;at com.ibm.xsp.component.UIDataPanelBase.publishControlData(UIDataPanelBase.java:310)&#xD;&#xA;&#x9;at com.ibm.xsp.component.UIDataPanelBase.initBeforeContents(UIDataPanelBase.java:451)&#xD;&#xA;&#x9;at com.ibm.xsp.component.UIIncludeComposite.</values>
        <values>initBeforePageContents(UIIncludeComposite.java:668)&#xD;&#xA;&#x9;at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:339)&#xD;&#xA;&#x9;at com.ibm.xsp.page.compiled.AbstractCompiledPage.createTree(AbstractCompiledPage.java:256)&#xD;&#xA;&#x9;at com.ibm.xsp.page.compiled.AbstractCompiledPage.addComponent(AbstractCompiledPage.java:389)&#xD;&#xA;&#x9;at com.ibm.xsp.component.UIIncludeComposite.buildContents(UIIncludeComposite.java:453)&#xD;&#xA;&#x9;at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:334)&#xD;&#xA;&#x9;at com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildFacet(CompiledComponentBuilder.java:205)&#xD;&#xA;&#x9;at com.ibm.xsp.component.UICallback.buildContents(UICallback.java:180)&#xD;&#xA;&#x9;at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:334)&#xD;&#xA;&#x9;at com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildChildren(CompiledComponentBuilder.java:123)&#xD;&#xA;&#x9;a</values>
        <values>t com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildAll(CompiledComponentBuilder.java:84)&#xD;&#xA;&#x9;at com.ibm.xsp.extlib.component.layout.UIVarPublisherBase.buildContents(UIVarPublisherBase.java:97)&#xD;&#xA;&#x9;at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:334)&#xD;&#xA;&#x9;at com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildChildren(CompiledComponentBuilder.java:123)&#xD;&#xA;&#x9;at com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildAll(CompiledComponentBuilder.java:84)&#xD;&#xA;&#x9;at com.ibm.xsp.component.UIIncludeComposite.buildPageContents(UIIncludeComposite.java:692)&#xD;&#xA;&#x9;at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:340)&#xD;&#xA;&#x9;at com.ibm.xsp.page.compiled.AbstractCompiledPage.createTree(AbstractCompiledPage.java:256)&#xD;&#xA;&#x9;at com.ibm.xsp.page.compiled.AbstractCompiledPage.addComponent(AbstractCompiledPage.java:389)&#xD;&#xA;&#x9;at com.ibm.xsp.component.UIIncludeCo</values>
        <values>mposite.buildContents(UIIncludeComposite.java:453)&#xD;&#xA;&#x9;at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:334)&#xD;&#xA;&#x9;at com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildChildren(CompiledComponentBuilder.java:123)&#xD;&#xA;&#x9;at com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildAll(CompiledComponentBuilder.java:84)&#xD;&#xA;&#x9;at com.ibm.xsp.component.UIViewRootEx.buildContents(UIViewRootEx.java:1649)&#xD;&#xA;&#x9;at com.ibm.xsp.component.UIViewRootEx2.buildContents(UIViewRootEx2.java:246)&#xD;&#xA;&#x9;at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:334)&#xD;&#xA;&#x9;at com.ibm.xsp.page.compiled.AbstractCompiledPage.createTree(AbstractCompiledPage.java:256)&#xD;&#xA;&#x9;at com.ibm.xsp.page.compiled.AbstractCompiledPage.createViewRoot(AbstractCompiledPage.java:167)&#xD;&#xA;&#x9;at com.ibm.xsp.application.ViewHandlerExImpl._createViewRoot(ViewHandlerExImpl.java:511)&#xD;&#xA;&#x9;at com.ibm.xsp</values>
        <values>.application.ViewHandlerExImpl.createViewRoot(ViewHandlerExImpl.java:557)&#xD;&#xA;&#x9;at com.ibm.xsp.application.ViewHandlerExImpl.doCreateView(ViewHandlerExImpl.java:141)&#xD;&#xA;&#x9;at com.ibm.xsp.application.ViewHandlerEx.createView(ViewHandlerEx.java:90)&#xD;&#xA;&#x9;at com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:238)&#xD;&#xA;&#x9;at com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:200)&#xD;&#xA;&#x9;at com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:160)&#xD;&#xA;&#x9;at com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:137)&#xD;&#xA;&#x9;at com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)&#xD;&#xA;&#x9;at com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:576)&#xD;&#xA;&#x9;at com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1267)&#xD;&#xA;&#x9;at com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(Compo</values>
        <values>nentModule.java:847)&#xD;&#xA;&#x9;at com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:796)&#xD;&#xA;&#x9;at com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:565)&#xD;&#xA;&#x9;at com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1251)&#xD;&#xA;&#x9;at com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:598)&#xD;&#xA;&#x9;at com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:421)&#xD;&#xA;&#x9;at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:341)&#xD;&#xA;&#x9;at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:297)&#xD;&#xA;&#x9;at com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)&#xD;&#xA;Caused by: com.ibm.xsp.exception.EvaluationExceptionEx: Error while executing JavaScript computed expression&#xD;&#xA;&#x9;at com.ibm.xsp.binding.javascript.</values>
        <values>JavaScriptValueBinding.getValue(JavaScriptValueBinding.java:132)&#xD;&#xA;&#x9;at com.ibm.xsp.model.domino.DominoDocumentData.getComputeWithForm(DominoDocumentData.java:206)&#xD;&#xA;&#x9;at com.ibm.xsp.model.domino.DominoDocumentData.doOpenDocument(DominoDocumentData.java:493)&#xD;&#xA;&#x9;... 56 more&#xD;&#xA;Caused by: java.lang.NullPointerException&#xD;&#xA;&#x9;at java.lang.Class.isAssignableFrom(Native Method)&#xD;&#xA;&#x9;at com.ibm.jscript.types.JavaAccessObject$ClassInfoCache.&lt;init&gt;(JavaAccessObject.java:1050)&#xD;&#xA;&#x9;at com.ibm.jscript.types.JavaAccessObject.getClassInfoCache(JavaAccessObject.java:963)&#xD;&#xA;&#x9;at com.ibm.jscript.types.JavaAccessObject.construct(JavaAccessObject.java:240)&#xD;&#xA;&#x9;at com.ibm.jscript.types.JavaWrapperObject.construct(JavaWrapperObject.java:1)&#xD;&#xA;&#x9;at com.ibm.jscript.ASTTree.ASTNew.interpret(ASTNew.java:109)&#xD;&#xA;&#x9;at com.ibm.jscript.ASTTree.ASTVariableDecl.interpret(ASTVariableDecl.java:82)&#xD;&#xA;&#x9;at com.ibm.jscript.ASTTr</values>
        <values>ee.ASTBlock.interpret(ASTBlock.java:100)&#xD;&#xA;&#x9;at com.ibm.jscript.ASTTree.ASTIf.interpret(ASTIf.java:85)&#xD;&#xA;&#x9;at com.ibm.jscript.ASTTree.ASTProgram.interpret(ASTProgram.java:119)&#xD;&#xA;&#x9;at com.ibm.jscript.ASTTree.ASTProgram.interpretEx(ASTProgram.java:139)&#xD;&#xA;&#x9;at com.ibm.jscript.JSExpression._interpretExpression(JSExpression.java:435)&#xD;&#xA;&#x9;at com.ibm.jscript.JSExpression.access$1(JSExpression.java:424)&#xD;&#xA;&#x9;at com.ibm.jscript.JSExpression$2.run(JSExpression.java:414)&#xD;&#xA;&#x9;at java.security.AccessController.doPrivileged(AccessController.java:284)&#xD;&#xA;&#x9;at com.ibm.jscript.JSExpression.interpretExpression(JSExpression.java:410)&#xD;&#xA;&#x9;at com.ibm.jscript.JSExpression.evaluateValue(JSExpression.java:251)&#xD;&#xA;&#x9;at com.ibm.jscript.JSExpression.evaluateValue(JSExpression.java:234)&#xD;&#xA;&#x9;at com.ibm.xsp.javascript.JavaScriptInterpreter.interpret(JavaScriptInterpreter.java:221)&#xD;&#xA;&#x9;at com.ibm.xsp.javascript.JavaScriptInte</values>
        <values>rpreter.interpret(JavaScriptInterpreter.java:193)&#xD;&#xA;&#x9;at com.ibm.xsp.binding.javascript.JavaScriptValueBinding.getValue(JavaScriptValueBinding.java:78)&#xD;&#xA;&#x9;... 58 more&#xD;&#xA;</values>
    </extendedDataElements>
    <sourceComponentId component="Expeditor 6.2" componentIdType="ProductName" instanceId="" location="Christian-PC" locationType="Hostname" subComponent="" threadId="0" componentType="http://www.w3.org/2001/XMLSchema-instance"/>
    <situation categoryName="ReportSituation">
        <situationType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ReportSituation" reasoningScope="INTERNAL" reportCategory="LOG"/>
    </situation>
</CommonBaseEvent>

这是可读的堆栈跟踪部分:

com.ibm.xsp.FacesExceptionEx: Could not open the document
    at com.ibm.xsp.model.domino.DominoDocumentData.doOpenDocument(DominoDocumentData.java:505)
    at com.ibm.xsp.model.AbstractDocumentDataSource.openDocument(AbstractDocumentDataSource.java:148)
    at com.ibm.xsp.model.AbstractDocumentDataSource.load(AbstractDocumentDataSource.java:100)
    at com.ibm.xsp.model.AbstractDataSource.getDataContainer(AbstractDataSource.java:474)
    at com.ibm.xsp.model.domino.DominoDocumentData.getDataObject(DominoDocumentData.java:146)
    at com.ibm.xsp.model.AbstractDataSource.pushData(AbstractDataSource.java:576)
    at com.ibm.xsp.util.DataPublisher.publishControlData(DataPublisher.java:181)
    at com.ibm.xsp.component.UIDataPanelBase.publishControlData(UIDataPanelBase.java:310)
    at com.ibm.xsp.component.UIDataPanelBase.initBeforeContents(UIDataPanelBase.java:451)
    at com.ibm.xsp.component.UIIncludeComposite.initBeforePageContents(UIIncludeComposite.java:668)
    at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:339)
    at com.ibm.xsp.page.compiled.AbstractCompiledPage.createTree(AbstractCompiledPage.java:256)
    at com.ibm.xsp.page.compiled.AbstractCompiledPage.addComponent(AbstractCompiledPage.java:389)
    at com.ibm.xsp.component.UIIncludeComposite.buildContents(UIIncludeComposite.java:453)
    at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:334)
    at com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildFacet(CompiledComponentBuilder.java:205)
    at com.ibm.xsp.component.UICallback.buildContents(UICallback.java:180)
    at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:334)
    at com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildChildren(CompiledComponentBuilder.java:123)
    at com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildAll(CompiledComponentBuilder.java:84)
    at com.ibm.xsp.extlib.component.layout.UIVarPublisherBase.buildContents(UIVarPublisherBase.java:97)
    at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:334)
    at com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildChildren(CompiledComponentBuilder.java:123)
    at com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildAll(CompiledComponentBuilder.java:84)
    at com.ibm.xsp.component.UIIncludeComposite.buildPageContents(UIIncludeComposite.java:692)
    at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:340)
    at com.ibm.xsp.page.compiled.AbstractCompiledPage.createTree(AbstractCompiledPage.java:256)
    at com.ibm.xsp.page.compiled.AbstractCompiledPage.addComponent(AbstractCompiledPage.java:389)
    at com.ibm.xsp.component.UIIncludeComposite.buildContents(UIIncludeComposite.java:453)
    at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:334)
    at com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildChildren(CompiledComponentBuilder.java:123)
    at com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildAll(CompiledComponentBuilder.java:84)
    at com.ibm.xsp.component.UIViewRootEx.buildContents(UIViewRootEx.java:1649)
    at com.ibm.xsp.component.UIViewRootEx2.buildContents(UIViewRootEx2.java:246)
    at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:334)
    at com.ibm.xsp.page.compiled.AbstractCompiledPage.createTree(AbstractCompiledPage.java:256)
    at com.ibm.xsp.page.compiled.AbstractCompiledPage.createViewRoot(AbstractCompiledPage.java:167)
    at com.ibm.xsp.application.ViewHandlerExImpl._createViewRoot(ViewHandlerExImpl.java:511)
    at com.ibm.xsp.application.ViewHandlerExImpl.createViewRoot(ViewHandlerExImpl.java:557)
    at com.ibm.xsp.application.ViewHandlerExImpl.doCreateView(ViewHandlerExImpl.java:141)
    at com.ibm.xsp.application.ViewHandlerEx.createView(ViewHandlerEx.java:90)
    at com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:238)
    at com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:200)
    at com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:160)
    at com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:137)
    at com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)
    at com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:576)
    at com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1267)
    at com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:847)
    at com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:796)
    at com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:565)
    at com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1251)
    at com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:598)
    at com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:421)
    at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:341)
    at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:297)
    at com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)
Caused by: com.ibm.xsp.exception.EvaluationExceptionEx: Error while executing JavaScript computed expression
    at com.ibm.xsp.binding.javascript.JavaScriptValueBinding.getValue(JavaScriptValueBinding.java:132)
    at com.ibm.xsp.model.domino.DominoDocumentData.getComputeWithForm(DominoDocumentData.java:206)
    at com.ibm.xsp.model.domino.DominoDocumentData.doOpenDocument(DominoDocumentData.java:493)
    ... 56 more
Caused by: java.lang.NullPointerException
    at java.lang.Class.isAssignableFrom(Native Method)
    at com.ibm.jscript.types.JavaAccessObject$ClassInfoCache.<init>(JavaAccessObject.java:1050)
    at com.ibm.jscript.types.JavaAccessObject.getClassInfoCache(JavaAccessObject.java:963)
    at com.ibm.jscript.types.JavaAccessObject.construct(JavaAccessObject.java:240)
    at com.ibm.jscript.types.JavaWrapperObject.construct(JavaWrapperObject.java:1)
    at com.ibm.jscript.ASTTree.ASTNew.interpret(ASTNew.java:109)
    at com.ibm.jscript.ASTTree.ASTVariableDecl.interpret(ASTVariableDecl.java:82)
    at com.ibm.jscript.ASTTree.ASTBlock.interpret(ASTBlock.java:100)
    at com.ibm.jscript.ASTTree.ASTIf.interpret(ASTIf.java:85)
    at com.ibm.jscript.ASTTree.ASTProgram.interpret(ASTProgram.java:119)
    at com.ibm.jscript.ASTTree.ASTProgram.interpretEx(ASTProgram.java:139)
    at com.ibm.jscript.JSExpression._interpretExpression(JSExpression.java:435)
    at com.ibm.jscript.JSExpression.access$1(JSExpression.java:424)
    at com.ibm.jscript.JSExpression$2.run(JSExpression.java:414)
    at java.security.AccessController.doPrivileged(AccessController.java:284)
    at com.ibm.jscript.JSExpression.interpretExpression(JSExpression.java:410)
    at com.ibm.jscript.JSExpression.evaluateValue(JSExpression.java:251)
    at com.ibm.jscript.JSExpression.evaluateValue(JSExpression.java:234)
    at com.ibm.xsp.javascript.JavaScriptInterpreter.interpret(JavaScriptInterpreter.java:221)
    at com.ibm.xsp.javascript.JavaScriptInterpreter.interpret(JavaScriptInterpreter.java:193)
    at com.ibm.xsp.binding.javascript.JavaScriptValueBinding.getValue(JavaScriptValueBinding.java:78)
    ... 58 more

1 个答案:

答案 0 :(得分:0)

我认为你在某个地方有一个空值

引起:java.lang.NullPointerException  at java.lang.Class.isAssignableFrom(Native Method)  在com.ibm.jscript.types.JavaAccessObject $ ClassInfoCache。(JavaAccessObject.java:1050)

可能在SSJS语句中或在SSJS调用的java类中

引起:com.ibm.xsp.exception.EvaluationExceptionEx:执行JavaScript计算表达式时出错  在com.ibm.xsp.binding.javascript。 JavaScriptValueBinding.getValue(JavaScriptValueBinding.java:132)  在com.ibm.xsp.model.domino.DominoDocumentData.getComputeWithForm(DominoDocumentData.java:206)

至于将java源导出到jar文件。我假设你在日食工作。右键单击您想要导出的eclipse中的插件并选择“Export”,然后在出现的对话框中选择“Plug-in Development \ Deployable Plug-ins and Fragments”。在下一个对话框中,选择要将插件导出到的路径(可能是%Domino_Program%\ data \ domino \ workspace \ applications \ eclipse文件夹)。然后执行“重启任务http”(您必须使用它,因为它也重新启动JVM)并且您的插件应该可供服务器使用。

由于您还在开发组件,我假设您希望设计器中提供这些组件。由于我不确定您是如何设置设计器的(即通过更新站点安装或通过插件插入的链接目录),我将需要更多信息。如果您使用的是更新站点,请使用google查找如何从eclipse构建更新站点。