开发者社区> 问答> 正文

javaweb项目演示编译报错,如何解决??报错

springmvc项目,本地运行没问题,在osc上项目演示就不行,看了日志编译报错如下:

  1. NFO] --- maven-resources-plugin:2.6:resources (default-resources) @ zpxmaven ---

  2. WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!

  3. INFO] Copying 3 resources

  4. INFO]

  5. INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ zpxmaven ---

  6. INFO] Changes detected - recompiling the module!

  7. WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!

  8. INFO] Compiling 17 source files to /var/vcap/store/fss_backend1/0a97950a-a3dd-4c4b-aa17-e008dd45bab0/9b056079-65cb-4a23-bacb-4d8f5ffd7ff3/haoduolang/management-system/zpxmaven/target/classes

  9. INFO] -------------------------------------------------------------

  10. ERROR] COMPILATION ERROR :

  11. INFO] -------------------------------------------------------------

  12. ERROR] /var/vcap/store/fss_backend1/0a97950a-a3dd-4c4b-aa17-e008dd45bab0/9b056079-65cb-4a23-bacb-4d8f5ffd7ff3/haoduolang/management-system/zpxmaven/src/main/java/zpx/model/ComAttachment.java:[13,47] cannot find symbolnsymbol : class Statusnlocation: package com.sun.org.apache.xerces.internal.util

  13. ERROR] /var/vcap/store/fss_backend1/0a97950a-a3dd-4c4b-aa17-e008dd45bab0/9b056079-65cb-4a23-bacb-4d8f5ffd7ff3/haoduolang/management-system/zpxmaven/src/main/java/zpx/model/FtpAttachment.java:[13,47] cannot find symbolnsymbol : class Statusnlocation: package com.sun.org.apache.xerces.internal.util

  14. INFO] 2 errors

本人是新手,刚学maven,忘各位大神给指一条明路

展开
收起
爱吃鱼的程序员 2020-06-14 16:55:07 708 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB
    <plugin><artifactId>maven-compiler-plugin</artifactId><version>2.3.2</version><configuration><source>1.7</source><target>1.7</target><encoding>UTF-8</encoding></configuration></plugin>

    source和target指定为你项目用的jdk版本


    回复 @Shawock:各种404。。。明天再搞吧,谢谢你的耐心回复哈 @Shawock http://git.oschina.net/haoduolang/management-system回复 @宿命panthers:说明项目war包没有上去呗回复 @宿命panthers:求分享地址。。 @Shawock嗯。。就是oschina的项目演示那个平台莫非使用了SUN专用的API?回复 @宿命panthers:因为出现了这个【packagecom.sun.org.apache.xerces.internal.util】所以有那个推测没有吧。。。问题解决了,最初原因是引用了jdk废弃的包,后来404报错是因为项目中hibernate3,而maven中我没有找到hibernate3在pom.xml中的配置,本地的话可以自己向本地仓库导入jar包,但在oschina我就没办法了,只能改用hibernate4了,hibernate3和4使用配置有少许的不同,有该问题的搜下很容易就找到了
    2020-06-14 16:55:22
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载