Spring MVC appfuse应用程序在Eclipse中的错误。

时间:2023-01-19 10:45:30

I have build a Spring MVC multimodule app using Appfuse. It works fine when ran through MVN Jetty:run. I am able to build and run the app very well through maven. But When I imported all the modules in Eclipse through M2E it is giving me so many errors I am going to copy the errors here can someone please help me resolve them?

我已经用Appfuse构建了一个Spring MVC多模块应用程序。当运行MVN Jetty时,它运行良好:运行。通过maven,我能够很好地构建和运行应用程序。但是当我通过M2E导入Eclipse中的所有模块时它给了我很多错误我要复制错误这里有人能帮我解决吗?

I named my project as mynewproject when I built it using Appfuse.

当我使用Appfuse构建它时,我将我的项目命名为mynewproject。

1) I am getting below error :

1)我的错误如下:

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

javax.servlet.http超类”。在Java构建路径中没有找到HttpServlet。

in all the JSP files in base module "mynewproject".

在基本模块“mynewproject”中的所有JSP文件中。

2)I have issues with application-context-dao.xml

我对应用程序上下文-dao.xml有问题。

Multiple annotations found at this line: - schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/context/spring- context-3.1.xsd', because 1) could not find the document; 2) the document could not be read; the root element of the document is not . - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:annotation-config'.

在这一行找到的多个注释:- schema_reference。4:未能读取模式文档http://www.springframework.org/schema/context/springcontext -3.1。因为1)找不到文档;2)文件不能读取;文档的根元素不是。——cvc-complex-type.2.4。c:匹配的通配符是严格的,但是对于元素的上下文:annotationconfig,没有任何声明。

3) Multiple errors in applicationContextService.xml for AOP config and above mentioned error for context config again.

3)applicationContextService中的多个错误。xml的AOP配置和上面提到的错误的上下文配置。

4)Sample-data.xsd has content in some different language and it gives error :

4)采样数据。xsd有一些不同的语言的内容,它给出了错误:

Content is not allowed in prolog.

在prolog中不允许内容。

In module mynewproject-core I have following error in pom.xml

在模块mynewprojectcore中,我有如下错误。

Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:dbunit-maven-plugin:1.0-beta-3:operation (execution: test-compile, phase: test-compile)

不包括生命周期配置的插件执行:org.codehaus.mojo:dbunit-maven-plugin:1.0-beta-3:操作(执行:测试编译、阶段:测试编译)

And finally in mynewproject-web has an error :

最后,在mynewprojectweb上有一个错误:

Syntax error on token "ne", invalid AssignmentOperator

标记“ne”的语法错误,无效的赋值操作符。

for the line :

线:

Can someone please help with these errors.

有人能帮忙处理这些错误吗?

Thanks a ton in advance.

非常感谢你的帮助。

4 个解决方案

#1


0  

4)Sample-data.xsd has content in some different language and it gives error :

4)采样数据。xsd有一些不同的语言的内容,它给出了错误:

Content is not allowed in prolog.

在prolog中不允许内容。

I am not sure if you have resolved the problems, for this error, you can open the file on github and copy the content into your local file. The url is https://github.com/appfuse/appfuse/blob/34dc1599636e15ab9e0372d67542321e25f1896c/web/common/src/test/resources/sample-data.xsd. I am also trying to fix other errors. For this one,

我不确定您是否已经解决了问题,对于这个错误,您可以打开github上的文件并将内容复制到您的本地文件中。url是https://github.com/appfuse/appfuse/blob/34dc1599636e15ab9e0372d67542321e25f1896c/web/common/src/test/resources/sample-data.xsd。我也在尝试修正其他错误。为了这一个,

Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:dbunit-maven-plugin:1.0-beta-3:operation (execution: test-compile, phase: test-compile)

不包括生命周期配置的插件执行:org.codehaus.mojo:dbunit-maven-plugin:1.0-beta-3:操作(执行:测试编译、阶段:测试编译)

I fixed it by choosing "Mark ignore" by right clicking as a quick fix in Eclipse, that works for me for now.

