如何从错误“865 (http-0.0.0.0-443-5) [ JavaEventHandler.ja va:100:ERROR]”中调试 ofbiz 应用程序

发布于 2024-10-09 20:39:05 字数 17431 浏览 5 评论 0原文

我是 ofbiz 的新手。所以我的问题是有任何错误请原谅我的错误。我是 ofbiz 的新手,所以我不知道 ofbiz 中的一些术语。有时,由于缺乏 ofbiz 的知识,我的问题不清楚。所以尝试理解我的问题,并根据我的水平给我一个好的解决方案。因为有些解决方案的水平非常高,我无法理解。所以请给出带有好的例子的解决方案。

我的项目“productmgntSystem”位于“ofbiz/hot-deploy”文件夹中。在我的项目中,我有一个名为“app_details_1.ftl”的文件,其编码如下,

<html>

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

        <!--<meta http-equiv="Content-Type" content="multipart/form-data; charset=ISO-8859-1">-->

        <title>Insert title here</title>
        <script TYPE="TEXT/JAVASCRIPT" language=""JAVASCRIPT">
            function uploadFile()
            {
                //alert("Before calling upload.jsp");
                window.location='<@ofbizUrl>testing_service1</@ofbizUrl>'

            }

            function logout1()
            {
                //alert("Logout1");
                alert("<@ofbizUrl>logout1</@ofbizUrl>");
                window.location='<@ofbizUrl>logout1</@ofbizUrl>'
            }
        </script>
    </head>
        <!-- <form action="<@ofbizUrl>testing_service1</@ofbizUrl>" enctype="multipart/form-data" name="app_details_frm"> -->
        <form enctype="multipart/form-data" action="<@ofbizUrl>uploadAttachFile</@ofbizUrl>" METHOD=POST> 
        <center style="height: 299px; ">
            <table border="0" style="height: 177px; width: 788px">
                <tr style="height: 115px; ">
                    <td style="width: 103px; ">
                    <td style="width: 413px; "><h1>APPLICATION DETAILS</h1>
                    <td style="width: 55px; ">
                </tr>
                <tr>
                    <td style="width: 125px; ">Application name : </td>
                    <td>
                        <input name="app_name_txt" id="txt_1" value=" " />
                    </td>
                </tr>
                <tr>
                    <td style="width: 125px; ">Excell sheet &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </td>
                    <td>
                        <input type="file" name="filename"/>
                    </td>
                </tr>
                <tr>
                    <td>
                       <input type="button" name="logout1_cmd" value="Logout" onclick="logout1()"/>
                      <!-- <input type="submit" name="logout_cmd" value="logout"/>-->
                    </td>
                    <td>
                        <input type="submit" name="upload_cmd" value="UPLOAD" /> 
                        <!-- <input type="button" name="upload1_cmd" value="Upload" onclick="uploadFile()"/> -->
                    </td>                   
                </tr>
            </table>
        </center>
    </form>
</html>

以下是“controller.xml”中存在的一些编码文件

..........
..........
...........
<request-map uri="uploadAttachFile">
            <security https="true" auth="true"/>
           <!--  <event type="simple" invoke="createCommunicationContent" path="component://productionmgntSystem/script/org/ofbiz/productionmgntSystem/CommunicationEventEvents.xml"/>  -->

           <event type="java" path="org.ofbiz.productionmgntSystem.web_app_req.Uploading" invoke="uploadFile"/>

            <response name="AttachementSuccess" type="view" value="AttachementSuccess"/>
            <response name="AttachementException" type="view" value="AttachementException"/>
        </request-map>    
...............
...........
............
<!--  I DEFINED - START -->
        <view-map name="AttachmentError" type="ftl" page="file_attach_error.ftl"/>
        <view-map name="AttachementException" type="ftl" page="file_attach_error.ftl"/>
        <view-map name="AttachementSuccess" type="ftl" page="AttachementSuccess.ftl"/>
    <!--  I DEFINED - END -->
...............
...............
.............

