I am trying to connect to the ejb service in glassfish server through Java Web start.
I am getting the following error while getting the initial context. I have also added the code snippet for getting the initial context.
One interesting is when I run the program as a simple java program outside of java web start in a netbeans IDE, it is working fine.
I added all the relevant jar files from the glassfish modules folder into the java web start.
java.lang.NullPointerException
at com.sun.enterprise.naming.impl.SerialContext.<init>(SerialContext.java:275)
at com.sun.enterprise.naming.impl.SerialContext.<init>(SerialContext.java:334)
at com.sun.enterprise.naming.impl.SerialInitContextFactory.createInitialContext(SerialInitContextFactory.java:358)
at com.sun.enterprise.naming.impl.SerialInitContextFactory.getInitialContext(SerialInitContextFactory.java:353)
at com.sun.enterprise.naming.SerialInitContextFactory.getInitialContext(SerialInitContextFactory.java:69)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at gov.ca.lc.util.ServiceLocator.getInitialContext(ServiceLocator.java:140)
at gov.ca.lc.util.ServiceLocator.getVotesEJB(ServiceLocator.java:103)
at gov.ca.lc.scenemanagement.AbstractVotingScene.getCommitteeList(AbstractVotingScene.java:143)
at gov.ca.lc.scenemanagement.AbstractVotingScene.<init>(AbstractVotingScene.java:65)
at gov.ca.lc.scenes.MenuScene.<init>(MenuScene.java:56)
at gov.ca.lc.menu.StartVoting.startUp(StartVoting.java:47)
at org.mt4j.MTApplication.setup(MTApplication.java:328)
at processing.core.PApplet.handleDraw(PApplet.java:1580)
at processing.core.PApplet.run(PApplet.java:1502)
at java.lang.Thread.run(Unknown Source)
Exception in thread "Animation Thread" java.lang.NullPointerException
at gov.ca.lc.scenemanagement.AbstractVotingScene.getCommitteeList(AbstractVotingScene.java:143)
at gov.ca.lc.scenemanagement.AbstractVotingScene.<init>(AbstractVotingScene.java:65)
at gov.ca.lc.scenes.MenuScene.<init>(MenuScene.java:56)
at gov.ca.lc.menu.StartVoting.startUp(StartVoting.java:47)
at org.mt4j.MTApplication.setup(MTApplication.java:328)
at processing.core.PApplet.handleDraw(PApplet.java:1580)
at processing.core.PApplet.run(PApplet.java:1502)
at java.lang.Thread.run(Unknown Source)
Following is my code to get the initial context
private static InitialContext getInitialContext()
throws NamingException {
Properties props = null;
try{
// props=new Properties();
// props.load(new FileInputStream(new File("jndi.properties")));
// System.out.println(props.get("java.naming.factory.initial"));
props=new Properties();
props.setProperty("java.naming.factory.initial","com.sun.enterprise.naming.SerialInitContextFactory");
props.setProperty("java.naming.factory.url.pkgs ", "com.sun.enterprise.naming");//ur server ip
props.setProperty("java.naming.factory.state ", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");//ur server ip
props.setProperty("org.omg.CORBA.ORBInitialHost", "165.107.33.181");//ur server ip
props.setProperty("org.omg.CORBA.ORBInitialPort","3700"); //default is 3700
}catch(Exception ex){
ex.printStackTrace();
}
return new InitialContext(props);
}
I have the same problem. I use JMS and I need to add other jars. At first I tried using gf-client.jar, but it does not work through Java Web start. So I've added jars listed in
Connecting a remote JMS client to GlassFish 3 . It works outside of Java Web start.
I don't know what the relevant jar files are for you, but just in case we have a different view on that area: I use just appserv-rt.jar and java-ee.jar using the same properties you use for initial context and it works fine. Don't add anything else you don't need and try again.
package-appclient in glassfish/bin creates appclient.jar that include jars for client. Then unpack it on a client and use gf-client.jar as usual.
I would like to add that all these set up will work only if you have the glassfish installed in your machine. If you deploy the java webstart app in a machine which doesn't have the glassfish server then we will end up getting the same exception. The reason is that if you open the appserv-rt.jar it points to the gf-client.jar and if you look into the gf-client.jar it points to a whole bunch of jar files in modules folder. So I suppose, essentially we need the all the jar files pointed by the gf-client.jar.
Related
When I try to run my project on my local Tomcat server, I get the error:
Server Tomcat v7.0 Server at localhost failed to start.
I followed the advice in this Stackoverflow answer and deleted the folder tmp0. but I still get the same error.
I've copied the stack trace below.
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base C:\Users\Imray\Projects\InstrurentalApp\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\instrurentalapp does not exist or is not a readable directory
at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:136)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:5089)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Did you notice this line:
java.lang.IllegalArgumentException: Document base C:\Users\Imray\Projects\
InstrurentalApp\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\
wtpwebapps\instrurentalapp does not exist or is not a readable directory
The message is clearly saying that either that directory does not exist, or that the Tomcat server does not have read access to it. And if you deleted it ... that might explain why it doesn't exist!
Actually, the pathname is very suspicious to me. It looks like a path to something in your development sandbox, and a deployed webapp (running in Tomcat) should not depend on such things. (You shouldn't have that kind of stuff on your production server!) That may be the root cause of your problems; i.e. you have neglected to put your resources into your WAR file and update your configuration files accordingly.
Try these 3 methods
1) try deleting the .snap file found in
yourprojectworkspace.metadata.plugins\org.eclipse.core.resources
2) The most common hiccup is when another web server (or any process for that matter) has laid claim to port 8080. This is the default HTTP port that Tomcat attempts to bind to at startup. To change this, open the file:
$CATALINA_HOME/conf/server.xml
and search for '8080'. Change it to a port that isn't in use, and is greater than 1024, as ports less than or equal to 1024 require superuser access to bind under UNIX. (Example 8181)
Restart Tomcat and you're in business. Be sure that you replace the "8080" in the URL you're using to access Tomcat. For example, if you change the port to 8181, you would request the URL http://localhost:8181/ in your browser.
3) Open the bin folder which contains the shutdown.bat file residing inside the tomcat directory. Run it, that should solve the port problem.
Just Change the port no, So you can solve this problem..
Take different port for
1. Tomcat Admin port: 8079
2. Http Port : 99
3. Ajp port : 8078
Check your web.xml file
and make correction in url-pattern and servlet-class or any syntax error, and run project.
Go on the server link (which is synchronized with the servlets) shown into the server console.
Expand the the link.
unsynchronize the synchronized servlets.
Right click on the server link.
Click on publish.
Then start the server again.
Hope it will work. :D
Go to Server tab in Eclipse where you configured Server and right click on server and select clean. after that restart server. It Works
I am new in Apache ofbiz.i have downloaded and configured it with ant.Its running locally now in my machine.
"https://localhost:8443/catalog/control/main" its my local URL.
Now i am trying to configure with eclipse.But after importing this to eclipse i have done run Ant in build Xml.Then i have gone to debug configuration,i right click on java remote application new ofbiz,now the parametrs are connection type-->Standered(socket attach),
Host-->localhost,port-->8443.But when i am clicking on the debug button,its showing the error.I am getting this error.
Start.java using configuration file org/ofbiz/base/start/start.properties
Set OFBIZ_HOME to - C:/apache-ofbiz-11.04.04
Admin socket not configured; set to port 0
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.ofbiz.base.util.Debug.<clinit>(Debug.java:86)
at org.ofbiz.base.container.ContainerLoader.load(ContainerLoader.java:78)
at org.ofbiz.base.start.Start.initStartLoaders(Start.java:169)
at org.ofbiz.base.start.Start.init(Start.java:139)
at org.ofbiz.base.start.Start.main(Start.java:69)
Caused by: java.util.MissingResourceException: Can't find bundle for base name cache, locale en
at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
at java.util.ResourceBundle.getBundleImpl(Unknown Source)
at java.util.ResourceBundle.getBundle(Unknown Source)
at org.ofbiz.base.util.cache.UtilCache.setPropertiesParams(UtilCache.java:212)
at org.ofbiz.base.util.cache.UtilCache.setPropertiesParams(UtilCache.java:208)
at org.ofbiz.base.util.cache.UtilCache.<init>(UtilCache.java:138)
at org.ofbiz.base.util.cache.UtilCache.createUtilCache(UtilCache.java:1015)
at org.ofbiz.base.util.UtilProperties.<clinit>(UtilProperties.java:71)
... 5 more
remote debug not using your HTTP port, need using JPDA port
add parameter to your command -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8091 -jar ofbiz.jar
see https://cwiki.apache.org/confluence/display/OFBIZ/Running+and+Debugging+OFBiz+in+Eclipse
This happens due to classpath settings in your ‘run configuration’:
- I resolved this error by removing the entry ‘ofbiz(default classpath)’ for 'User Entries' in ‘classpath’ tab in ‘run configuration’ for ofbiz, and replacing it with ofbiz.jar.
In other words :
Go to 'classpath' tab in 'run configuration' for ofbiz.
Remove existing 'ofbiz(default classpath)' entry in 'User Entries' and replace it with 'ofbiz.jar' from your ofbiz folder.
I want to basically upgrade my tomcat version(on RHEL).
Always worked in an environment where my war file would be dumped into */webapps, on restart of tomcat, the war file would expand and the rest is history.
Now, the system I'm working on, has completely different folder structure.
Something like this:
[root#bliss ~]# ls /usr/local/blah/blu-app/WEB-INF/
accounts faces-reports.xml logging.properties web-app_2_3.dtd
bin faces-syscfg.xml logging.properties-production web-app_2_4.xsd
buildnum.txt framework2007 perl web.xml
classes host.xsd settings work
deploy-root java.policy tags
events.xsd lib tld
[root#bliss ~]#
I can see some tomcat related jars here:
/usr/local/blah/blu-app/WEB-INF/lib/tomcat-http.jar
/usr/local/blah/blu-app/WEB-INF/lib/tomcat-util.jar
/usr/local/blah/blu-app/WEB-INF/lib/tomcat-coyote.jar
UPDATE
So I did find out that the tomcat is embedded 'cuz I found the following code starting it:
tomcat = new Embedded();
tomcat.setCatalinaHome(targetPath);
Host host = tomcat.createHost("localhost", targetPath);
Context rootCtx = tomcat.createContext("", targetPath);
((StandardContext)rootCtx).setWorkDir("WEB-INF/work");
ServletContext servletContext = rootCtx.getServletContext();
servletContext.setAttribute("version", version);
ApplRealm realm = new ApplRealm(servletContext);
tomcat.setRealm(realm);
rootCtx.setPrivileged(true);
Engine engine = tomcat.createEngine();
engine.setName("tomcat");
engine.setDefaultHost("localhost");
host.addChild(rootCtx);
engine.addChild(host);
tomcat.addEngine(engine);
LOG.debug("starting tomcat");
tomcat.start();
LOG.debug("tomcat started");
// clear out any old sessions: see bug 17882
Session[] sessions = rootCtx.getManager().findSessions();
for (int i = 0; i < sessions.length; i++)
{
sessions[i].expire();
}
ServerSocket socket = null;
socket = new ServerSocket(CmcUtils.getControlPort(), 2, InetAddress.getByName("127.0.0.1"));
socket.accept();
LOG.info("Received shutdown command. Exiting !");
tomcat.stop();
The question then is, how do I upgrade this tomcat to say Tomcat6?
Replace with the latest jars in WEB-INF/lib? Which all jars?
It depends. It could be an embedded tomcat but it could also be a heavily customised tomcat configuration.
Check the startup script to determine which class is being invoked. If its the usual catalina its not embedded its just that they changed the config to point to another folder instead of webapps.
If it is indeed embedded then to upgrade u would need to replace the tomcat jars with new ones.
In tomcat we can create virtual hosts,i.e, making tomcat recognize application's which are deployed in external folders.
A lot more information can be found here.
http://tomcat.apache.org/tomcat-5.5-doc/config/host.html
In your given scenario, try to lookup in server.xml, which is usually found in conf folder of tomcat home.
I have a program that is supposed to send a file to a web service, which requires an SSL connection. I run the program as follows:
SET JAVA_HOME=C:\Program Files\Java\jre1.6.0_07
SET com.ibm.SSL.ConfigURL=ssl.client.props
"%JAVA_HOME%\bin\java" -cp ".;Test.jar" ca.mypackage.Main
This was works fine, but when I change the first line to
SET JAVA_HOME=C:\Program Files\IBM\SDP\runtimes\base_v7\java\jre
I get the following error:
com.sun.xml.internal.ws.client.ClientTransportException: HTTP transport error: java.net.SocketException: java.lang.ClassNotFoundException: Cannot find the specified class com.ibm.websphere.ssl.protocol.SSLSocketFactory
at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.getOutput(HttpClientTransport.java:119)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:140)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:86)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:593)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:552)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:537)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:434)
at com.sun.xml.internal.ws.client.Stub.process(Stub.java:247)
at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(SEIStub.java:132)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:242)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:222)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:115)
at $Proxy26.fileSubmit(Unknown Source)
at com.testing.TestingSoapProxy.fileSubmit(TestingSoapProxy.java:81)
at ca.mypackage.Main.main(Main.java:63)
Caused by: java.net.SocketException: java.lang.ClassNotFoundException: Cannot find the specified class com.ibm.websphere.ssl.protocol.SSLSocketFactory
at javax.net.ssl.DefaultSSLSocketFactory.a(SSLSocketFactory.java:7)
at javax.net.ssl.DefaultSSLSocketFactory.createSocket(SSLSocketFactory.java:1)
at com.ibm.net.ssl.www2.protocol.https.c.afterConnect(c.java:110)
at com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:14)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:902)
at com.ibm.net.ssl.www2.protocol.https.b.getOutputStream(b.java:86)
at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.getOutput(HttpClientTransport.java:107)
... 14 more
Caused by: java.lang.ClassNotFoundException: Cannot find the specified class com.ibm.websphere.ssl.protocol.SSLSocketFactory
at javax.net.ssl.SSLJsseUtil.b(SSLJsseUtil.java:20)
at javax.net.ssl.SSLSocketFactory.getDefault(SSLSocketFactory.java:36)
at javax.net.ssl.HttpsURLConnection.getDefaultSSLSocketFactory(HttpsURLConnection.java:16)
at javax.net.ssl.HttpsURLConnection.<init>(HttpsURLConnection.java:36)
at com.ibm.net.ssl.www2.protocol.https.b.<init>(b.java:1)
at com.ibm.net.ssl.www2.protocol.https.Handler.openConnection(Handler.java:11)
at java.net.URL.openConnection(URL.java:995)
at com.sun.xml.internal.ws.api.EndpointAddress.openConnection(EndpointAddress.java:206)
at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.createHttpConnection(HttpClientTransport.java:277)
at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.getOutput(HttpClientTransport.java:103)
... 14 more
So it seems that this problem would be related to the JRE I'm using, but what doesn't seem to make sense is that the non-IBM JRE works fine, but the IBM JRE does not. Any ideas, or suggestions?
Try adding these two lines somewhere in your setup code:
Security.setProperty("ssl.SocketFactory.provider", "com.ibm.jsse2.SSLSocketFactoryImpl");
Security.setProperty("ssl.ServerSocketFactory.provider", "com.ibm.jsse2.SSLServerSocketFactoryImpl");
Java only allows one SSL connection factory class for a JVM. If you are using a JDK thats shipped with WebSphere Application Server v6x/7x/8x or any other WebSphere server tools in Rational Application Developer, then those require IBM ( com.ibm.websphere.ssl.protocol.SSLSocketFactory ) specific class from WebSphere Application Server runtime.
because the java security file has the JSSE socket factories set like below
# Default JSSE socket factories
#ssl.SocketFactory.provider=com.ibm.jsse2.SSLSocketFactoryImpl
#ssl.ServerSocketFactory.provider=com.ibm.jsse2.SSLServerSocketFactoryImpl
# WebSphere socket factories (in cryptosf.jar)
ssl.SocketFactory.provider=com.ibm.websphere.ssl.protocol.SSLSocketFactory
ssl.ServerSocketFactory.provider=com.ibm.websphere.ssl.protocol.SSLServerSocketFactory
So, If you uncomment the Default JSSE Socket factories and comment out the WebSphere ones then WAS is going to puke.
Better work around would be to have com.ibm.ws.security.crypto.jar file in your class path. This jar file has a dependency on com.ibm.ffdc.jar file so you need that in your class path well. Both these jarfiles are available under <WebSphere_Install_Dirctory>/plugins/
If your non IBM jre is sun, then it already comes with SSL classes implementation packaged along with it.
It seems the IBM jre is not containing SSL implementation classes at all.
One more "solution" which seems to be working for me. Create your own security properties file, my.java.security with contents like:
ssl.SocketFactory.provider=
ssl.ServerSocketFactory.provider=
When calling Java (or in my case maven), add the command line option:
-Djava.security.properties=C:\myfiles\my.java.security
Cribbed from the IBM Liberty documentation: http://www-01.ibm.com/support/knowledgecenter/was_beta_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/rwlp_trouble.html?lang=en
one may set these properties at WAS_HOME/*/java/jre/lib/security/java.security file by uncomenting the following JSSE props.
Default JSSE socket factories
ssl.SocketFactory.provider=com.ibm.jsse2.SSLSocketFactoryImpl
ssl.ServerSocketFactory.provider=com.ibm.jsse2.SSLServerSocketFactoryImpl
Found this topic while searching for the same error message but found a different solution.
To test a https REST service using the Apache Wink client:
ClientConfig config = new ClientConfig();
config.setBypassHostnameVerification(true);
RestClient client = new RestClient(config);
And set the Factory's empty:
Security.setProperty("ssl.SocketFactory.provider", "");
Security.setProperty("ssl.ServerSocketFactory.provider", "");
My runtime is a standalone Camel test using IBM JRE 1.7 from IBM WebSphere v8.5.5.
I had a similar issue when my Batch application was trying to fetch data from Restful web service using Apache wink. I was using MyEclipse as my dev environment. And was using the jre provided by IBM webSphere 8.5. When I changed to Sun 1.6 jre, the issue got resolved.
When I try to connect Weblogic t3s protocol in Solaris Server, it shows this error:
java.lang.IllegalStateException: Not enough cryptography available to enable a cipher suite!
at com.certicom.tls.interfaceimpl.TLSSystem.resetCipherSuiteSupport(Unknown Source)
at com.certicom.tls.interfaceimpl.TLSSystem.setCertificateSupport(Unknown Source)
at com.certicom.tls.interfaceimpl.TLSSystem.<init>(Unknown Source)
at com.certicom.tls.interfaceimpl.TLSSystem.<init>(Unknown Source)
at com.certicom.net.ssl.SSLContext.<init>(Unknown Source)
at com.bea.sslplus.CerticomSSLContext.<init>(Unknown Source)
at sun.reflect.GeneratedConstructorAccessor6.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at weblogic.security.utils.SSLSetup.getSSLDelegateInstance(SSLSetup.java:122)
at weblogic.security.utils.SSLContextWrapper.<init>(SSLContextWrapper.java:48)
at weblogic.security.utils.SSLContextWrapper.getInstance(SSLContextWrapper.java:43)
at weblogic.security.utils.SSLSetup.getSSLContext(SSLSetup.java:238)
at weblogic.security.SSL.SSLClientInfo.getSSLSocketFactory(SSLClientInfo.java:101)
at weblogic.socket.ChannelSSLSocketFactory.getSocketFactory(ChannelSSLSocketFactory.java:170)
at weblogic.socket.ChannelSSLSocketFactory.createSocket(ChannelSSLSocketFactory.java:77)
at weblogic.socket.ChannelSSLSocketFactory.createSocket(ChannelSSLSocketFactory.java:114)
at weblogic.socket.BaseAbstractMuxableSocket.createSocket(BaseAbstractMuxableSocket.java:133)
at weblogic.rjvm.t3.MuxableSocketT3.newSocketWithRetry(MuxableSocketT3.java:206)
at weblogic.rjvm.t3.MuxableSocketT3.connect(MuxableSocketT3.java:375)
at weblogic.rjvm.t3.ConnectionFactoryT3S.createConnection(ConnectionFactoryT3S.java:34)
at weblogic.rjvm.ConnectionManager.createConnection(ConnectionManager.java:1773)
at weblogic.rjvm.ConnectionManager.findOrCreateConnection(ConnectionManager.java:1416)
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:437)
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:315)
at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:251)
at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:194)
at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:238)
at weblogic.rjvm.RJVMFinder.findOrCreateInternal(RJVMFinder.java:200)
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:170)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:153)
at weblogic.jndi.WLInitialContextFactoryDelegate$1.run(WLInitialContextFactoryDelegate.java:344)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:339)
at weblogic.jndi.Environment.getContext(Environment.java:315)
at weblogic.jndi.Environment.getContext(Environment.java:285)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:197)
I have define the following parameters:
-Djava.protocol.handler.pkgs=weblogic.net -Dweblogic.security.SSL.ignoreHostnameVerification=true -Dweblogic.security.TrustKeyStore=CustomTrust -Dweblogic.security.CustomTrustKeyStoreType=JKS -Dweblogic.security.CustomTrustKeyStoreFileName=keystore -Dweblogic.security.CustomTrustKeyStorePassPhrase=passphrase -Dssl.debug=true -Dweblogic.StdoutDebugEnabled=true
How can I fix it? Same source and same parameters is working in Windows.
Thank You.
This solution comes a bit late in the day, but is meant for others having the same problem.
Apparently, the accepted solution of adding webserviceclient+ssl.jar to the classpath works, since the WebLogic Full Client - wlfullclient.jar has references to other JARs in its MANIFEST.MF file. Adding the webservices client JAR resolves the issue, since it appears to have the minimum set of classes required for correct operation of the client when using SSL/TLS. The error is usually encountered when copies of the wlfullclient.jar and wlcipher.jar are made in a different directory, and added to the classpath. The JVM then fails to load other dependent classes from JARs that are referenced from within the MANIFEST file.
The actual solution would be to add the wlfullclient.jar that is generated in the WL_HOME\server\lib directory, to the CLASSPATH. All other dependent JARs would then be picked up via the appropriate classloader, since the manifest references these via relative directory paths.
Are you using the same JVM vendor on both machines?
Most likely the CA used to generate the keystore is available on the Windows truststore but not available on Solaris, the assumption being the keystore was generated in Windows and the CA is not yet shipped with the JRE being used on Solaris. The differences are discussed here.
How to configure the truststore to add a CA
Finally, We got the solution.
Just add webserviceclient+ssl.jar to your classpath will solve the problem.
webserviceclient+ssl.jar not included in wlfullclient.jar.
Are you sure that you keystore file is picked up? Maybe try to use an absolute path when specifying the -Dweblogic.security.CustomTrustKeyStoreFileName option.
Also, are the classpath of the JMS client really identical in both environments?
Try to provide wlserver_10.3/server/lib/wlfullclient.jar (that you create by running the command java -jar wljarbuilder.jar) and wlserver_10.3/server/lib/wlcipher.jar (yeah, wlfullclient.jar is not that full!) on the classpath.
This has been simplified for 10.3.4 and above Weblogic.
Just add the wlthint3client.jar from the /server/lib directory to your client's Classpath
I've only confirmed this works for ejb communication but the docs state
This release supports the following:
Oracle WebLogic's T3/T3S protocol for Remote Method Invocation (RMI), including RMI over HTTP (HTTP tunneling). For more information on WebLogic T3 communication, see "Using WebLogic RMI with T3 Protocol" in Programming RMI for Oracle WebLogic Server.
Access to JMS, JMX, JNDI, and EJB resources available in WebLogic Server.
http://docs.oracle.com/cd/E17904_01/web.1111/e13717/wlthint3client.htm