我通过在Eclipse中右键单击“Mark ignore”来修复它,这对我现在很有用。

Syntax error on token "ne", invalid AssignmentOperator

标记“ne”的语法错误,无效的赋值操作符。

For this one, I modified it to another string and then use Maven to update project, and it is fixed.

对于这个,我将它修改为另一个字符串,然后使用Maven来更新项目,并且它是固定的。

I will update this answer once I find resolutions to other problems.

一旦我发现其他问题的解决方案,我会更新这个答案。

Hope that helps.

希望有帮助。

#2


0  

For the first error right click on project, click Properties. Select appropriate application server (Tomcat, vFabric, Glassfish, etc.) from Target Runtime.

对于第一个错误右键单击项目,单击“属性”。从目标运行时选择适当的应用程序服务器(Tomcat、vFabric、Glassfish等)。

#3


0  

I'd like to suggest some solutions that might help resolve all issues you're facing or whoever because I've faced the same issue before.

我想提出一些解决方案,可以帮助解决你所面临的所有问题,或者因为我之前遇到过同样的问题。

  1. "The superclass 'javax.servlet.http.HttpServlet' was not found on the Java Build Path..." issue.
    Since you said are using m2e plugin in you eclipse IDE and the web pom have already listed java.servlet as dependency, you should have that lib in your local repo when doing mvn jetty:run. Otherwise, in this case, I suggest you to perform maven update for web project. Just right-click on the project root and select Maven->Update Project. Make sure you have the Project->Build Automatically turn on, it should show some positive result.

    “超类javax.servlet.http。在Java构建路径上没有找到HttpServlet……因为您说的是在您的eclipse IDE中使用m2e插件,而web pom已经列出了java。servlet作为依赖项,在执行mvn jetty时,您应该在本地repo中拥有该lib:运行。否则,在本例中,我建议您为web项目执行maven更新。右键单击项目根并选择Maven->更新项目。确保你有项目->构建自动打开,它应该显示一些积极的结果。

  2. "application-context-dao.xml..." issue.
    if you're having "application-context-dao.xml" file, that means you probably have ran mvn appfuse:full-source. Based on your info, Eclipse IDE may have reported xml validation errors against "declared" XSDs. There are a few things you can do:

    “application-context-dao.xml…”问题。如果你有“application-context-dao。xml文件,这意味着您可能已经运行了mvn appfuse:full-source。根据您的信息,Eclipse IDE可能已经报告了针对“声明”xsd的xml验证错误。你可以做以下几件事:

    • Make sure your internet connection is good so that the XSDs can be referenced by the validation process.
    • 确保你的网络连接是好的,这样XSDs可以被验证过程引用。
    • Make sure all schemas pointed by in the xsi:schemaLocation are accessible and valid.
    • 确保在xsi中指出的所有模式:schemaLocation是可访问和有效的。
    • If all the above are good, make sure the xml entries are correct and well-formed. Then you may want to try to manually validate by right clicking on the document editing area and select "Validate".

    • 如果以上都是好的,请确保xml条目是正确的和格式良好的。然后,您可能希望通过右键单击文档编辑区域并选择“validate”来手动验证。
  3. "applicationContextService.xml for AOP config..." issue.
    You could apply the same as suggested in the previous issue.

    “applicationContextService。面向AOP配置的xml……您可以使用与前面的问题相同的方法。

  4. "Sample-data.xsd..." issue.
    Open up the same file in your favorite text editor, select-all, copy and paste replacing all them in same file in Eclipse IDE.

    “Sample-data.xsd…”问题。在您喜欢的文本编辑器中打开相同的文件,选择-all,复制和粘贴在Eclipse IDE中以相同的文件替换所有它们。

  5. "Plugin execution not covered by lifecycle configuration..." issue.
    Just wrap <plugins>..</plugins> with <pluginManagement>...</pluginManagement>

    “插件执行没有被生命周期配置所覆盖…”只是包装 <插件> . .< /插件>与< pluginManagement >…< / pluginManagement >

  6. "Syntax error on token 'ne', invalid AssignmentOperator..." issue.
    Replace them the with "!=" (without the quotes).

    “标记‘ne’,无效的赋值操作符…”的语法错误。用“!”代替他们!= "(没有引号)。

