Issue connecting to Websphere application server from local machine - websphere

I'm trying to connect to IBM WAS from local machine. I'm trying to connect to server using following code:
Properties Props = new Properties()
Props.setProperty(AdminClient.CONNECTOR_TYPE,
AdminClient.CONNECTOR_TYPE_SOAP)
Props.setProperty(AdminClient.CONNECTOR_SECURITY_ENABLED, "true")
Props.setProperty(AdminClient.CACHE_DISABLED, "false")
Props.setProperty("javax.net.ssl.trustStore", "WebAS")
Props.setProperty("javax.net.ssl.trustStorePassword", "WebAS")
Props.setProperty(AdminClient.CONNECTOR_HOST, "127.0.0.1")
Props.setProperty(AdminClient.CONNECTOR_PORT, "9060")
Props.setProperty(AdminClient.USERNAME, "user")
Props.setProperty(AdminClient.PASSWORD, "password")
System.setProperty("com.ibm.SSL.ConfigURL", /specified location of
file/ "ssl.client.props") Props.setProperty("com.ibm.SSL.ConfigURL",
/specified location of file/ "ssl.client.props") //I generated
keystore.jks `
Props.setProperty("javax.net.ssl.trustStore",directory.toURI().toURL()+"keystore‌​.jks"
); Props.setProperty("javax.net.ssl.keyStore",
directory.toURI().toURL()+"keystore.jks");
this.adminClient=AdminClientFactory.createAdminClient(Props)
When run the following code, I get following error
com.ibm.websphere.management.exception.ConnectorException: ADMC0016E: The system cannot create a SOAP connector to connect to host 127.0.0.1 at port 9043.
Caused by: java.lang.reflect.InvocationTargetException
Caused by: java.lang.NoClassDefFoundError: com/ibm/security/certclient/util/PkSsCertFactory
Caused by: java.lang.ClassNotFoundException: com.ibm.security.certclient.util.PkSsCertFactory
I looked up for classname: com.ibm.security.certclient.util.PkSsCertFactory to include. I cannot find neither the IBM jar file or groupId, artifact id, version. Please help me out

Export the dmgr's CA certificate to nodes truststore and give a try.
As I can see your node agent is taking port 9043 to connect to dmgr, if all configurations made are default, then this should not happen.
please check your nodes and dmgrs serverindex.xml file.

Related

Spring Cloud Discovery First Configuration Server Decryption Failed

I am trying discovery first implementation with Spring Cloud. I am getting failure for password decryption. I have .jks in the classpath. The same works when I go for Config First approach.
Following is the bootstrap.properties file for Config first approach.
eureka.instance.hostname=claims-dev
eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka/
spring.cloud.config.name=claim
spring.config.import=configserver:http://localhost:8888
spring.profiles.active=dev
spring.cloud.config.fail-fast=true
Following is the bootstrap for Discovery First approach.
eureka.instance.hostname=claims-dev
eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka/
spring.cloud.config.discovery.service-id=configserver
spring.cloud.config.discovery.enabled=true
spring.cloud.config.name=claim
spring.profiles.active=dev
spring.cloud.config.fail-fast=true
For Discovery First I am getting below exception
Caused by: java.lang.UnsupportedOperationException: No decryption for FailsafeTextEncryptor. Did you configure the keystore correctly?
at org.springframework.cloud.bootstrap.encrypt.TextEncryptorUtils$FailsafeTextEncryptor.decrypt(TextEncryptorUtils.java:188) ~[spring-cloud-context-3.1.0.jar:3.1.0]
at org.springframework.cloud.bootstrap.encrypt.AbstractEnvironmentDecrypt.decrypt(AbstractEnvironmentDecrypt.java:144) ~[spring-cloud-context-3.1.0.jar:3.1.0]
... 16 common frames omitted
What I am missing here?
UPDATE: Following are the config server properties
encrypt.keyStore.location=classpath:/store name
encrypt.keyStore.password=store password
encrypt.keyStore.alias=alias
encrypt.key-store.type=jks
spring.cloud.config.server.encrypt.enabled=false
It works if I opt for server side password decryption.

Trying to Connect Vertica DB with Weblogic 10.3

Working on Linux Redhat
I have two below jars
1>vertica-jdbc-5.1.1.jar
2>vertica-jdk5-6.1.1-0.jar
Steps that i followed:
1 copied the jars to $WL_HOME/server/lib
2 I set the path of the jars to Linux Path like below
export WL_HOME=/usr/local/WL_Server10.3/sever
PATH= ${WL_HOME}/lib:${PATH}
3 I modified ${WL_HOME}/common/bin/commEnv.sh
Added my jars entry like below
# set up WebLogic Server's class path
WEBLOGIC_CLASSPATH="${JAVA_HOME}/lib/tools.
jar${CLASSPATHSEP}${WL_HOME}/server/lib/weblogic_sp.
jar${CLASSPATHSEP}${WL_HOME}/server/lib/weblogic.
jar${CLASSPATHSEP}${FEATURES_DIR}/weblogic.server.modules_13.1.1.0.
jar${CLASSPATHSEP}${WL_HOME}/server/lib/webservices.
jar${CLASSPATHSEP}${ANT_HOME}/lib/ant-all.
jar${CLASSPATHSEP}${ANT_CONTRIB}/lib/ant-contrib.jar
${CLASSPATHSEP}${WL_HOME}/server/lib/vertica-jdbc-5.1.1.jar
${CLASSPATHSEP}${WL_HOME}/server/lib/vertica-jdk5-6.1.1-0.jar"
export WEBLOGIC_CLASSPATH
//I also tried the below steps googling,................. Optional Step
4> Modified ${WL_HOME}/server/lib/jdbcdrivers.xml
Added required parameter
i didnt get what to fill in the URLClassPathName value so i ignored it.
5>I restarted the Weblogic server and logged into the admin console
6> I added new JDBC Data Source
While Testing the Connection i am getting below Error:
Message icon - Error An error occurred during activation of changes, please see the log for details.
Message icon - Error weblogic.application.ModuleException:
Message icon - Error weblogic.common.ResourceException: Could not create pool connection. The DBMS driver exception was: [Vertica][JDBC](10100) Connection Refused: (11640) Required Connection Key(s): user; (11480) Optional Connection Key(s): autocommit, connsettings, directbatchinsert, logintimeout, loglevel, lognamespace, logpath, readonly, resultbuffersize, sessionlabel, ssl, threepartnaming, transactionisolation
It would be great if someone can help me with the steps to connect Vertica Database to the Weblogic 10.3
What connection settings are you providing in:
"6> Added new JDBC Data Source
7>Followed the steps"
The error says you're missing specificying a user:
[Vertica][JDBC](10100) Connection Refused:
(11640) Required Connection Key(s): user;
(11480) Optional Connection Key(s): autocommit, connsettings, directbatchinsert, logintimeout, loglevel, lognamespace, logpath, readonly, resultbuffersize, sessionlabel, ssl, threepartnaming, transactionisolation

Cannot run Gradlew: get Exception in thread "main" java.net.SocketException: Connection reset

I'm trying to run gradlew to build some code that had been supplied to me. The source is the ZIP download from here and all I've done is open a command prompt, cd to that folder and run gradlew.bat.
I've had this work on my crash'n'burn machine but I can't get it working on my main dev machine. The dev machine sits behind a proxy which requires authentication, the other machine doesn't - they're at different locations.
Originally, I got:
Exception in thread "main" java.net.UnknownHostException: services.gradle.org
From this, to gradle.properties, I added:
systemProp.http.proxyHost=192.168.x.y
systemProp.http.proxyPort=80
systemProp.http.proxyUser=myuserid
systemProp.http.proxyPassword=mypassword
and ran it again and got:
C:\Users\tso259sa\workspace\spring-security-saml-master>gradlew.bat
Downloading http://services.gradle.org/distributions/gradle-1.4-bin.zip
Exception in thread "main" java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:189)
at java.net.SocketInputStream.read(SocketInputStream.java:121)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
at sun.net.www.MeteredStream.read(MeteredStream.java:134)
at java.io.FilterInputStream.read(FilterInputStream.java:133)
at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3052)
at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3046)
at org.gradle.wrapper.Download.downloadInternal(Download.java:67)
at org.gradle.wrapper.Download.download(Download.java:49)
at org.gradle.wrapper.Install.createDist(Install.java:51)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
For info, if I try an incorrect password or ID, I get:
Exception in thread "main" java.net.ProtocolException: Server redirected too many times (20)
so I think that rules out incorrect ID. Anyone have any ideas what I can try?
I don't know exactly what caused the connection reset but I tried again several times, in case it was transient and, after some time, the response changed to:
Exception in thread "main" java.io.IOException: Server returned
HTTP response code: 403
Suspecting our security systems, I tried to download the file using a browser and received a message from one of the security boxes saying it had been blocked because it contained a .bat file: a regular occurrence.
Look in your build.gradle and gradle.properties and edit 'https://' to 'http://' in all links
I still got this issue today. Different company has different proxy settings.
after investigate, it worked for me:
org.gradle.daemon=true
systemProp.https.proxyHost=[server name]
systemProp.https.proxyPort=[port]
systemProp.https.proxyUser=[user name]
systemProp.https.proxyPassword=XXXXX
systemProp.https.nonProxyHosts= localhost
systemProp.http.proxyHost=[server name]
systemProp.http.proxyPort=[port]
systemProp.http.proxyUser=[user name]
systemProp.http.proxyPassword=XXXXX
systemProp.http.nonProxyHosts= localhost

Tomcat JDBCRealm using Oracle database over SSL (PROTOCOL=TCPS)

I'm trying to implement JDBCRealm in tomcat (as described in http://tomcat.apache.org/tomcat-4.1-doc/realm-howto.html#Configuring%20a%20Realm) to check credential agains Oracle Database. The thing is that I want database to communicate over SSL. So I configured listener to use TCPS. Like that:
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<hostname>)(PORT=1521)))<br>
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=<hostname>)(PORT=1512)))
Generated certificates, etc. I have no problem connecting to database using tcps from sqlplus or from WLS (I can use connection property oracle.net.ssl_cipher_suites=(SSL_DH_anon_WITH_3DES_EDE_CBC_SHA,SSL_DH_anon_WITH_RC4_128_MD5,SSL_DH_anon_WITH_DES_CBC_SHA) there without any problem).
However, I cant get JDBCRealm to work with the database over TCPS. If I configure realm like this:
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99" driverName="oracle.jdbc.driver.OracleDriver" connectionURL="jdbc:oracle:thin:#(DESCRIPTION = (ADDRESS = (PROTOCOL = TCPS)(HOST = <hostname>)(PORT = 1512)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = <service name>)))" connectionName="<login>" connectionPassword="<password>" userTable="users" userNameCol="user_name" userCredCol="user_pass" userRoleTable="user_roles" roleNameCol="role_name" />
I'm getting following error:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
I imported certificates in JKS store which I configured in Tomcat like this:
With no success.
I'm not a professional in Tomcat (more in databases). I'll appreciate any help or pointing me in right direction. Thanks in advance!
Error seems to indicate that SSL certificate is not trusted.
I suggest to verify that you indeed have certificate in your trust store (there is a command line tool in JDK to list trust store content, you can Google it) and then add following parameter in Tomcat startup script:
javax.net.ssl.trustStore=<path to trust store>

OC4J 10.1.3.3 unable to find ojms.rar setting up database persistences

I'm running into problems with JMS in Oracle AS 10.1.3.3.
The error I am getting is 'connectors\ojms.rar (The system cannot find the path specified)' from EM.
Below are a few bullets on the environment.
This is on a Windows XP SP3 machine.
All configuration is through EM.
The EM is a local instance that has been used for over a year.
This instance has existing db connection management exposed through JNDI.
Oracle_home is set to the directory where I unzip the OC4J zip file. c:\oc4j_10.1.3.3.
ojms.rar file is in %ORACLE_HOME%\j2ee\home\connectors
Configuring OC4J for JMS with Database Persistence
I've create a new data connection for Oracle AQ and exposed the connection through JNDI as jms/flexc
When creating the Resource Adapter through EM, I'm providing the following information:
Resource Name: JMS on FlexC
Adding a new resource
Name : jmsFlexc
Datasource JNDI : jms/flexc (selected from dropdown box)
Very quickly, I get the error below:
An error has occurred.
connectors\ojms.rar (The system cannot find the path specified)
connectors\ojms.rar (The system cannot find the path specified)
[Select to hide information] Hide Additional Trace Information
oracle.sysman.ias.studio.j2ee.deploy.DeployUtil$DeploymentFailureException at
oracle.sysman.ias.studio.j2ee.deploy.DeployUtil.deployArchive(DeployUtil.java:211) at
oracle.sysman.ias.studio.j2ee.deploy.DeployUtil.deployArchive(DeployUtil.java:85) at
oracle.sysman.ias.studio.oc4j.jms.JMXDeployDbProviderAdminBean.deployDBProviderAndConfigure(JMXDeployDbProviderAdminBean.java:121) at
oracle.sysman.ias.studio.oc4j.jms.DeployDbProviderHelper.deployDBProvider(DeployDbProviderHelper.java:242) at
oracle.sysman.ias.studio.oc4j.jms.DeployDbProviderHelper.handleEvent(DeployDbProviderHelper.java:127) at
oracle.sysman.ias.studio.sdk.AbstractController.handleEvent(AbstractController.java:769) at
oracle.sysman.emSDK.svlt.PageHandler.handleRequest(PageHandler.java:378) at
oracle.sysman.emSDK.svlt.EMServlet.myDoGet(EMServlet.java:765) at
oracle.sysman.emSDK.svlt.EMServlet.doGet(EMServlet.java:283) at
oracle.sysman.ias.studio.app.StudioConsole.doGet(StudioConsole.java:385) at
oracle.cabo.servlet.UIXServlet.doPost(Unknown Source) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:763) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at
com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65) at
oracle.sysman.ias.studio.app.BrowserVersionFilter.doFilter(BrowserVersionFilter.java:75) at
com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15) at
oracle.sysman.ias.studio.app.MultipleJVMFilter.doFilter(MultipleJVMFilter.java:85) at
com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17) at
oracle.sysman.ias.studio.app.PostLogonFilter.doFilter(PostLogonFilter.java:80) at
com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17) at
oracle.sysman.ias.studio.app.ShortHostnameRedirectFilter.doFilter(ShortHostnameRedirectFilter.java:68) at
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621) at
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370) at
com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871) at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453) at
com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221) at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122) at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111) at
oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260) at
oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239) at
oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34) at
oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880) at
com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303) at
java.lang.Thread.run(Thread.java:619) Caused by: oracle.oc4j.admin.jmx.shared.exceptions.JMXRuntimeException: connectors\ojms.rar (The system cannot find the path specified) at
oracle.oc4j.admin.jmx.shared.util.JarTool.(JarTool.java:122) at
oracle.sysman.ias.studio.j2ee.deploy.DeployPageUtil.getArchiveType(DeployPageUtil.java:105) at
oracle.sysman.ias.studio.j2ee.deploy.DeployUtil.deployArchive(DeployUtil.java:133) ... 33 more Caused by: java.io.FileNotFoundException: connectors\ojms.rar (The system cannot find the path specified) at
java.util.zip.ZipFile.open(Native Method) at
java.util.zip.ZipFile.(ZipFile.java:114) at
java.util.jar.JarFile.(JarFile.java:135) at
java.util.jar.JarFile.(JarFile.java:99) at
oracle.oc4j.admin.jmx.shared.util.JarTool.(JarTool.java:119) ... 35 more
Discovered that this is a bug in OC4J.
The solution was found by a colleague as a comment made to this blog
I also got an error when deploying the
resource adapter. I found that this
was a bug in Oracle Standalone
10.1.3.3.0 (bug 6786060 on Metalink) and can be solved either by using
10.1.3.2.0 or by starting Oracle standalone without the ORACLE_HOME
environment variable. This is made by
the command "java -jar oc4j.jar". I
used the last solution and it worked
fine for me.

Resources