WSO2 AppServer v5.0.0无法找到InitialContext类?
我试图在新的WSO2 AppServer 5.0.0版上运行一个非常简单的应用程序,但似乎有一些非常奇怪的事情发生了。当我尝试访问执行简单JNDI查找的页面时,会出现以下错误:WSO2 AppServer v5.0.0无法找到InitialContext类?,wso2,Wso2,我试图在新的WSO2 AppServer 5.0.0版上运行一个非常简单的应用程序,但似乎有一些非常奇怪的事情发生了。当我尝试访问执行简单JNDI查找的页面时,会出现以下错误: HTTP Status 500 - org.apache.jasper.JasperException: Unable to compile class for JSP Generated servlet error: Only a type can be imported. javax.naming.Init
HTTP Status 500 - org.apache.jasper.JasperException: Unable to compile class for JSP Generated servlet error:
Only a type can be imported. javax.naming.InitialContext resolves to a package
An error occurred at line: 11 in the jsp file: /jndi.jsp
Generated servlet error: InitialContext cannot be resolved to a type
An error occurred at line: 11 in the jsp file: /jndi.jsp Generated servlet error:
InitialContext cannot be resolved to a type
该页面仅包含以下代码:
<!DOCTYPE html>
<%@page contentType="text/html" pageEncoding="ISO-8859-1"%>
<%@page import="javax.naming.InitialContext" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>JNDI Test</title>
</head>
<body>
<h1>JNDI Test</h1>
<%
InitialContext ctx = new InitialContext();
%>
<p>Context: <%= ctx.getNameInNamespace() %>
</body>
</html>
tomcat编译器似乎无法看到java运行时类,但我不知道为什么
任何帮助都将不胜感激。将jndi查找代码添加到单独的java类中,并从jsp页面调用它 虽然我能做到这一点,但如果没有充分的理由,我真的不想这么做。AFAIK上面的代码是符合JEE的,所以应该能够不改变地运行它。