asyncfuture | Use QFuture like a Promise object | Reactive Programming library
kandi X-RAY | asyncfuture Summary
kandi X-RAY | asyncfuture Summary
[Build Status] QFuture is used together with QtConcurrent to represent the result of an asynchronous computation. It is a powerful component for multi-thread programming. But its usage is limited to the result of threads, it doesn’t work with the asynchronous signal emitted by QObject. And it is a bit trouble to setup the listener function via QFutureWatcher. AsyncFuture is designed to enhance the function to offer a better way to use it for asynchronous programming. It provides a Promise object like interface. This project is inspired by AsynQt and RxCpp. Remarks: You may use this project together with [QuickFuture] for QML programming.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of asyncfuture
asyncfuture Key Features
asyncfuture Examples and Code Snippets
Community Discussions
Trending Discussions on asyncfuture
QUESTION
I am attempting to call the getContentStream() function in the FileNET/CMIS SOAP/web service. It takes 2 required parameters, a String for the repositoryID, and a String for the documentID. The rest of the parameters are optional. The method signature is this:
org.oasis_open.docs.ns.cmis.ws._200908.ObjectServicePort.getContentStream(
@WebParam(name="repositoryId", String arg0,
@WebParam(name="objectId", String arg1,
@WebParam(name="streamId", String arg2,
@WebParam(name="offset", BigInteger arg3,
@WebParam(name="length", BigInteger arg4,
@WebParam(name="extension", CmisExtensionType arg5) throws CmisException
In my Java code, I have this:
...
String guid = "";
guid = request.getParameter("guid").trim();
//Connect to FileNET/CMIS Web Service:
GetObject objRequest = new GetObject();
ObjectService objService = new ObjectService();
ObjectServicePort objectServicePort = objService.getObjectServicePort();
((SOAPBinding)((BindingProvider) objectServicePort).getBinding()).setMTOMEnabled(true);
((BindingProvider) objectServicePort).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "username");
((BindingProvider) objectServicePort).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "password");
((BindingProvider) objectServicePort).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "https://filenet.web.address.there/openfncmis/services11/ObjectService");
// Call to getContentStream():
CmisContentStreamType cmisContentStreamType = objectServicePort.getContentStream(reposName, guid, "", null, null, null);
...
When I run the code, it is failing with the following error in the console:
[10/7/21 13:52:28:724 EDT] 000000db webapp E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[action]: org.oasis_open.docs.ns.cmis.ws._200908.CmisException: CIL1500: The service cannot be completed.
Explanation: This error can occur for the following reasons:
An error in the IBM CMIS application
An error on the repository Action: See the HTTP response or the application server SystemOut.log file for more information and to review the stack trace for the exception. By default, the SystemOut.log file is in the [WAS_profile_location]/logs/[server]/logs subdirectory of the application server installation directory.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:88) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:57) at java.lang.reflect.Constructor.newInstance(Constructor.java:437) at org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.createServiceException(MethodMarshallerUtils.java:1331) at org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.demarshalFaultResponse(MethodMarshallerUtils.java:1142) at org.apache.axis2.jaxws.marshaller.impl.alt.DocLitWrappedMethodMarshaller.demarshalFaultResponse(DocLitWrappedMethodMarshaller.java:680) at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.getFaultResponse(JAXWSProxyHandler.java:626) at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.createResponse(JAXWSProxyHandler.java:566) at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:432) at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:213) at com.sun.proxy.$Proxy208.getContentStream(Unknown Source) at gov.ohio.jfs.wotcweb.actions.DisplayFileNETDocuments.execute(DisplayFileNETDocuments.java:131) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449) at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1235) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478) at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:143) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:78) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:969) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1109) at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4144) at com.ibm.ws.webcontainer.webapp.WebAppImpl.handleRequest(WebAppImpl.java:2208) at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1030) at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1817) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:382) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:532) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:318) at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:88) at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175) at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775) at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)
The FileNET Error Log indicates this:
[10/7/21 10:18:37:541 EDT] 000000c1 DALP8Exceptio E com.ibm.ecm.cmis.dal.p8.DALP8ExceptionHandler handleException null
...ANSWER
Answered 2021-Oct-19 at 21:22I figured out the problem!
For the 3rd argument, I had " ", when I should have had "null".
Now it works!
j.
QUESTION
I am working on configuring Web SSO using SAML2 on WebSphere Application Server with PingFederate as IDP.
What I have done is,
- Download and install WebSphere Application Server and the version is 9.0.0.5
- Installed a Sample Web Application for test.
- Configure WebSphere Trust Association Interceptor for SAML based on this document, https://www.ibm.com/docs/en/was/9.0.5?topic=users-saml-web-single-sign.
- Verify Connection by using an IDP-initiated SSO and got an "INTERNAL ERROR: Please contact your support." issue.
I can see that a SAML response is sent from IDP to WebSphere and the server sends a successful response but I cannot figure out why users cannot be redirected to the Target URL. I have set the debug level to fine and cannot find any error. Additionally, the error URL also does not work.
After I add an "&TARGET=TARGETURL" behind the SSO link it can redirect the user to the "TARGETURL" after the SAML SSO however the relay state should be handled by SP rather than IDP.
I wonder did I make some mistakes or miss some configurations that caused this issue.
Also, I uploaded part of trace log which should be the part that it receive SAML response from the IDP.
...ANSWER
Answered 2021-Sep-21 at 16:16How is the targetUrl configured on the WAS side? There are three different ways that WAS can determine its targetUrl. In order of precedence:
- From the WASSamlSpReqUrl cookie generated on step 3 of a "bookmark style" login as described on this page: https://www.ibm.com/docs/en/was/9.0.5?topic=sign-saml-single-scenarios-features-limitations
- From the RelayState parameter sent by the IdP
- From the sso_.sp.targetUrl parameter
The following trace specification will show details about how the targetUrl is being determined:
=info:com.ibm.ws.security.web.=all:com.ibm.ws.security.saml.=all:com.ibm.websphere.wssecurity.=all:com.ibm.ws.wssecurity.=all:com.ibm.ws.wssecurity.platform.audit.=off
If you have a trace with that specification please feel free to upload it here and I'd be happy to take a look as well.
Also just as a side-note, I would recommend updating to the latest WAS fixpack if possible. There have been some logging improvements to the SAML runtime that might be helpful for this type of situation.
QUESTION
I am trying to Upgrade from sqljdbc4.jar to sqljdbc4.2.jar as JDBC driver on WebSphere 8.5 running on Java 8 but when starting my application I am getting the following exception :
...ANSWER
Answered 2021-May-24 at 11:50Assuming this is the SQL Server JDBC driver, try using a newer version (e.g. current latest is 9.2.1), and see if that resolves the problem.
Alternatively, given your application server already provides JAXB, you could also try excluding the JAXB dependency from being pulled in again through the driver.
QUESTION
I am trying to implement TLS 1.2 from Websphere Application Server v9.0.5.6 to Oracle 19c Database. Both the WAS and Oracle are on different Virtual Machines running on Centos 7. Used Websphere provided IBM Java 8 and Oracle provided ojdbc8.jar (from Oracle 19c Client). Non-ssl connection is working fine from WAS console.
I have done the following to implement TLS 1.2.
- Used this link and completed the Oracle Database side SSL configuration. For testing I even made the client side configuration on WAS vm and tested using sqlplus (with oracle user and oracle 19c client) and I was able to connect and get TCPS as provided in this query.
- Then I added the Oracle DB self-signed certificates to 'WAS_HOME/AppServer/profiles/AppSrv01/etc/trust.p12'. I used iKeyman for adding the DB certificate to WAS. Then added the custom property in datasource ‘connectionProperties’ with values javax.net.ssl.trustStore=WAS_HOME/AppServer/profiles/AppSrv01/etc/trust.p12; javax.net.ssl.trustStoreType=PKCS12; oracle.net.ssl_version=1.2; javax.net.ssl.trustStorePassword=***
- Instead of point 2, I also tried JKS. Added the Oracle DB self-signed certificates to 'WAS_HOME/AppServer/java/8.0/jre/lib/security/cacerts'. I used iKeyman for adding the DB certificate to WAS. Then added the custom property in datasource ‘connectionProperties’ with values javax.net.ssl.keyStore= WAS_HOME/AppServer/java/8.0/jre/lib/security/cacerts; javax.net.ssl.keyStoreType=JKS; oracle.net.ssl_version=1.2; javax.net.ssl.keyStorePassword=***
I enabled the debug logs and in both the scenarios I am getting the error 'java.security.SignatureException: Signature length not correct: got 128 but was expecting 256'
Can anyone pls suggest on the error or how TLS 1.2 from WAS to Oracle DB can be successfully achieved?
Sysout Logs
...ANSWER
Answered 2021-Apr-06 at 17:50Steps
Following is my setup, though setup should not make a difference for achieving TLS 1.2.
WAS v9.0.5.6 on Centos VM1. WAS installed with ‘user1’. Used Websphere provided IBM Java 8.
Oracle Client 19c on same Centos VM1. Oracle client installed with ‘oracle’ user.
Oracle Database 19c on Centos VM2. Database installed with ‘oracle’ user.Used this link to complete the server and client side certificate configuration. Generated and exchanged the self-signed certificates on/between server and client as given in the instructions. For testing keep the password free from special characters. I have seen issues when password contains special characters.
On Oracle Client host (Centos VM1 for me) convert Oracle PKCS12 to Java Key Store. I used the below command with ‘oracle’ user.
orapki wallet pkcs12_to_jks -wallet "/home/oracle/wallet" -pwd abcd123 -jksKeyStoreLoc "/home/oracle/jkswallet/ewallet.jks" -jksKeyStorepwd abcd123
Change the permission of “home/oracle/jkswallet” and “home/oracle/jkswallet/ewallet.jks" to 755 so that its accessible for ‘user1’ running WAS on same server.
On WAS create a normal ‘JDBC provider’ using ojdbc8.jar. No other jar is needed. Create a ‘Data source’ using the earlier created JDBC provider. Along with Data source also create ‘JAAS - J2C authentication data’ for username and password.
I used the following url format in ‘Data source’
jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCPS)(HOST=172.16.77.11)(PORT=2484)))(CONNECT_DATA=(SERVICE_NAME=PROD01PDB)))
Add a property in the ‘Custom properties’ under your ‘Data Source’
Name:connectionProperties
Value:javax.net.ssl.keyStore=/home/oracle/jkswallet/ewallet.jks; javax.net.ssl.keyStoreType=JKS; javax.net.ssl.keyStorePassword=abcd123; javax.net.ssl.trustStore=/home/oracle/jkswallet/ewallet.jks; javax.net.ssl.trustStoreType=JKS; javax.net.ssl.trustStorePassword=abcd123; oracle.net.ssl_version=1.2; oracle.net.ssl_server_dn_match=false
Finally the trimmed Debug Log
QUESTION
I have a Java application deployed on Websphere 8.5, and I am using hibernate-core-4.2.21.Final and hibernate-jpa-2.0-api-1.0.1.Final.
I use websphere datasource to connect to the database. Sometimes the application is unable to open connections to the datasource, and I get the error :
...ANSWER
Answered 2021-Mar-18 at 09:13Your application isleaking connections, and not returning them properly to the datasource.
You can use WebSphere PMI (perf monitoring infrastructure) to monitor your datasource. Most probably you will see many 'creates' but no 'closes' of the connections.
You can also enable connection leak logic trace to see where the connections are being held: https://www.ibm.com/support/pages/how-troubleshoot-j2ca0045e-connection-pooling-problems
In Trace Specification, enter the following string:
ConnLeakLogic=all
Few additional comments to your application design:
- Do not use Hibernate - WebSphere already provides JPA provider and you should code to JPA API and not use Hibernate objects. Use JPA like this - https://openliberty.io/guides/jpa-intro.html
- Do not manage transactions manually - you should rely on container to manage your transactions. Handling transactions by hand is error prone.
QUESTION
In my webapp supplyAsync method uses forkjoin pool in cloud linux environments but in local linux machines same code uses threads like thread-1 thread-2 with class web app class loader. Is there any configuration to change the default threadpool for completable futures.I want to get the local behaviour in cloud. Thread with a web app class loader. java version java 11, tomcat version 8.5.24.
...ANSWER
Answered 2021-Mar-19 at 08:58Whether CompletableFuture
uses a new thread per task or ForkJoinPool
depends on the parallelism level of your system:
All async methods without an explicit Executor argument are performed using the ForkJoinPool.commonPool() (unless it does not support a parallelism level of at least two, in which case, a new Thread is created to run each task).
(cf. Javadoc).
The default parallelism level is one less than the number of processors, but you can change it to any value setting the system property java.util.concurrent.ForkJoinPool.common.parallelism
(cf. ForkJoinPool
).
However I would rather use a custom Executor
, as in the comments to this and your previous question. The fact that newly created threads inherit the current thread context class loader, while the common pool doesn't, should be considered more as an implementation detail. Your code should work correctly in both cases.
QUESTION
I am now trying not to capture the same error in a log when the below script runs. The script is running every 5 minutes. The goal is to store the last time the log was checked with a time stamp. If there is no new entry (of the same error) when the script runs then there is nothing to do. (shouldn't send an Email) Else it should send an Email.
Thank you in advance for your time
...ANSWER
Answered 2021-Feb-03 at 18:33Let's start with your revamp with the While
loop... you were so close! When PowerShell evaluates a comparison it uses the type of the left hand object to perform the comparison. In your case you have:
QUESTION
We are using spring integration(spring-integration-core:jar:5.0.14.RELEASE) in our project. Our application is working fine in JBOSS 7 EAP. Now we want to make it compatible with Websphere 9 Application sever. We are getting the following error when we deploy the application in Websphere 9 and try to access it. It appears that there is some problem with int-xml:xslt-transformer . Any incompatible XSLT processors causing this issue? Any help on how to proceed further to fix this problem would be appreciated. Thanks in advance.
...ANSWER
Answered 2020-Oct-14 at 17:31After some research, found the following:
The issue is resolved by changing the default XSLT processor to XSLT interpreter.
For this:
Go to Servers -> Application servers -> [Server_Name] -> Proces Definition -> Java and Process Management -> Java Virtual Machine
In this section add the following argument: "-Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl" to the input labelled "Generic JVM arguments"
Submit the form by clicking the "OK" button, then commit changes by clicking the "Save" link. This change needs a restart of IBM WebSphere Application Server to take effect.
QUESTION
I'm trying to execute three different prepared statements inside a function which basically does an insert in three different tables.
File registration.java
...ANSWER
Answered 2020-Jul-28 at 18:23Next time, when you want to know the JDBC version, just do "java -jar ojdbc8.jar". Also, as suggested, it is better to use the latest driver. If you have atleast JDK8 then you can use 19.7 even when your database is 12c. You can get JDBC drivers from [Central Maven] or can download them from here.
QUESTION
When I try to start the webshere server 8.5, I get the following error:
...ANSWER
Answered 2020-May-27 at 22:19Assuming that you are trying to implement your custom user registry by class com.vmd.common.test.userregistry.DummyVmdUserRegistry
, which you didn't describe in the question, you have to put that class to the AppServer\lib\ext
folder, as it clearly cannot be found right now by server infrastructure.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install asyncfuture
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page