以下是文件“AttachementSuccess.ftl”中的编码

<html>
    <head>
        <title>FILE ATTACH SUCCESS</title>
    </head>
    <form action="<@ofbizUrl>logout1</@ofbizUrl>" enctype="multipart/form-data" name="file_attach_error_frm">
        <table>
            <tr>
                <td>
                <td>
                <td>
            </tr>
            <tr>
                <td>
                <td>File attachement success</td>
                <td>
            </tr>
            <tr>
                <td>
                <td><input type="submit" value="LOGOUT"/></td>
                <td>                 
            </tr>
        </table>
    </form>
</html>

以下是文件“file_attach_error.ftl”中的编码

<html>
    <head>
        <title>FILE ATTACH ERROR</title>
    </head>
    <form action="<@ofbizUrl>logout1</@ofbizUrl>" enctype="multipart/form-data" name="file_attach_error_frm">
        <table>
            <tr>
                <td>
                <td>
                <td>
            </tr>
            <tr>
                <td>
                <td>File attachement error</td>
                <td>
            </tr>
            <tr>
                <td>
                <td><input type="submit" value="LOGOUT"/></td>
                <td>                 
            </tr>
        </table>
    </form>
</html>

以下是文件“Uploading.java”内的编码

//UPLOADING A CONTENT TO THE SERVER

package org.ofbiz.productionmgntSystem.web_app_req;

import java.io.File;
import java.nio.ByteBuffer;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.ofbiz.service.ServiceUtil;
import java.util.List;

public class Uploading
{
    public static String uploadFile(HttpServletRequest request,HttpServletResponse response)
    {
        //ServletFileUpload fu = new ServletFileUpload(new DiskFileItemFactory(10240, new File(new File("runtime"), "tmp")));           //Creation of servletfileupload
        System.out.println("\n\n\t****************************************\n\tuploadFile(HttpServletRequest request,HttpServletResponse response) - start\n\t");
        ServletFileUpload fu = new ServletFileUpload(new DiskFileItemFactory());           //Creation of servletfileupload
        java.util.List lst = null;
        String result="AttachementException";
        try 
        {
            lst = fu.parseRequest(request);
        }
        catch (FileUploadException fup_ex) 
        {
            System.out.println("\n\n\t****************************************\n\tException of FileUploadException \n\t");
            fup_ex.printStackTrace();
            result="AttachementException";
            return(result);
        }

        if(lst.size()==0)        //There is no item in lst
        {
            System.out.println("\n\n\t****************************************\n\tLst count is 0 \n\t");
            result="AttachementException";
            return(result);
        }


        FileItem file_item = null;
        FileItem selected_file_item=null;

        //Checking for form fields - Start
            for (int i=0; i < lst.size(); i++) 
            {
                file_item=(FileItem)lst.get(i);
                String fieldName = file_item.getFieldName();

                //Check for the attributes for user selected file - Start
                    if(fieldName.equals("filename"))
                    {
                        selected_file_item=file_item;
                        break;
                    }
                //Check for the attributes for user selected file - End
            }
        //Checking for form fields - End

        //Uploading the file content - Start
            if(selected_file_item==null)                    //If selected file item is null
            {
                System.out.println("\n\n\t****************************************\n\tThe selected file item is null\n\t");
                result="AttachementException";
                return(result);
            }

            byte[] file_bytes=selected_file_item.get();
            ByteBuffer byteWrap=ByteBuffer.wrap(file_bytes);
            byte[] extract_bytes=null;
            byteWrap.get(extract_bytes);
            System.out.println("\n\n\t****************************************\n\tExtract succeeded :content are : \n\t");

            if(extract_bytes==null)
            {
                System.out.println("\n\n\t****************************************\n\tExtract bytes is null\n\t");
                result="AttachementException";
                return(result);
            }
            for(int k=0;k<extract_bytes.length;k++)
                System.out.print((char)extract_bytes[k]);
            System.out.println("\n\n\t****************************************\n\tuploadFile(HttpServletRequest request,HttpServletResponse response) - end\n\t");
            return("AttachementSuccess");
        //Uploading the file content - End

    }
}

