BACNET4J & Servlet
-
Hi there, i am trying to set up a servlet(ReadAllAvailableProperties.java) to communicated with BACnet devices(SlaveDeviceTests.java). But all i get is the following error:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: javax.servlet.ServletException: Servlet execution threw an exception
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:532)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:440)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)root cause
javax.servlet.ServletException: Servlet execution threw an exception
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:927)
org.apache.jsp.index_jsp._jspService(index_jsp.java:54)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:417)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)root cause
java.lang.NoClassDefFoundError: com/serotonin/util/ObjectUtils
com.serotonin.bacnet4j.obj.BACnetObject.setPropertyImpl(BACnetObject.java:264)
com.serotonin.bacnet4j.obj.BACnetObject.setProperty(BACnetObject.java:188)
com.serotonin.bacnet4j.obj.BACnetObject.<init>(BACnetObject.java:81)
com.serotonin.bacnet4j.LocalDevice.<init>(LocalDevice.java:154)
com.serotonin.bacnet4j.LocalDevice.<init>(LocalDevice.java:142)
com.serotonin.bacnet4j.test.ReadAllAvailableProperties.<init>(ReadAllAvailableProperties.java:72)
com.gelement.bacnet.servlet.ReadAllAvailablePropertiesRequestServlet.doGet(ReadAllAvailablePropertiesRequestServlet.java:57)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:927)
org.apache.jsp.index_jsp._jspService(index_jsp.java:54)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:417)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)root cause
java.lang.ClassNotFoundException: com.serotonin.util.ObjectUtils
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
com.serotonin.bacnet4j.obj.BACnetObject.setPropertyImpl(BACnetObject.java:264)
com.serotonin.bacnet4j.obj.BACnetObject.setProperty(BACnetObject.java:188)
com.serotonin.bacnet4j.obj.BACnetObject.<init>(BACnetObject.java:81)
com.serotonin.bacnet4j.LocalDevice.<init>(LocalDevice.java:154)
com.serotonin.bacnet4j.LocalDevice.<init>(LocalDevice.java:142)
com.serotonin.bacnet4j.test.ReadAllAvailableProperties.<init>(ReadAllAvailableProperties.java:72)
com.gelement.bacnet.servlet.ReadAllAvailablePropertiesRequestServlet.doGet(ReadAllAvailablePropertiesRequestServlet.java:57)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:927)
org.apache.jsp.index_jsp._jspService(index_jsp.java:54)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:417)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)Anyone have any idea on this? I am @ a loss. :(
EDIT: Manage to fix the problem by right click on the warning message on seroUtils.jar then click on Quick Fix -> Mark the associated raw classpath entry as publish/export dependency.
-
You need to include seroUtils.jar in your class path.
-
@mlohbihler said:
You need to include seroUtils.jar in your class path.
Hi mlohbihler,
I have already included it in the class path. Any advice? Previously I try to build it around a Java Swing and was successful but when i try it out in a Servlet, it return me the above mention error.
Regards,
WenJun -
Make sure you are using the most recent bacnet4J.jar too.
-
@mlohbihler said:
Make sure you are using the most recent bacnet4J.jar too.
Hi mlohbihler,
Thank you for your reply. I actually imported the whole bacnet4j/src downloaded from your side instead of adding bacnet4j.jar as a classpath.
Will that cause any error?Regards,
WenJun -
If you're using the most recent source, then that code would be looking for org.apache.commons.lang3.ObjectUtils instead of the serotonin version. Make sure you have the latest, and then ensure that both seroUtils.jar and commons-lang3-3.0.jar are in your classpath.
-
@mlohbihler said:
If you're using the most recent source, then that code would be looking for org.apache.commons.lang3.ObjectUtils instead of the serotonin version. Make sure you have the latest, and then ensure that both seroUtils.jar and commons-lang3-3.0.jar are in your classpath.
Hi mlohbihler,
Can u tell me where i can get the commons-lang3-3.0.jar?
Regards,
WenJunAttachment: download link
-
Hi mlohbihler,
Maybe if u r interested i can send u my web project for u to take a look?
Regards,
WenJun