- This topic has 1 reply, 2 voices, and was last updated 18 years, 10 months ago by Scott Anderson.
-
AuthorPosts
-
Mohamad SarimanParticipantHi,
I’m a new user for myEclipse. I am using Version: 3.0.2
Build id: 200503110845 and running Apache Tomcat 5.5.9Following the Tutorials to create a simple STRUTS app is a breeze.
But when I started adding my own library into this simple STRUTS application and set the appropriate settings i.e.
1. Project > Properties > Java Build Path > Add External JARS and select my wcm.jar.
2. Then set the Order and Export and checked the jar file.
3. Then click ok
4. I then redeploy the application as the I did for the STRUTS example I then get the error
java.lang.NoClassDefFoundError: com/filenet/wcm/api/Properties
at java.lang.Class.getDeclaredConstructors0(Native Method)I then create a class file using the actual Eclipse Version: 3.0.2
Build id: 200503110845
and set the Library as appropriate and I do not get any errors. This test is not using any server and it’s a plain java execution andit works.Does anyone has any idea what is wrong?
*****************Part of the code *************************
package com.bchydro.struts.action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.filenet.wcm.api.*;
import java.util.Iterator;
import filenet.vw.api.*;
import com.bchydro.struts.form.SearchForm;
import java.io.*;
/**
* MyEclipse Struts
* Creation date: 06-23-2005
*
* XDoclet definition:
* @struts:action path=”/search” name=”searchForm” input=”/form/search.jsp” scope=”request” validate=”true”
*/
public class SearchAction extends Action {// ——————————————————— Instance Variables
// ——————————————————— Methods
static Session myCESession;
static VWSession session;
/**
* Method execute
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
try {
myCESession = ObjectFactory.getSession(“MyApp”,Session.DEFAULT,”john deo”,”password”);
……………………
….. etc …***************** The Error I’m getting ************
Jun 24, 2005 10:18:33 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 4316 ms
Jun 24, 2005 10:23:45 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet action threw exception
java.lang.NoClassDefFoundError: com/filenet/wcm/api/Properties
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)
at java.lang.Class.getConstructor0(Class.java:2640)
at java.lang.Class.newInstance0(Class.java:321)
at java.lang.Class.newInstance(Class.java:303)
at org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:231)
at org.apache.struts.action.RequestProcessor.processActionCreate(RequestProcessor.java:326)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:268)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)******* END *******
Scott AndersonParticipantMohamad,
The problem is that “export” doesn’t do what you think it does; it simply makes the jar visible to other projects that depend on this one *and* indicates to our deployer that you would like it deployed *if* you’ve enabled extended deployment support. It’s the part after the *if* that hasn’t happened yet. You can find out how to turn that on in our Web Project Quickstart’s ‘advanced’ section here:
http://myeclipseide.com/enterpriseworkbench/help/topic/com.genuitec.myeclipse.doc/html/quickstarts/webprojects/index.html#dependent_projects
The setting you want is called ‘Jars on Web project build path’.Once you’ve done that, you’ll need to manually redeploy your project with the deployment manager dialog to get the jar to be picked up the first time.
-
AuthorPosts