我想将文件上传到服务器使用“标签。当我执行应用程序时,浏览器中显示以下错误。 alt text

以下是控制台中的 stackTrace 打印,

     [java] 2010-12-29 10:56:38,336 (http-0.0.0.0-443-1) [   JavaEventHandler.ja
va:100:ERROR]
     [java] ---- runtime exception report --------------------------------------
------------
     [java] Problems Processing Event
     [java] Exception: java.lang.NullPointerException
     [java] Message: null
     [java] ---- stack trace ---------------------------------------------------
------------
     [java] java.lang.NullPointerException
     [java] java.nio.ByteBuffer.get(ByteBuffer.java:675)
     [java] org.ofbiz.productionmgntSystem.web_app_req.Uploading.uploadFile(Uplo
ading.java:76)
     [java] sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
.java:39)
     [java] sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
ssorImpl.java:25)
     [java] java.lang.reflect.Method.invoke(Method.java:597)
     [java] org.ofbiz.webapp.event.JavaEventHandler.invoke(JavaEventHandler.java
:92)
     [java] org.ofbiz.webapp.event.JavaEventHandler.invoke(JavaEventHandler.java
:78)
     [java] org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java
:592)
     [java] org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.jav
a:361)
     [java] org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:20
2)
     [java] org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:7
8)
     [java] javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
     [java] javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
     [java] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(App
licationFilterChain.java:290)
     [java] org.apache.catalina.core.ApplicationFilterChain.doFilter(Application
FilterChain.java:206)
     [java] org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:2
59)
     [java] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(App
licationFilterChain.java:235)
     [java] org.apache.catalina.core.ApplicationFilterChain.doFilter(Application
FilterChain.java:206)
     [java] org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapper
Valve.java:233)
     [java] org.apache.catalina.core.StandardContextValve.invoke(StandardContext
Valve.java:175)
     [java] org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.
java:128)
     [java] org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.
java:102)
     [java] org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVa
lve.java:109)
     [java] org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java
:568)
     [java] org.ofbiz.catalina.container.CrossSubdomainSessionValve.invoke(Cross
SubdomainSessionValve.java:62)
     [java] org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.ja
va:286)
     [java] org.apache.coyote.http11.Http11Processor.process(Http11Processor.jav
a:844)
     [java] org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proc
ess(Http11Protocol.java:583)
     [java] org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:4
47)
     [java] java.lang.Thread.run(Thread.java:619)
     [java] --------------------------------------------------------------------
------------
     [java]
     [java] 2010-12-29 10:56:38,336 (http-0.0.0.0-443-1) [     ControlServlet.ja
va:205:ERROR]
     [java] ---- exception report ----------------------------------------------
------------
     [java] Error in request handler:
     [java] Exception: org.ofbiz.webapp.event.EventHandlerException
     [java] Message: Problems processing event: java.lang.NullPointerException (
null)
     [java] ---- cause ---------------------------------------------------------
------------
     [java] Exception: java.lang.NullPointerException
     [java] Message: null
     [java] ---- stack trace ---------------------------------------------------
------------
     [java] java.lang.NullPointerException
     [java] java.nio.ByteBuffer.get(ByteBuffer.java:675)
     [java] org.ofbiz.productionmgntSystem.web_app_req.Uploading.uploadFile(Uplo
ading.java:76)
     [java] sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
.java:39)
     [java] sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
ssorImpl.java:25)
     [java] java.lang.reflect.Method.invoke(Method.java:597)
     [java] org.ofbiz.webapp.event.JavaEventHandler.invoke(JavaEventHandler.java
:92)
     [java] org.ofbiz.webapp.event.JavaEventHandler.invoke(JavaEventHandler.java
:78)
     [java] org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java
:592)
     [java] org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.jav
a:361)
     [java] org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:20
2)
     [java] org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:7
