मैंने jsf फ़ाइल में jsp फ़ाइल में पंजीकरण फ़ॉर्म बनाया है और मैं इसे तत्वों से गुजरने के लिए इसे वेब सेवा से कनेक्ट करने का प्रयास करता हूं एक डेटाबेसjava.lang.NoClassDefFoundError: org/apache/commons/search/tools/DiscoverSingleton
जब मैं सबमिट बटन दबाता हूं तो मुझे एक त्रुटि मिलती है। मुझे नहीं लगता कि समस्या कनेक्शन कोड से संबंधित है लेकिन मुझे यकीन नहीं है।
क्या कोई मुझे कुछ बता सकता है जो शायद मुझे किसी तरह से मदद कर सकता है?
त्रुटि:
javax.servlet.ServletException: #{formabean.submitdetails}: java.lang.NoClassDefFoundError: org/apache/commons/discovery/tools/DiscoverSingleton
javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
मेरी प्रपत्र jsp:
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<f:view>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Form</title>
</head>
<body>
<div align="right" >
<p>
<br>.............
<h:commandButton value="submit" type="submit"
action="#{formabean.submitdetails}" />
</h:form>
</body>
</html>
</f:view>
मेरी बीन वर्ग "formavar":
package org.forma;
import org.imigrant.Migration.MigrationResult;
import org.imigrant.Migration.MigrationWS_PortType;
import org.imigrant.Migration.MigrationWS_Service;
import org.imigrant.Migration.MigrationWS_ServiceLocator;
/** libraries for Web Service*/
/**
*
* @author USER
*/
public class formavar {
private String name;
private String lastname;.....
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the surname
*/
public String getLastname() {
return lastname;
}
/**
* @param surname the surname to set
*/
public void setLastname(String lastname) {
this.lastname = lastname;
}......
public String submitdetails() {
String migrationURL = "http://localhost:8080/mule-tomcat/ESB/Migration?wsdl";
MigrationResult registrationResult = new MigrationResult();
try {
MigrationWS_Service service = new MigrationWS_ServiceLocator(migrationURL);
MigrationWS_PortType port = service.getMigrationImplPort();
registrationResult = port.registerDoc(
null,
this.granting,
this.expire_date,
this.name,
this.lastname,.............
);
return "OK";
} catch (Exception ex) {
return "ERROR "+ex.getMessage();
}
//return "OK";
}
}
और config xml:
<managed-bean>
<managed-bean-name>formabean</managed-bean-name>
<managed-bean-class>org.forma.formavar</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
BalusC जवाब सही है। ध्यान दें कि आपको एक तैनाती के बाद त्रुटि मिल रही है और संकलन के दौरान नहीं। मेरे लिए, यह इंगित करता है कि आपके पास अपाचे कॉमन्स डिस्कवरी जार है, लेकिन यह आपके एप्लिकेशन के साथ इसे तैनात नहीं कर रहा है। यदि आप एक युद्ध फ़ाइल बना रहे हैं, तो आप इसे अपने रनटाइम क्लासपाथ में/WEB-INF/lib निर्देशिका (युद्ध में) में रखकर खोज जार डाल सकते हैं। \t कॉमन्स की खोज \t \t 0,5 \t \t परीक्षण \t \t कॉमन्स की खोज –
DwB