开发者

Remote EJB: The trustAnchors parameter must be non-empty

开发者 https://www.devze.com 2023-04-11 21:04 出处:网络
I want to invoke a remote ejb (hosted on glassfish) but I\'ve got the following exception: java.lang.RuntimeException: com.sun.jersey.api.client.ClientHandlerException: javax.net.ssl.SSLException: ja

I want to invoke a remote ejb (hosted on glassfish) but I've got the following exception:

java.lang.RuntimeException: com.sun.jersey.api.client.ClientHandlerException: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error开发者_高级运维: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at be.stijn.mz.io.FileSystemReader.readMovieDirectory(FileSystemReader.java:23)
at be.stijn.mz.IndexingService.index(IndexingService.java:22)
at be.stijn.mz.IndexingServiceIntegrationTest.index(IndexingServiceIntegrationTest.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
  ...

I'm using the following code:

public PersisterLink() {
    try {
        Context ctx = getInitialContext();
        movieBean = (MovieBean) ctx.lookup("RemoteMovieBean");
    } catch (Exception e) {
        throw new PersisterLinkException(e);
    }
}

private Context getInitialContext() throws NamingException, FileNotFoundException, IOException {
    Properties p = new Properties();
    InputStream stream = PersisterLink.class.getResourceAsStream("../../../../jndi.properties");
    p.load(stream);
    return new InitialContext(p);
}

And these are my jndi.properties:

java.naming.factory.initial = com.sun.enterprise.naming.SerialInitContextFactory
java.naming.factory.url.pkgs = com.sun.enterprise.naming
java.naming.factory.state = com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl
#optional.  Defaults to localhost.  Only needed if web server is running
#on a different host than the appserver
org.omg.CORBA.ORBInitialHost = localhost
#optional.  Defaults to 3700.  Only needed if target orb port is not 3700.
org.omg.CORBA.ORBInitialPort = 3700

And I have this dependency in my pom:

<dependency>
    <groupId>org.glassfish.appclient</groupId>
    <artifactId>gf-client</artifactId>
    <version>3.1</version>
    <type>pom</type>
    <scope>compile</scope>
</dependency>

I hope somebody can help me, because I'm struggling with this for some time.


This obscure message really means that the truststore you specified could not be opened.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号