8)
     [java] javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
     [java] javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
     [java] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(App
licationFilterChain.java:290)
     [java] org.apache.catalina.core.ApplicationFilterChain.doFilter(Application
FilterChain.java:206)
     [java] org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:2
59)
     [java] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(App
licationFilterChain.java:235)
     [java] org.apache.catalina.core.ApplicationFilterChain.doFilter(Application
FilterChain.java:206)
     [java] org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapper
Valve.java:233)
     [java] org.apache.catalina.core.StandardContextValve.invoke(StandardContext
Valve.java:175)
     [java] org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.
java:128)
     [java] org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.
java:102)
     [java] org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVa
lve.java:109)
     [java] org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java
:568)
     [java] org.ofbiz.catalina.container.CrossSubdomainSessionValve.invoke(Cross
SubdomainSessionValve.java:62)
     [java] org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.ja
va:286)
     [java] org.apache.coyote.http11.Http11Processor.process(Http11Processor.jav
a:844)
     [java] org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proc
ess(Http11Protocol.java:583)
     [java] org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:4
47)
     [java] java.lang.Thread.run(Thread.java:619)
     [java] --------------------------------------------------------------------
------------
     [java]
     [java] 2010-12-29 10:56:38,336 (http-0.0.0.0-443-1) [     ControlServlet.ja
va:221:ERROR] An error occurred, going to the errorPage: /error/error.jsp
     [java] 2010-12-29 10:56:38,351 (http-0.0.0.0-443-1) [     ControlServlet.ja
va:228:ERROR] Including errorPage: /error/error.jsp
     [java] 2010-12-29 10:56:38,367 (http-0.0.0.0-443-1) [     ControlServlet.ja
va:302:INFO ] [[[uploadAttachFile] Request Done- total:0.063,since last([uploadA
ttachFile...):0.063]]

我无法解决该问题。所以请帮我解决问题。

谢谢&问候, 西瓦库玛尔

Im new to ofbiz.So is my question is have any mistake forgive me for my mistakes.Im new to ofbiz so i did not know some terminologies in ofbiz.Sometimes my question is not clear because of lack of knowledge in ofbiz.So try to understand my question and give me a good solution with respect to my level.Because some solutions are in very high level cannot able to understand for me.So please give the solution with good examples.

My project namely "productionmgntSystem" is in "ofbiz/hot-deploy" folder.In my project i had a file namely "app_details_1.ftl" with the following codings

<html>

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

        <!--<meta http-equiv="Content-Type" content="multipart/form-data; charset=ISO-8859-1">-->

        <title>Insert title here</title>
        <script TYPE="TEXT/JAVASCRIPT" language=""JAVASCRIPT">
            function uploadFile()
            {
                //alert("Before calling upload.jsp");
                window.location='<@ofbizUrl>testing_service1</@ofbizUrl>'

            }

            function logout1()
            {
                //alert("Logout1");
                alert("<@ofbizUrl>logout1</@ofbizUrl>");
                window.location='<@ofbizUrl>logout1</@ofbizUrl>'
            }
        </script>
    </head>
        <!-- <form action="<@ofbizUrl>testing_service1</@ofbizUrl>" enctype="multipart/form-data" name="app_details_frm"> -->
        <form enctype="multipart/form-data" action="<@ofbizUrl>uploadAttachFile</@ofbizUrl>" METHOD=POST> 
        <center style="height: 299px; ">
            <table border="0" style="height: 177px; width: 788px">
                <tr style="height: 115px; ">
                    <td style="width: 103px; ">
                    <td style="width: 413px; "><h1>APPLICATION DETAILS</h1>
                    <td style="width: 55px; ">
                </tr>
                <tr>
                    <td style="width: 125px; ">Application name : </td>
                    <td>
                        <input name="app_name_txt" id="txt_1" value=" " />
                    </td>
                </tr>
                <tr>
                    <td style="width: 125px; ">Excell sheet         : </td>
                    <td>
                        <input type="file" name="filename"/>
                    </td>
                </tr>
                <tr>
                    <td>
                       <input type="button" name="logout1_cmd" value="Logout" onclick="logout1()"/>
                      <!-- <input type="submit" name="logout_cmd" value="logout"/>-->
                    </td>
                    <td>
                        <input type="submit" name="upload_cmd" value="UPLOAD" /> 
                        <!-- <input type="button" name="upload1_cmd" value="Upload" onclick="uploadFile()"/> -->
                    </td>                   
                </tr>
            </table>
        </center>
    </form>
</html>

the following are the some of the coding present in the "controller.xml" file

..........
..........
...........
<request-map uri="uploadAttachFile">
            <security https="true" auth="true"/>
           <!--  <event type="simple" invoke="createCommunicationContent" path="component://productionmgntSystem/script/org/ofbiz/productionmgntSystem/CommunicationEventEvents.xml"/>  -->

           <event type="java" path="org.ofbiz.productionmgntSystem.web_app_req.Uploading" invoke="uploadFile"/>

            <response name="AttachementSuccess" type="view" value="AttachementSuccess"/>
            <response name="AttachementException" type="view" value="AttachementException"/>
        </request-map>    
...............
...........
............
<!--  I DEFINED - START -->
        <view-map name="AttachmentError" type="ftl" page="file_attach_error.ftl"/>
        <view-map name="AttachementException" type="ftl" page="file_attach_error.ftl"/>
        <view-map name="AttachementSuccess" type="ftl" page="AttachementSuccess.ftl"/>
    <!--  I DEFINED - END -->
...............
...............
.............

The following are the coding in the file "AttachementSuccess.ftl"

<html>
    <head>
        <title>FILE ATTACH SUCCESS</title>
    </head>
    <form action="<@ofbizUrl>logout1</@ofbizUrl>" enctype="multipart/form-data" name="file_attach_error_frm">
        <table>
            <tr>
                <td>
                <td>
                <td>
            </tr>
            <tr>
                <td>
                <td>File attachement success</td>
                <td>
            </tr>
            <tr>
                <td>
                <td><input type="submit" value="LOGOUT"/></td>
                <td>                 
            </tr>
        </table>
    </form>
</html>

The following are the coding present in the file "file_attach_error.ftl"

<html>
    <head>
        <title>FILE ATTACH ERROR</title>
    </head>
    <form action="<@ofbizUrl>logout1</@ofbizUrl>" enctype="multipart/form-data" name="file_attach_error_frm">
        <table>
            <tr>
                <td>
                <td>
                <td>
            </tr>
            <tr>
                <td>
                <td>File attachement error</td>
                <td>
            </tr>
            <tr>
                <td>
                <td><input type="submit" value="LOGOUT"/></td>
                <td>                 
            </tr>
        </table>
    </form>
</html>

the following are the coding inside the file "Uploading.java"

//UPLOADING A CONTENT TO THE SERVER

package org.ofbiz.productionmgntSystem.web_app_req;

import java.io.File;
import java.nio.ByteBuffer;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.ofbiz.service.ServiceUtil;
import java.util.List;

public class Uploading
{
    public static String uploadFile(HttpServletRequest request,HttpServletResponse response)
    {
        //ServletFileUpload fu = new ServletFileUpload(new DiskFileItemFactory(10240, new File(new File("runtime"), "tmp")));           //Creation of servletfileupload
        System.out.println("\n\n\t****************************************\n\tuploadFile(HttpServletRequest request,HttpServletResponse response) - start\n\t");
        ServletFileUpload fu = new ServletFileUpload(new DiskFileItemFactory());           //Creation of servletfileupload
        java.util.List lst = null;
        String result="AttachementException";
        try 
        {
            lst = fu.parseRequest(request);
        }
        catch (FileUploadException fup_ex) 
        {
            System.out.println("\n\n\t****************************************\n\tException of FileUploadException \n\t");
            fup_ex.printStackTrace();
            result="AttachementException";
            return(result);
        }

        if(lst.size()==0)        //There is no item in lst
        {
            System.out.println("\n\n\t****************************************\n\tLst count is 0 \n\t");
            result="AttachementException";
            return(result);
        }


        FileItem file_item = null;
        FileItem selected_file_item=null;

        //Checking for form fields - Start
            for (int i=0; i < lst.size(); i++) 
            {
                file_item=(FileItem)lst.get(i);
                String fieldName = file_item.getFieldName();

                //Check for the attributes for user selected file - Start
                    if(fieldName.equals("filename"))
                    {
                        selected_file_item=file_item;
                        break;
                    }
                //Check for the attributes for user selected file - End
            }
        //Checking for form fields - End

        //Uploading the file content - Start
            if(selected_file_item==null)                    //If selected file item is null
            {
                System.out.println("\n\n\t****************************************\n\tThe selected file item is null\n\t");
                result="AttachementException";
                return(result);
            }

            byte[] file_bytes=selected_file_item.get();
            ByteBuffer byteWrap=ByteBuffer.wrap(file_bytes);
            byte[] extract_bytes=null;
            byteWrap.get(extract_bytes);
            System.out.println("\n\n\t****************************************\n\tExtract succeeded :content are : \n\t");

            if(extract_bytes==null)
            {
                System.out.println("\n\n\t****************************************\n\tExtract bytes is null\n\t");
                result="AttachementException";
                return(result);
            }
            for(int k=0;k<extract_bytes.length;k++)
                System.out.print((char)extract_bytes[k]);
            System.out.println("\n\n\t****************************************\n\tuploadFile(HttpServletRequest request,HttpServletResponse response) - end\n\t");
            return("AttachementSuccess");
        //Uploading the file content - End

    }
}

I want to upload a file into the server using " tag.When i execute the application the following error is shown in browser.
alt text

The following are the stackTrace print in the console

     [java] 2010-12-29 10:56:38,336 (http-0.0.0.0-443-1) [   JavaEventHandler.ja
va:100:ERROR]
     [java] ---- runtime exception report --------------------------------------
------------
     [java] Problems Processing Event
     [java] Exception: java.lang.NullPointerException
     [java] Message: null
     [java] ---- stack trace ---------------------------------------------------
------------
     [java] java.lang.NullPointerException
     [java] java.nio.ByteBuffer.get(ByteBuffer.java:675)
     [java] org.ofbiz.productionmgntSystem.web_app_req.Uploading.uploadFile(Uplo
ading.java:76)
     [java] sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
.java:39)
     [java] sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
