我有这个 Servlet,它也包含它的构造函数,但是当我尝试在 Weblogic 服务器上运行我的应用程序时,它给了我一个错误,即“SocialMediaSessionHandler”没有默认构造函数。该应用程序在其他平台上运行良好,但是当我在服务器之间切换时出现错误:实例化 servlet 时发生错误:“SocialMediaSessionHandler”。
public class SocialMediaSessionHandler extends HttpServlet {
private static final long serialVersionUID = 1L;
HttpSession session = null;
private static final CDLoggerInterface log = CDLogger
.getLogger(SocialMediaSessionHandler.class);
Resource resource = new ClassPathResource("/fp.properties");
private boolean debugEnabled;
String serverUrl = "";
IWebServiceManager webServiceManager;
Utility util = null;
/**
* @see HttpServlet#HttpServlet()
*/
public SocialMediaSessionHandler() {
util = new Utility();
// TODO Auto-generated constructor stub
try {
ApplicationContext context = LoadSpringManageService
.LoadApplicationContext();
webServiceManager = (IWebServiceManager) context
.getBean("webserviceManager");
Properties props = PropertiesLoaderUtils.loadProperties(resource);
if (props.getProperty("debug.enable") != null
&& props.getProperty("debug.enable") != "")
debugEnabled = Boolean.parseBoolean(props
.getProperty("debug.enable"));
if (props.getProperty("server.url") != null
&& props.getProperty("server.url") != "")
serverUrl = props.getProperty("server.url");
} catch (MalformedURLException e) {
log.error("MalformedURLException occured.....", e);
} catch (Exception e) {
log.error("Problem in loading CD Logger properties file", e);
}
}