Hope that helps someone.

希望可以帮助别人。

#4


0  

Just few of the answers:

答案只有几个:

4. Sample-data.xsd has content...

4所示。采样数据。xsd内容…

It's seems to be bug of Eclipse. You can make 'workaround' for it if you open it in some text editor (not Eclipse), and change value of encoding from utf-a6 to utf-8, like this one:

这似乎是Eclipse的bug。如果您在某个文本编辑器(而不是Eclipse)中打开它,并将编码从utf-a6转换为utf-8,您可以对其进行“变通”,就像下面这样:

<?xml version="1.0" encoding="utf-8"?>

6. Syntax error on token "ne"...

6。符号“ne”的语法错误……

Also problem with Eclipse, it isn't AppFuse bug. Just try to change 'ne' operator with another equivalent which is != like on following:

Eclipse也有问题,它不是AppFuse bug。试着用另一个相等的值来改变“ne”运算符。

<c:if test="${pageContext.request.locale.language != 'en'}">

P.S. I've just seen that you've already solved the problem but it could be useful to someone else :)

附注:我刚刚看到你已经解决了这个问题,但它可能对其他人有用:)

#1


0  

4)Sample-data.xsd has content in some different language and it gives error :

4)采样数据。xsd有一些不同的语言的内容,它给出了错误:

Content is not allowed in prolog.

在prolog中不允许内容。

I am not sure if you have resolved the problems, for this error, you can open the file on github and copy the content into your local file. The url is https://github.com/appfuse/appfuse/blob/34dc1599636e15ab9e0372d67542321e25f1896c/web/common/src/test/resources/sample-data.xsd. I am also trying to fix other errors. For this one,

我不确定您是否已经解决了问题,对于这个错误,您可以打开github上的文件并将内容复制到您的本地文件中。url是https://github.com/appfuse/appfuse/blob/34dc1599636e15ab9e0372d67542321e25f1896c/web/common/src/test/resources/sample-data.xsd。我也在尝试修正其他错误。为了这一个,

Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:dbunit-maven-plugin:1.0-beta-3:operation (execution: test-compile, phase: test-compile)

不包括生命周期配置的插件执行:org.codehaus.mojo:dbunit-maven-plugin:1.0-beta-3:操作(执行:测试编译、阶段:测试编译)

I fixed it by choosing "Mark ignore" by right clicking as a quick fix in Eclipse, that works for me for now.

我通过在Eclipse中右键单击“Mark ignore”来修复它,这对我现在很有用。

Syntax error on token "ne", invalid AssignmentOperator

标记“ne”的语法错误,无效的赋值操作符。

For this one, I modified it to another string and then use Maven to update project, and it is fixed.

对于这个,我将它修改为另一个字符串,然后使用Maven来更新项目,并且它是固定的。

I will update this answer once I find resolutions to other problems.

一旦我发现其他问题的解决方案,我会更新这个答案。

Hope that helps.

希望有帮助。

#2


0  

For the first error right click on project, click Properties. Select appropriate application server (Tomcat, vFabric, Glassfish, etc.) from Target Runtime.

对于第一个错误右键单击项目,单击“属性”。从目标运行时选择适当的应用程序服务器(Tomcat、vFabric、Glassfish等)。

#3


0  

I'd like to suggest some solutions that might help resolve all issues you're facing or whoever because I've faced the same issue before.