ssorImpl.java:25)
     [java] java.lang.reflect.Method.invoke(Method.java:597)
     [java] org.ofbiz.webapp.event.JavaEventHandler.invoke(JavaEventHandler.java
:92)
     [java] org.ofbiz.webapp.event.JavaEventHandler.invoke(JavaEventHandler.java
:78)
     [java] org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java
:592)
     [java] org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.jav
a:361)
     [java] org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:20
2)
     [java] org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:7
8)
     [java] javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
     [java] javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
     [java] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(App
licationFilterChain.java:290)
     [java] org.apache.catalina.core.ApplicationFilterChain.doFilter(Application
FilterChain.java:206)
     [java] org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:2
59)
     [java] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(App
licationFilterChain.java:235)
     [java] org.apache.catalina.core.ApplicationFilterChain.doFilter(Application
FilterChain.java:206)
     [java] org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapper
Valve.java:233)
     [java] org.apache.catalina.core.StandardContextValve.invoke(StandardContext
Valve.java:175)
     [java] org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.
java:128)
     [java] org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.
java:102)
     [java] org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVa
lve.java:109)
     [java] org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java
:568)
     [java] org.ofbiz.catalina.container.CrossSubdomainSessionValve.invoke(Cross
SubdomainSessionValve.java:62)
     [java] org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.ja
