How to get a Kerberos credential via Java Gss-api on win7 - kerberos

I want to write a simple program that implements security communication between client and server by calling gss-api. I try like this:
mgr = GSSManager.getInstance();
krb5Mechanism = new Oid("1.2.840.113554.1.2.2");
krb5PrincipalNameType = new Oid("1.2.840.113554.1.2.2.1");
serviceName = mgr.createName(serviceNameStr, krb5PrincipalNameType);
cred = mgr.createCredential(serviceName, GSSCredential.INDEFINITE_LIFETIME, krb5Mechanism, GSSCredential.ACCEPT_ONLY);
But I got a GSSException when created the GSSCredential.
GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos credentails)
at sun.security.jgss.krb5.Krb5AcceptCredential.getInstance(Unknown Source)
at sun.security.jgss.krb5.Krb5MechFactory.getCredentialElement(Unknown Source)
at sun.security.jgss.GSSManagerImpl.getCredentialElement(Unknown Source)
at sun.security.jgss.GSSCredentialImpl.add(Unknown Source)
at sun.security.jgss.GSSCredentialImpl.<init>(Unknown Source)
at sun.security.jgss.GSSManagerImpl.createCredential(Unknown Source)
at com.juan.gssapi.SimpleGSSAPIServer.loop(SimpleGSSAPIServer.java:55)
at com.juan.gssapi.SimpleGSSAPIServer.main(SimpleGSSAPIServer.java:36)
Does anybody know the reason?

Related

Mirth SQL Server Database reader source, DBMaxRetries error

I am using Mirth Connect Server 3.4.2.8129. I created a test channel, a very simple one which should just select the records from a table (SQL Server) and send them to a destination of type javascript writer.
I defined a database reader source and I am trying to select the records of a table. I will paste the code below.
The Javascript code I use in the Source is this (I replaced sensitive information with ***):
var dbConn;
try
{
dbConn = DatabaseConnectionFactory.createDatabaseConnection('net.sourceforge.jtds.jdbc.Driver','jdbc:jtds:sqlserver://***:***;InstanceName=***;DatabaseName=***','***','***');
var results = executeCachedQuery('select * from [***].[dbo].[***]');
return results;
}
finally
{
if (dbConn)
{
dbConn.close();
}
}
I get the following error:
ERROR 2019-10-14 12:41:00,164 [Database Reader Polling Thread on TestMedisOrders (fba0f4c7-0a2d-47ec-b638-acb586925c92) < fba0f4c7-0a2d-47ec-b638-acb586925c92_Worker-1] com.mirth.connect.connectors.jdbc.DatabaseReceiver: Failed to poll for messages from the database in channel "TestMedisOrders"
com.mirth.connect.connectors.jdbc.DatabaseReceiverException: Error executing script 4bf7e588-202a-4aea-9d5e-be0155a4fa6a.
at com.mirth.connect.connectors.jdbc.DatabaseReceiverScript.poll(DatabaseReceiverScript.java:128)
at com.mirth.connect.connectors.jdbc.DatabaseReceiver.poll(DatabaseReceiver.java:108)
at com.mirth.connect.donkey.server.channel.PollConnectorJob.execute(PollConnectorJob.java:49)
at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557)
Caused by: com.mirth.connect.server.MirthJavascriptTransformerException:
CHANNEL: TestMedisOrders
CONNECTOR: Source
SOURCE CODE:
125: }
126:
127: function executeOperation(source, operation, expression, parameters) {
128: var dbConn = getDBConnection(source);
129: var attempts = 0;
130: var maxAttempts = java.lang.Integer.parseInt($('DBMaxRetries'));
131:
132: while (attempts < maxAttempts) {
133: attempts++;
134:
LINE NUMBER: 130
DETAILS: Wrapped java.lang.NumberFormatException: For input string: ""
at 4bf7e588-202a-4aea-9d5e-be0155a4fa6a:130 (executeOperation)
at 4bf7e588-202a-4aea-9d5e-be0155a4fa6a:67 (executeCachedQuery)
at 4bf7e588-202a-4aea-9d5e-be0155a4fa6a:249 (doScript)
at 4bf7e588-202a-4aea-9d5e-be0155a4fa6a:259
at com.mirth.connect.server.util.javascript.JavaScriptUtil.executeScript(JavaScriptUtil.java:527)
at com.mirth.connect.connectors.jdbc.DatabaseReceiverScript$SelectTask.doCall(DatabaseReceiverScript.java:168)
at com.mirth.connect.server.util.javascript.JavaScriptTask.call(JavaScriptTask.java:113)
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)
Caused by: java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at sun.reflect.GeneratedMethodAccessor46.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1479)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3280)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:120)
at com.mirth.connect.server.util.javascript.JavaScriptTask.executeScript(JavaScriptTask.java:142)
at com.mirth.connect.server.util.javascript.JavaScriptUtil.executeScript(JavaScriptUtil.java:522)
... 6 more
I tried searching for a setting in all the configuration files in mirth installation folder, but I didn't find any file containing it. I also unarchived the SQL Server driver (jtds 1.3.1.jar) and searched there, too, but no. I did not find anything about a DBMaxRetries.
Has anyone else face this?
Thank you.
You likely meant to call:
var results = dbConn.executeCachedQuery('select * from [***].[dbo].[***]');
According to the stack trace, you must have javascript functions executeCachedQuery and executeOperation defined, likely through a code template if you check your channel dependencies. You are calling the executeCachedQuery javascript function instead of the DatabaseConnection.executeCachedQuery API method.
$('DBMaxRetries') is attempting to pull the value from one of the mirth maps. globalMap, globalChannelMap, and configurationMap are the only ones available from a Database Reader context. If you haven't defined DBMaxRetries in at least one of these maps, it will return null.

