Eclipse中导入Web项目报错,求解救!

robin_jh 2012-03-30 09:42:50
我在Eclipse中导入Web项目,在JSP文件中调用SCA服务,它的 sca-contribution.xml文件是

<?xml version="1.0" encoding="GBK"?>
<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
xmlns:Calculator="http://Calculator">
<deployable composite="Calculator:Calculator"/>
</contribution>

第一行出现警告:
Referenced file contains errors (http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd).
The errors below were detected when validating the file "oasis-200401-wss-wssecurity-secext-1.0.xsd" via the file "sca-contribution.xml". In most cases these errors can be detected by validating "oasis-200401-wss-wssecurity-secext-1.0.xsd" directly. However it is possible that errors will only occur when oasis-200401-wss-wssecurity-secext-1.0.xsd is validated in the context of sca-contribution.xml.

第三行报错:
cvc-elt.1: Cannot find the declaration of element 'contribution'.


它的JSP文件,calc.jsp 代码是:

<%@ page contentType="text/html;charset=GBK" language="java" %>
<%@ taglib uri="http://www.osoa.org/sca/sca_jsp.tld" prefix="sca" %>

<sca:reference name="CalculatorServiceComponent" type="server.Calculator" />

<html>
<head><title>访问计算器服务</title></head>

<body>
<table border="1" width="300">
<tr>
<th>表达式</th><th>结果</th>
</tr>
<tr>
<td>2 + 3 =</td><td><%= CalculatorServiceComponent.add(2, 3) %></td> 这里报错了
</tr>
<tr>
<td>3 - 2 =</td><td><%= CalculatorServiceComponent.subtract(3, 2) %></td> 这里报错了
</tr>
<tr>
<td>3 * 2 =</td><td><%= CalculatorServiceComponent.multiply(3, 2) %></td> 这里报错了
</tr>
<tr>
<td>3 / 2 =</td><td><%= CalculatorServiceComponent.divide(3, 2) %></td> 这里报错了
</tr>
</table>
</body>
</html>

在第三行出现警告:
Classpath entry org.eclipse.jdt.USER_LIBRARY/TUSCANY will not be exported or published. Runtime ClassNotFoundExceptions may result.

第15 18 21 24 行出现错误:
CalculatorServiceComponent cannot be resolved。

请教如何解决!!



...全文
943 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
梦途坚强 2012-07-11
  • 打赏
  • 举报
回复
如果你用的Tuscany2.x的版本,
xmlns="http://www.osoa.org/xmlns/sca/1.0"改成
xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
就ok了....

详情请见:https://cwiki.apache.org/confluence/display/TUSCANYxDOCx2x/Converting+Tuscany+1.x+Extensions
香蕉猪 2012-04-01
  • 打赏
  • 举报
回复
少包了吧。。
wumingguoke 2012-03-31
  • 打赏
  • 举报
回复
应该是缺少jar包吧,把jar包放进去就好了

58,452

社区成员

发帖
与我相关
我的任务
社区描述
Java Eclipse
社区管理员
  • Eclipse
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