va:286)
     [java] org.apache.coyote.http11.Http11Processor.process(Http11Processor.jav
a:844)
     [java] org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proc
ess(Http11Protocol.java:583)
     [java] org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:4
47)
     [java] java.lang.Thread.run(Thread.java:619)
     [java] --------------------------------------------------------------------
------------
     [java]
     [java] 2010-12-29 10:56:38,336 (http-0.0.0.0-443-1) [     ControlServlet.ja
va:205:ERROR]
     [java] ---- exception report ----------------------------------------------
------------
     [java] Error in request handler:
     [java] Exception: org.ofbiz.webapp.event.EventHandlerException
     [java] Message: Problems processing event: java.lang.NullPointerException (
null)
     [java] ---- cause ---------------------------------------------------------
------------
     [java] Exception: java.lang.NullPointerException
     [java] Message: null
     [java] ---- stack trace ---------------------------------------------------
------------
     [java] java.lang.NullPointerException
     [java] java.nio.ByteBuffer.get(ByteBuffer.java:675)
     [java] org.ofbiz.productionmgntSystem.web_app_req.Uploading.uploadFile(Uplo
ading.java:76)
     [java] sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
.java:39)
     [java] sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
ssorImpl.java:25)
     [java] java.lang.reflect.Method.invoke(Method.java:597)
     [java] org.ofbiz.webapp.event.JavaEventHandler.invoke(JavaEventHandler.java
:92)
     [java] org.ofbiz.webapp.event.JavaEventHandler.invoke(JavaEventHandler.java
:78)
     [java] org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java