我想提出一些解决方案,可以帮助解决你所面临的所有问题,或者因为我之前遇到过同样的问题。

  1. "The superclass 'javax.servlet.http.HttpServlet' was not found on the Java Build Path..." issue.
    Since you said are using m2e plugin in you eclipse IDE and the web pom have already listed java.servlet as dependency, you should have that lib in your local repo when doing mvn jetty:run. Otherwise, in this case, I suggest you to perform maven update for web project. Just right-click on the project root and select Maven->Update Project. Make sure you have the Project->Build Automatically turn on, it should show some positive result.

    “超类javax.servlet.http。在Java构建路径上没有找到HttpServlet……因为您说的是在您的eclipse IDE中使用m2e插件,而web pom已经列出了java。servlet作为依赖项,在执行mvn jetty时,您应该在本地repo中拥有该lib:运行。否则,在本例中,我建议您为web项目执行maven更新。右键单击项目根并选择Maven->更新项目。确保你有项目->构建自动打开,它应该显示一些积极的结果。

  2. "application-context-dao.xml..." issue.
    if you're having "application-context-dao.xml" file, that means you probably have ran mvn appfuse:full-source. Based on your info, Eclipse IDE may have reported xml validation errors against "declared" XSDs. There are a few things you can do:

    “application-context-dao.xml…”问题。如果你有“application-context-dao。xml文件,这意味着您可能已经运行了mvn appfuse:full-source。根据您的信息,Eclipse IDE可能已经报告了针对“声明”xsd的xml验证错误。你可以做以下几件事:

    • Make sure your internet connection is good so that the XSDs can be referenced by the validation process.
    • 确保你的网络连接是好的,这样XSDs可以被验证过程引用。
    • Make sure all schemas pointed by in the xsi:schemaLocation are accessible and valid.
    • 确保在xsi中指出的所有模式:schemaLocation是可访问和有效的。
    • If all the above are good, make sure the xml entries are correct and well-formed. Then you may want to try to manually validate by right clicking on the document editing area and select "Validate".

    • 如果以上都是好的,请确保xml条目是正确的和格式良好的。然后,您可能希望通过右键单击文档编辑区域并选择“validate”来手动验证。
  3. "applicationContextService.xml for AOP config..." issue.
    You could apply the same as suggested in the previous issue.

    “applicationContextService。面向AOP配置的xml……您可以使用与前面的问题相同的方法。

  4. "Sample-data.xsd..." issue.
    Open up the same file in your favorite text editor, select-all, copy and paste replacing all them in same file in Eclipse IDE.

    “Sample-data.xsd…”问题。在您喜欢的文本编辑器中打开相同的文件,选择-all,复制和粘贴在Eclipse IDE中以相同的文件替换所有它们。

  5. "Plugin execution not covered by lifecycle configuration..." issue.
    Just wrap <plugins>..</plugins> with <pluginManagement>...</pluginManagement>

    “插件执行没有被生命周期配置所覆盖…”只是包装 <插件> . .< /插件>与< pluginManagement >…< / pluginManagement >

  6. "Syntax error on token 'ne', invalid AssignmentOperator..." issue.
    Replace them the with "!=" (without the quotes).

    “标记‘ne’,无效的赋值操作符…”的语法错误。用“!”代替他们!= "(没有引号)。

Hope that helps someone.

希望可以帮助别人。

#4


0  

Just few of the answers:

答案只有几个:

4. Sample-data.xsd has content...

4所示。采样数据。xsd内容…

It's seems to be bug of Eclipse. You can make 'workaround' for it if you open it in some text editor (not Eclipse), and change value of encoding from utf-a6 to utf-8, like this one:

这似乎是Eclipse的bug。如果您在某个文本编辑器(而不是Eclipse)中打开它,并将编码从utf-a6转换为utf-8,您可以对其进行“变通”,就像下面这样:

<?xml version="1.0" encoding="utf-8"?>

6. Syntax error on token "ne"...

6。符号“ne”的语法错误……

Also problem with Eclipse, it isn't AppFuse bug. Just try to change 'ne' operator with another equivalent which is != like on following:

Eclipse也有问题,它不是AppFuse bug。试着用另一个相等的值来改变“ne”运算符。

<c:if test="${pageContext.request.locale.language != 'en'}">

P.S. I've just seen that you've already solved the problem but it could be useful to someone else :)

附注:我刚刚看到你已经解决了这个问题,但它可能对其他人有用:)