Cannot set CURRENT OPTIMIZATION HINT special register via db2dsdriver.cfg <specialregisters> section

I was trying to provide a default value for the CURRENT OPTIMIZATION HINT special register for my DB2 client application.
I tried db2dsdriver.cfg file and it's section and JDBC specialRegisters Uri parameter. Both lead to the same result:
When I set the value without quotes like so:
db2dsdriver.cfg:
<specialregisters>
<parameter name="CURRENT OPTIMIZATION HINT" value="HELLO1"/>
</specialregisters>
or with JDBC Uri:
jdbc:db2://<ip>:<port>/<database>:retrieveMessagesFromServerOnGetMessage=true;emulateParameterMetaDataForZCalls=1;specialRegisters=CURRENT OPTIMIZATION HINT=HELLO1;
I get an exception saying I have a problem with the SET instruction:
Message: ERROR [42721] [IBM][DB2] SQL0969N There is no message text corresponding to SQL error "-725" in the message file on this workstation. The error was returned from module "DSNLXENV" with original tokens "CURRENT QUERY OPTIMIZATION DALLASA". SQLSTATE=42721
Here is the exempt from the java trace:
...
[jcc][t4]
[jcc][t4] SEND BUFFER: SQLSTT (ASCII) (EBCDIC)
[jcc][t4] 0000 0036D04300010030 2414000000002653 .6.C...0$.....&S ..}.............
[jcc][t4] 0010 4554204355525245 4E54204F5054494D ET CURRENT OPTIM ........+..|&..(
[jcc][t4] 0020 495A4154494F4E20 48494E54203D2048 IZATION HINT = H .!...|+...+.....
[jcc][t4] 0030 454C4C4F31FF ELLO1. .<<|..
[jcc][t4]
...
[jcc][Thread:Worker-103][SQLException#d1aed064] java.sql.SQLException
[jcc][Thread:Worker-103][SQLException#d1aed064][Sqlca#a74669be] DB2 SQLCA from server
[jcc][Thread:Worker-103][SQLException#d1aed064][Sqlca#a74669be] SqlCode = -725
[jcc][Thread:Worker-103][SQLException#d1aed064][Sqlca#a74669be] SqlErrd = { 0, 0, 0, -1, 0, 0 }
[jcc][Thread:Worker-103][SQLException#d1aed064][Sqlca#a74669be] SqlErrmc = CURRENT QUERY OPTIMIZATION;DALLASA
[jcc][Thread:Worker-103][SQLException#d1aed064][Sqlca#a74669be] SqlErrmcTokens = { CURRENT QUERY OPTIMIZATION, DALLASA }
[jcc][Thread:Worker-103][SQLException#d1aed064][Sqlca#a74669be] SqlErrp = DSNLXENV
[jcc][Thread:Worker-103][SQLException#d1aed064][Sqlca#a74669be] SqlState = 42721
[jcc][Thread:Worker-103][SQLException#d1aed064][Sqlca#a74669be] SqlWarn =
[jcc][Thread:Worker-103][SQLException#d1aed064] SQL state = 42721
[jcc][Thread:Worker-103][SQLException#d1aed064] Error code = -725
[jcc][Thread:Worker-103][SQLException#d1aed064] Tokens = CURRENT QUERY OPTIMIZATION;DALLASA
[jcc][Thread:Worker-103][SQLException#d1aed064] Stack trace follows
com.ibm.db2.jcc.am.SqlSyntaxErrorException: CURRENT QUERY OPTIMIZATION;DALLASA
at com.ibm.db2.jcc.am.kd.a(Unknown Source)
at com.ibm.db2.jcc.am.kd.a(Unknown Source)
at com.ibm.db2.jcc.am.kd.a(Unknown Source)
at com.ibm.db2.jcc.am.jg.c(Unknown Source)
at com.ibm.db2.jcc.am.jg.a(Unknown Source)
at com.ibm.db2.jcc.t4.bb.k(Unknown Source)
at com.ibm.db2.jcc.t4.bb.g(Unknown Source)
at com.ibm.db2.jcc.t4.p.f(Unknown Source)
at com.ibm.db2.jcc.t4.b.readSetGenericSQLSetInfo_(Unknown Source)
at com.ibm.db2.jcc.am.qg.b(Unknown Source)
at com.ibm.db2.jcc.am.sg.b(Unknown Source)
at com.ibm.db2.jcc.am.Agent.readPiggybackCommands(Unknown Source)
at com.ibm.db2.jcc.am.Agent.beginReadChain(Unknown Source)
at com.ibm.db2.jcc.t4.a.beginReadChain(Unknown Source)
at com.ibm.db2.jcc.am.Agent.flow(Unknown Source)
at com.ibm.db2.jcc.am.fp.a(Unknown Source)
at com.ibm.db2.jcc.am.fp.a(Unknown Source)
at com.ibm.db2.jcc.am.fp.executeQuery(Unknown Source)
at com.ibm.datatools.filter.DependencyService.executeCountQuery(Unknown Source)
at com.ibm.datatools.filter.DependencyService.access$3(Unknown Source)
at com.ibm.datatools.filter.DependencyService$LoadCountsJob.run(Unknown Source)
at org.eclipse.core.internal.jobs.Worker.run(Unknown Source)
When I try the same and put quotes around the value, I get some strange results:
db2dsdriver.cfg:
<specialregisters>
<parameter name="CURRENT OPTIMIZATION HINT" value="'HELLO1'"/>
</specialregisters>
or with JDBC Uri:
jdbc:db2://<ip>:<port>/<database>:retrieveMessagesFromServerOnGetMessage=true;emulateParameterMetaDataForZCalls=1;specialRegisters=CURRENT OPTIMIZATION HINT='HELLO1';
The result is that the special registed is set to some faulty value:
SELECT CURRENT OPTIMIZATION HINT FROM SYSIBM.SYSDUMMY1;
returns a string:
"\0\0\0\u00010\u001a\0\0"
Here is my environment info:
C:\Windows\system32>db2level
DB21085I This instance or install (instance name, where applicable: "DB2")
uses "64" bits and DB2 code release "SQL10012" with level identifier
"0203010E".
Informational tokens are "DB2 v10.1.200.238", "s121127", "IP23389", and Fix
Pack "2".
Product is installed at "C:\PROGRA~1\IBM\SQLLIB" with DB2 Copy Name "DB2COPY1".
C:\Windows\system32>db2set -all
[e] DB2PATH=C:\Program Files\IBM\SQLLIB
[i] DB2_SELECTIVITY=ALL
[i] DB2INSTPROF=C:\ProgramData\IBM\DB2\DB2COPY1
[i] DB2CODEPAGE=1252
[g] DB2_EXTSECURITY=NO
[g] DB2_COMMON_APP_DATA_PATH=C:\ProgramData
[g] DB2PATH=C:\Program Files\IBM\SQLLIB
[g] DB2INSTDEF=DB2
C:\Windows\system32>db2cli validate
IBM DATABASE 2 Interactive CLI Sample Program
(C) COPYRIGHT International Business Machines Corp. 1993,1996
All Rights Reserved
Licensed Materials - Property of IBM
US Government Users Restricted Rights - Use, duplication or
disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
---------------------------------------------------------------------------
[ CLI Driver Version : 10.01.0000 ]
[ Informational Tokens: "DB2 v10.1.200.238","s121127","IP23389","Fixpack 2" ]
[ CLI Driver Type : IBM Data Server Runtime Client ]
[ db2diag.log Path : C:\ProgramData\IBM\DB2\DB2COPY1\DB2\db2diag.log ]
---------------------------------------------------------------------------
IBM Data Server Client packages on the current workstation :
Copyname Version Installed Location
---------------------------------------------------------------------------
DB2COPY1[C,D] 10.01.0002 C:\Program Files\IBM\SQLLIB
---------------------------------------------------------------------------
db2dsdriver.cfg Schema Validation :
Success: The schema validation operation completed successfully.
The configuration file C:\ProgramData\IBM\DB2\DB2COPY1\cfg\db2dsdriver.cfg is valid
The validation completed.
For DDF DB2 access I am using:
IBM Data Studio 4.1.3 which in turn uses JDBC driver db2jcc4.jar version 4.25.1301
Custom .NET application using IBM.Data.DB2.dll version 10.1.2.2

Talend: REST Call results in either "URI is not absolute" or "UnknownHostException"

I am trying to get data from a REST API to our database with the help of Talend Jaspersoft ETL Express Version 5.6.
To make sure that my problem is not related to our server configuration i installed the tool locally too and got stuck. Since I am a student who is not well experienced with java but needs to get this run for his company i hope you can help me. I have only some basic knowledge so i did not try to find a solution in the "Code" tab, only worked with the Designer.
In the end I wanted to try out the following tutorial:
http://dwetl.com/2015/08/11/trest-use-case-example-use-rest-api-in-talend/
but that don't works too for me. I can get the data when i use the call in my browser but with that tool i am getting only errors.
With "https://api.github.com/users/mralexgray/followers" as URL I get an UnknownHostException:
Starte Job Test am 11:20 21/07/2016.
[statistics] connecting to socket on port 3941
[statistics] connected
Exception in component tREST_1
com.sun.jersey.api.client.ClientHandlerException: java.net.UnknownHostException: api.github.com
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:131)
at com.sun.jersey.api.client.Client.handle(Client.java:616)
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:559)
at com.sun.jersey.api.client.WebResource.get(WebResource.java:182)
at testetl.test_0_1.Test.tREST_1Process(Test.java:572)
at testetl.test_0_1.Test.runJobInTOS(Test.java:929)
at testetl.test_0_1.Test.main(Test.java:786)
Caused by: java.net.UnknownHostException: api.github.com
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
at sun.security.ssl.BaseSSLSocketImpl.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
[statistics] disconnected
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source)
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:218)
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:129)
... 6 more
Job Test endet am 11:20 21/07/2016. [exit code=1]
If I cut off that "https://" part and use "api.github.com/users/mralexgray/followers" as Url I get the error "Uri is not absolute"
Starte Job Test am 11:31 21/07/2016.
[statistics] connecting to socket on port 3809
[statistics] connected
Exception in component tREST_1
com.sun.jersey.api.client.ClientHandlerException: java.lang.IllegalArgumentException: URI is not absolute
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:131)
at com.sun.jersey.api.client.Client.handle(Client.java:616)
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:559)
at com.sun.jersey.api.client.WebResource.get(WebResource.java:182)
at testetl.test_0_1.Test.tREST_1Process(Test.java:572)
at testetl.test_0_1.Test.runJobInTOS(Test.java:929)
at testetl.test_0_1.Test.main(Test.java:786)
Caused by: java.lang.IllegalArgumentException: URI is not absolute
at java.net.URI.toURL(Unknown Source)
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:140)
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:129)
... 6 more
[statistics] disconnected
Job Test endet am 11:31 21/07/2016. [exit code=1]
Just to give you as many information as possible, here is a little part out of the auto generated java code which seems to be about this REST Call for me, but maybe I am completly wrong and this dont helps at all since I have only basic java knowledge:
/**
* [tREST_1 begin ] start
*/
ok_Hash.put("tREST_1", false);
start_Hash.put("tREST_1", System.currentTimeMillis());
currentComponent = "tREST_1";
int tos_count_tREST_1 = 0;
String endpoint_tREST_1 = "api.github.com/users/mralexgray/followers";
String trustStoreFile_tREST_1 = System
.getProperty("javax.net.ssl.trustStore");
String trustStoreType_tREST_1 = System
.getProperty("javax.net.ssl.trustStoreType");
String trustStorePWD_tREST_1 = System
.getProperty("javax.net.ssl.trustStorePassword");
String keyStoreFile_tREST_1 = System
.getProperty("javax.net.ssl.keyStore");
String keyStoreType_tREST_1 = System
.getProperty("javax.net.ssl.keyStoreType");
String keyStorePWD_tREST_1 = System
.getProperty("javax.net.ssl.keyStorePassword");
com.sun.jersey.api.client.config.ClientConfig config_tREST_1 = new com.sun.jersey.api.client.config.DefaultClientConfig();
javax.net.ssl.SSLContext ctx_tREST_1 = javax.net.ssl.SSLContext
.getInstance("SSL");
javax.net.ssl.TrustManager[] tms_tREST_1 = null;
if (trustStoreFile_tREST_1 != null
&& trustStoreType_tREST_1 != null) {
char[] password_tREST_1 = null;
if (trustStorePWD_tREST_1 != null)
password_tREST_1 = trustStorePWD_tREST_1.toCharArray();
java.security.KeyStore trustStore_tREST_1 = java.security.KeyStore
.getInstance(trustStoreType_tREST_1);
trustStore_tREST_1.load(new java.io.FileInputStream(
trustStoreFile_tREST_1), password_tREST_1);
javax.net.ssl.TrustManagerFactory tmf_tREST_1 = javax.net.ssl.TrustManagerFactory
.getInstance(javax.net.ssl.KeyManagerFactory
.getDefaultAlgorithm());
tmf_tREST_1.init(trustStore_tREST_1);
tms_tREST_1 = tmf_tREST_1.getTrustManagers();
}
javax.net.ssl.KeyManager[] kms_tREST_1 = null;
if (keyStoreFile_tREST_1 != null
&& keyStoreType_tREST_1 != null) {
char[] password_tREST_1 = null;
if (keyStorePWD_tREST_1 != null)
password_tREST_1 = keyStorePWD_tREST_1.toCharArray();
java.security.KeyStore keyStore_tREST_1 = java.security.KeyStore
.getInstance(keyStoreType_tREST_1);
keyStore_tREST_1.load(new java.io.FileInputStream(
keyStoreFile_tREST_1), password_tREST_1);
javax.net.ssl.KeyManagerFactory kmf_tREST_1 = javax.net.ssl.KeyManagerFactory
.getInstance(javax.net.ssl.KeyManagerFactory
.getDefaultAlgorithm());
kmf_tREST_1.init(keyStore_tREST_1, password_tREST_1);
kms_tREST_1 = kmf_tREST_1.getKeyManagers();
}
ctx_tREST_1.init(kms_tREST_1, tms_tREST_1, null);
config_tREST_1
.getProperties()
.put(com.sun.jersey.client.urlconnection.HTTPSProperties.PROPERTY_HTTPS_PROPERTIES,
new com.sun.jersey.client.urlconnection.HTTPSProperties(
new javax.net.ssl.HostnameVerifier() {
public boolean verify(
String hostName,
javax.net.ssl.SSLSession session) {
return true;
}
}, ctx_tREST_1));
com.sun.jersey.api.client.Client restClient_tREST_1 = com.sun.jersey.api.client.Client
.create(config_tREST_1);
com.sun.jersey.api.client.WebResource restResource_tREST_1;
if (endpoint_tREST_1 != null && !("").equals(endpoint_tREST_1)) {
restResource_tREST_1 = restClient_tREST_1
.resource(endpoint_tREST_1);
} else {
throw new IllegalArgumentException("url can't be empty!");
}
com.sun.jersey.api.client.ClientResponse errorResponse_tREST_1 = null;
String restResponse_tREST_1 = "";
try {
restResponse_tREST_1 = restResource_tREST_1
.get(String.class);
} catch (com.sun.jersey.api.client.UniformInterfaceException ue) {
errorResponse_tREST_1 = ue.getResponse();
}
// for output
row1 = new row1Struct();
if (errorResponse_tREST_1 != null) {
row1.ERROR_CODE = errorResponse_tREST_1.getStatus();
} else {
row1.Body = restResponse_tREST_1;
}
/**
* [tREST_1 begin ] stop
*/
/**
* [tREST_1 main ] start
*/
Any help would be very appreciated :). All my examples are about that tutorial but while I was trying to get our real API to work with ETL I just got the exact same problems and I guess this tutorial is easier to give you guys as an example.
We finally could figure out a way to solve our connection issue.
I don't know why Talend is not using our proxy correctly even if its manually set up in the preferences but if we use the tSetProxy component it works and gets the expected JSON object back from the server.
java.net.UnknownHostException : Did you check if you are behind a proxy ? The previous error should happen if, from your studio position, the site is not accessible.
You have to know that your browser doesn't necessarily have the same configuration as Talend Studio. So, please check your "Internet Settings" for the existing of any proxy. If it is the case, then it is possible to change the proxy settings in menu: Window -> Preferences, under General -> Network.

Cannot send email in ICEmobile project

I just started to delve into ICEsoft. I have an ICEmobile project in which I try to implement notification sending to users. I use Tomcat 7, ICEmobile 1.1, ICEfaces 3, and my IDE is Eclipse Juno 4.2.
Here are some code snippets for rendering messages:
/** from NotificationBean class (ApplicationScoped) **/
// render group is the current session id.
public String renderGroup = "renderGroup";
public NotificationBean() {
PushRenderer.addCurrentSession(renderGroup);
}
/** from NotificationController class (ViewScoped) **/
NotificationBean notifBean = (NotificationBean)FacesUtils.getManagedBean("notificationBean");
public void sendPriorityPushMessage(ActionEvent event) {
final PushMessage myMessage = new PushMessage(notifBean.getSubject(), notifBean.getMessage());
final PortableRenderer portable = PushRenderer.getPortableRenderer();
...
portable.render(notifBean.renderGroup, myMessage);
...
}
I've configured SMTP setting in my web.xml in such a way:
smtp.host: smtp.gmail.com
smtp.from: myaccount#gmail.com
smtp.port: 465
smtp.user: myaccount#gmail.com
smtp.password ...
smtp.security: SSL
smtp.verify-server-certificate - false
I am testing all this on an Android emulator, in ICEmobile Container (4.1, 16 + Google APIs). There I unchecked C2DM Notify property and in "Email Notification" entered my email address.
With that code I cannot send email. I get such an error:
WARNING: Failed to send email message.
javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
nested exception is:
java.net.SocketException: Connection reset
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1934)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638)
at javax.mail.Service.connect(Service.java:295)
at org.icepush.EmailNotificationProvider$SendMessage.run(EmailNotificationProvider.java:138)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.InputRecord.readFully(Unknown Source)
at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:507)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:238)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1900)
Do I miss something? I tried to configure my Tomcat, but don't know how to do it properly - maybe the cue is in that?
Thanks in advance,
Irina
I resolved that problem by updating my mail.jar. Mine was too old.