:592)
     [java] org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.jav
a:361)
     [java] org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:20
2)
     [java] org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:7
8)
     [java] javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
     [java] javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
     [java] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(App
licationFilterChain.java:290)
     [java] org.apache.catalina.core.ApplicationFilterChain.doFilter(Application
FilterChain.java:206)
     [java] org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:2
59)
     [java] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(App
licationFilterChain.java:235)
     [java] org.apache.catalina.core.ApplicationFilterChain.doFilter(Application
FilterChain.java:206)
     [java] org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapper
Valve.java:233)
     [java] org.apache.catalina.core.StandardContextValve.invoke(StandardContext
Valve.java:175)
     [java] org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.
java:128)
     [java] org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.
java:102)
     [java] org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVa
lve.java:109)
     [java] org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java
:568)
     [java] org.ofbiz.catalina.container.CrossSubdomainSessionValve.invoke(Cross
SubdomainSessionValve.java:62)
     [java] org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.ja
va:286)
     [java] org.apache.coyote.http11.Http11Processor.process(Http11Processor.jav
a:844)
     [java] org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proc
ess(Http11Protocol.java:583)
     [java] org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:4
47)
     [java] java.lang.Thread.run(Thread.java:619)
     [java] --------------------------------------------------------------------
------------
     [java]
     [java] 2010-12-29 10:56:38,336 (http-0.0.0.0-443-1) [     ControlServlet.ja
va:221:ERROR] An error occurred, going to the errorPage: /error/error.jsp
     [java] 2010-12-29 10:56:38,351 (http-0.0.0.0-443-1) [     ControlServlet.ja
va:228:ERROR] Including errorPage: /error/error.jsp
     [java] 2010-12-29 10:56:38,367 (http-0.0.0.0-443-1) [     ControlServlet.ja
va:302:INFO ] [[[uploadAttachFile] Request Done- total:0.063,since last([uploadA
ttachFile...):0.063]]

I cannot able to solve the issue.So please help me to solve the issue.

Thanks & Regards,
Sivakumar.J

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深者入戏 2024-10-16 20:39:05

Uploading.uploadFile() 方法中,有两行(靠近末尾),如下所示:

   byte[] extract_bytes=null;
   byteWrap.get(extract_bytes);

因为您将 null 数组传递给 get() 方法,您将得到一个 NullPointerException

In Uploading.uploadFile() method there are two lines (near the end) like this:

   byte[] extract_bytes=null;
   byteWrap.get(extract_bytes);

Because you are passing a null array to get() method you are getting a NullPointerException.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文