小编Gop*_*pal的帖子

编译错误,包javax.ws.rs不存在,依赖关系无法从maven解析

我已经提到了pom文件中的依赖库,也存在库系统路径,但是在使用maven clean install -e -X编译期间,它会抛出错误,说包不存在.

**[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/gopc/workspace/RestfulService/src/restfu/Hello.java:[4,19] C:\Users\gopc\workspace\RestfulService\src\restfu\Hello.java:4: package javax.ws.rs does not exist
[ERROR] /C:/Users/gopc/workspace/RestfulService/src/restfu/Hello.java:[5,19] C:\Users\gopc\workspace\RestfulService\src\restfu\Hello.java:5: package javax.ws.rs does not exist
[ERROR] /C:/Users/gopc/workspace/RestfulService/src/restfu/Hello.java:[6,19] C:\Users\gopc\workspace\RestfulService\src\restfu\Hello.java:6: package javax.ws.rs does not exist
[ERROR] /C:/Users/gopc/workspace/RestfulService/src/restfu/Hello.java:[8,1] C:\Users\gopc\workspace\RestfulService\src\restfu\Hello.java:8: package javax.ws.rs.core does not exist
[ERROR] /C:/Users/gopc/workspace/RestfulService/src/restfu/Hello.java:[21,2] C:\Users\gopc\workspace\RestfulService\src\restfu\Hello.java:21: cannot find symbol
symbol: class Path**
Run Code Online (Sandbox Code Playgroud)

POM文件

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>RestfulService</groupId>
  <artifactId>RestfulService</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <build>
    <sourceDirectory>${basedir}/src</sourceDirectory>
    <outputDirectory>${basedir}/build/classes</outputDirectory>
  <pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.0</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
</pluginManagement> …
Run Code Online (Sandbox Code Playgroud)

maven

16
推荐指数
3
解决办法
5万
查看次数

使用maven的编译错误:-source 1.3中不支持"注释"

我使用Eclipse创建了一个Restful Web服务简单项目.当我尝试编译它时,我收到以下错误.

不确定为什么不支持注释,我使用NetBeans IDE做了同样的
事情,并且它没有任何问题.

**[INFO] Compilation failure
C:\Users\gopc\workspace\RestfulService\src\restfu\Hello.java:[18,1] error: annotations are not supported in -source 1.3
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.BuildFailureException: Compilation failure
C:\Users\gopc\workspace\RestfulService\src\restfu\Hello.java:[18,1] error: annotations are not supported in -source 1.3
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:715)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
C:\Users\gopc\workspace\RestfulService\src\restfu\Hello.java:[18,1] error: annotations are not …
Run Code Online (Sandbox Code Playgroud)

rest maven

5
推荐指数
2
解决办法
7247
查看次数

实际函数调用计数与 EXPECT_CALL(*mock, display()) 不匹配

我正在调用EXPECT_CALL一个模拟函数display(),但它返回运行时错误

Actual function call count doesn't match EXPECT_CALL(*mock, display())...

输出

./GTest_static_example.tst

[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from GTest_static_example
[ RUN      ] GTest_static_example.case1
inside the GTEST_static_class:: display
display called from GTest_static_example
package/web/webscr/GTest_static_example.cpp:70: Failure
Actual function call count doesn't match EXPECT_CALL(*mock, display())...
         Expected: to be called once
           Actual: never called - unsatisfied and active
[  FAILED  ] GTest_static_example.case1 (0 ms)
[----------] 1 test from GTest_static_example (0 ms …
Run Code Online (Sandbox Code Playgroud)

c++ googletest googlemock

2
推荐指数
1
解决办法
2万
查看次数

将 Spring boot 服务器和 Angular CLI 应用程序集成到单个可执行文件中

我设计了一个解决方案,其中 Spring Boot 应用程序包含 websocket 功能,从客户端接收套接字连接,并使用来自 Angular CLI 应用程序的 REST API 调用。

现在 Spring boot 单独运行,而 Angular CLI 单独执行(npm start)。

任何想法我都可以将两者集成到一个可执行文件中,例如 dist war 或其他东西,以便我可以启动并运行两者..

spring-boot angular

2
推荐指数
1
解决办法
1566
查看次数

javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径构建失败

我正在使用java应用程序检查url connrectivity,对于一些url(内部)应用程序url,我得到200(成功),对于其他我得到以下异常.

但如果我手动连接到下面的网址,没有问题,我需要pki证书.需要你的帮助.

URL链接响应代码(200),很好

http://pns15a-0215.corpny.com:21212/Mngr 200 OK OK

URL链接响应异常

https://tantex.intra.net/Mngr/

异常消息:sun.security.validator.ValidatorException:PKIX路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到所请求目标的有效证书路径

日志

javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法在sun.security.ssl.Alerts.getSSLException中找到所请求目标的有效证书路径(Alerts.java:192)sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1884)at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:276)at sun.security.ssl.Handshaker. fatalSE(Handshaker.java:270)at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1341)at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:153)

程序源代码

        log.info("testing the httpurlconnection for url:" + strUrl );

            url = new URL(strUrl);
            urlConn = (HttpURLConnection) url.openConnection();
            urlConn.connect();

            if (urlConn.getResponseCode() == HttpURLConnection.HTTP_OK )
            {
                log.info("url http connection is sucessfull");

                //append the response status
                urlResponseStatus = "OK";
            }
            else
            {
                log.info("url http connection failure, response code:" +  urlConn.getResponseCode());

                //append the response status
                urlResponseStatus = "NOT OK";
            }

            urlResponseCode = urlConn.getResponseCode();
            urlResponseMessage =  urlConn.getResponseMessage();
Run Code Online (Sandbox Code Playgroud)

java

1
推荐指数
1
解决办法
3万
查看次数

标签 统计

maven ×2

angular ×1

c++ ×1

googlemock ×1

googletest ×1

java ×1

rest ×1

spring-boot ×1