Business Objects Enterprise reporting using SDK client gives exception

We have a client that is using the SDK for invoking reports on the Business Objects Embedded Report Server. We can login, but when calling the openDocument method, something goes wrong.
code:
//LOGON
IEnterpriseSession session = sessionMgr.logon(username, password, clusterNode, authType);
IInfoStore infoStore = (IInfoStore)session.getService("InfoStore");
//GET REPORT OBJECT
String queryForFolder = "Select SI_ID, SI_NAME From CI_INFOOBJECTS Where SI_NAME = '" + folderName + "'";
IInfoObjects queryForFolderResult = infoStore.query(queryForFolder);
if (queryForFolderResult.isEmpty())
{
throw new Exception("No Folder Found");
}
//report folder found
IInfoObject reportFolder = (IInfoObject)queryForFolderResult.get(0);
String queryForFile = "Select SI_ID, SI_NAME From CI_INFOOBJECTS Where SI_NAME = '" + reportFile + "'" + " and SI_PARENTID = " + reportFolder ;
IReportAppFactory reportAppFactory = (IReportAppFactory)session.getService("RASReportFactory");
IInfoObjects queryForFileResult = infoStore.query(queryForFile);
if (queryForFileResult.isEmpty())
{
throw new Exception("Report file not found");
}
//report found
IReport report = (IReport)queryForFileResult.get(0);
//OPEN REPORT
clientDoc = reportAppFactory.openDocument(report, 0, locale); /*row 58 in exception*/
exception:
com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException: Unable to connect to the server: . - Server not found or server may be down---- Error code:-2147217387 Error code name:connectServer
at com.crystaldecisions.sdk.occa.managedreports.ras.internal.RASReportAppFactory.a(Unknown Source)
at com.crystaldecisions.sdk.occa.managedreports.ras.internal.RASReportAppFactory.a(Unknown Source)
at com.crystaldecisions.sdk.occa.managedreports.ras.internal.RASReportAppFactory.a(Unknown Source)
at com.crystaldecisions.sdk.occa.managedreports.ras.internal.RASReportAppFactory.openDocument(Unknown Source)
at com.reportclient.MyReportClient.getReportFromInfoStore(MyReportClient.java:58)
... 28 more
Caused by: com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException: Unable to connect to the server: . - Server not found or server may be down---- Error code:-2147217387 Error code name:connectServer
at com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException.throwReportSDKServerException(Unknown Source)
at com.crystaldecisions.sdk.occa.managedreports.ras.internal.CECORBACommunicationAdapter.connect(Unknown Source)
... 32 more
Caused by: com.crystaldecisions.enterprise.ocaframework.OCAFrameworkException$NotFoundInDirectory: Server not found or server may be down
at com.crystaldecisions.enterprise.ocaframework.j.find(Unknown Source)
at com.crystaldecisions.enterprise.ocaframework.AbstractServerHandler.buildServerInfo(Unknown Source)
at com.crystaldecisions.enterprise.ocaframework.AbstractServerHandler.buildClusterInfo(Unknown Source)
at com.crystaldecisions.enterprise.ocaframework.aa.for(Unknown Source)
at com.crystaldecisions.enterprise.ocaframework.ServiceMgr.for(Unknown Source)
at com.crystaldecisions.enterprise.ocaframework.o.a(Unknown Source)
at com.crystaldecisions.enterprise.ocaframework.o.a(Unknown Source)
at com.crystaldecisions.enterprise.ocaframework.o.a(Unknown Source)
at com.crystaldecisions.enterprise.ocaframework.p.a(Unknown Source)
at com.crystaldecisions.enterprise.ocaframework.ServiceMgr.getManagedService(Unknown Source)
... 33 more
The communication obviously works when logging in. Please let me know if you got any ideas or know where I can go and look for the answer. :)
Regards,
Karl
After some further research, this is what I found out. The first error was cased by usage of an earlier version of the BO SDK. The second error, "CORBA communication failure: reason[error number WSAETIMEDOUT]" occurs when the iiop-port is not opened. I solved this by setting the SDK listener port (described in the document http://www.sdn.sap.com/irj/boc/go/portal/prtroot/docs/library/uuid/0047e5f4-3140-2b10-1bae-de175e4c741c?QuickLink=index&overridelayout=true) and triple check that the correct firewall opening was made.
I'm going to guess that the ReportEngine that you are using, your variable reportAppFactory, is not correct for the type of document you are attempting to open.
The other possibility is that this is a DeskI report and it is looking for the Connection Server component to be able to open the document.
I will attempt to help, if you could provide some more details.