You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by tarun patel <ta...@gmail.com> on 2017/07/16 07:04:31 UTC

How to access Apache Ignite service grid services from a J2ee application server

Hi team,
I am trying to use Apache Ignite for  project and I am trying to access the
apache-ignite service-grid services, which are exposed through the service
nodes from out side the cluster from an application deployed on a J2ee
application server .
Looking through the documentation and research I did in this regard I could
not find any way of achieving this.
Will this integration be achievable?
If not what would be the best approach to get data from Ignite services to
a J2ee app .

Re: How to access Apache Ignite service grid services from a J2ee application server

Posted by Evgenii Zhuravlev <e....@gmail.com>.
Hi,

Have you tried to use TcpDiscoveryVmIpFinder instead of
TcpDiscoveryMulticastIpFinder
?

Evgenii



2017-07-29 12:20 GMT+03:00 tmp <ta...@gmail.com>:

> Thanks for the node on singleton bean, i did so and it seems to be
> responding
> now.
>
> Please NOTE that I am using " -Djava.net.preferIPv4Stack=true" for all my
> nodes viz: data-node,service-node and the j2ee -app server which is running
> the singelton-bean.
>
> However I  STILL keep seeing the below logs continuously on my
> Ignite-Data-Node.
>
> "[14:46:38,876][ERROR][tcp-disco-ip-finder-cleaner-#211%
> myIgniteDataGrid%][TcpDiscoveryMulticastIpFinder]
> Failed to request nodes addresses.
> java.net.SocketException: Can't assign requested address (Error setting
> socket option)
>         at java.net.PlainDatagramSocketImpl.socketSetOption0(Native
> Method)
>         at
> java.net.PlainDatagramSocketImpl.socketSetOption(
> PlainDatagramSocketImpl.java:74)
>         at
> java.net.AbstractPlainDatagramSocketImpl.setOption(
> AbstractPlainDatagramSocketImpl.java:309)
>         at java.net.MulticastSocket.setInterface(MulticastSocket.java:471)
>         at
> org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.
> TcpDiscoveryMulticastIpFinder.requestAddresses(
> TcpDiscoveryMulticastIpFinder.java:565)
>         at
> org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.
> TcpDiscoveryMulticastIpFinder.getRegisteredAddresses(
> TcpDiscoveryMulticastIpFinder.java:454)
>         at
> org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.registeredAddresses(
> TcpDiscoverySpi.java:1711)
>         at
> org.apache.ignite.spi.discovery.tcp.ServerImpl$
> IpFinderCleaner.cleanIpFinder(ServerImpl.java:1837)
>         at
> org.apache.ignite.spi.discovery.tcp.ServerImpl$IpFinderCleaner.body(
> ServerImpl.java:1812)
>         at org.apache.ignite.spi.IgniteSpiThread.run(
> IgniteSpiThread.java:62)
> "
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/How-to-access-Apache-Ignite-service-
> grid-services-from-a-J2ee-application-server-tp14970p15799.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Re: How to access Apache Ignite service grid services from a J2ee application server

Posted by tmp <ta...@gmail.com>.
Thanks for the node on singleton bean, i did so and it seems to be responding
now. 

Please NOTE that I am using " -Djava.net.preferIPv4Stack=true" for all my
nodes viz: data-node,service-node and the j2ee -app server which is running
the singelton-bean. 

However I  STILL keep seeing the below logs continuously on my
Ignite-Data-Node. 

"[14:46:38,876][ERROR][tcp-disco-ip-finder-cleaner-#211%myIgniteDataGrid%][TcpDiscoveryMulticastIpFinder]
Failed to request nodes addresses.
java.net.SocketException: Can't assign requested address (Error setting
socket option)
	at java.net.PlainDatagramSocketImpl.socketSetOption0(Native Method)
	at
java.net.PlainDatagramSocketImpl.socketSetOption(PlainDatagramSocketImpl.java:74)
	at
java.net.AbstractPlainDatagramSocketImpl.setOption(AbstractPlainDatagramSocketImpl.java:309)
	at java.net.MulticastSocket.setInterface(MulticastSocket.java:471)
	at
org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder.requestAddresses(TcpDiscoveryMulticastIpFinder.java:565)
	at
org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder.getRegisteredAddresses(TcpDiscoveryMulticastIpFinder.java:454)
	at
org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.registeredAddresses(TcpDiscoverySpi.java:1711)
	at
org.apache.ignite.spi.discovery.tcp.ServerImpl$IpFinderCleaner.cleanIpFinder(ServerImpl.java:1837)
	at
org.apache.ignite.spi.discovery.tcp.ServerImpl$IpFinderCleaner.body(ServerImpl.java:1812)
	at org.apache.ignite.spi.IgniteSpiThread.run(IgniteSpiThread.java:62)
"



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-to-access-Apache-Ignite-service-grid-services-from-a-J2ee-application-server-tp14970p15799.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: How to access Apache Ignite service grid services from a J2ee application server

Posted by Alexander Fedotov <al...@gmail.com>.
Make sure that you are creating an Ignite client within a singleton bean.

Kind regards,
Alex.

On Mon, Jul 17, 2017 at 11:32 AM, Alexander Fedotov <
alexander.fedotoff@gmail.com> wrote:

> Could you describe or share the code where and how you create Ignite
> client?
>
> Kind regards,
> Alex
>
> 16 июля 2017 г. 11:32 AM пользователь "krutipatel" <
> krutipatel1892@gmail.com> написал:
>
> When I try to access using service-proxy through a client-mode ignite from
> within the J2ee app. The app is stuck to receive the data from the service
> proxy instance. On the service node I am getting the below exception: Caused
> by: javax.cache.CacheException: class org.apache.ignite.IgniteInterruptedException:
> Got interrupted while waiting for future to complete. at
> org.apache.ignite.internal.processors.cache.GridCacheUtils.c
> onvertToCacheException(GridCacheUtils.java:1421) at
> org.apache.ignite.internal.processors.cache.IgniteCacheProxy
> .cacheException(IgniteCacheProxy.java:2641) at
> org.apache.ignite.internal.processors.cache.IgniteCacheProxy
> .get(IgniteCacheProxy.java:1205) at app.ds.cnfg.mgr.service.impl.C
> omponentServiceImpl.getComponent(ComponentServiceImpl.java:46) ... 20
> more On the Data Node I am seeing intermittent below exception, however I
> have still not identified any pattern on when all this occurs:
> [13:42:57,009][ERROR][tcp-disco-ip-finder-cleaner-#5%null%][TcpDiscoveryMulticastIpFinder]
> Failed to request nodes addresses. java.net.SocketException: Can't assign
> requested address (Error setting socket option) at java.net
> .PlainDatagramSocketImpl.socketSetOption0(Native Method) at java.net
> .PlainDatagramSocketImpl.socketSetOption(PlainDatagramSocketImpl.java:74)
> at java.net.AbstractPlainDatagramSocketImpl.setOption(AbstractP
> lainDatagramSocketImpl.java:309) at java.net.MulticastSocket.setIn
> terface(MulticastSocket.java:471) at org.apache.ignite.spi.discover
> y.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder.reque
> stAddresses(TcpDiscoveryMulticastIpFinder.java:565) at
> org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDi
> scoveryMulticastIpFinder.getRegisteredAddresses(TcpDiscoveryMulticastIpFinder.java:454)
> at org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.register
> edAddresses(TcpDiscoverySpi.java:1711) at org.apache.ignite.spi.discover
> y.tcp.ServerImpl$IpFinderCleaner.cleanIpFinder(ServerImpl.java:1837) at
> org.apache.ignite.spi.discovery.tcp.ServerImpl$IpFinderCleaner.body(ServerImpl.java:1812)
> at org.apache.ignite.spi.IgniteSpiThread.run(IgniteSpiThread.java:62)
> ------------------------------
> View this message in context: Re: How to access Apache Ignite service
> grid services from a J2ee application server
> <http://apache-ignite-users.70518.x6.nabble.com/How-to-access-Apache-Ignite-service-grid-services-from-a-J2ee-application-server-tp14970p14979.html>
> Sent from the Apache Ignite Users mailing list archive
> <http://apache-ignite-users.70518.x6.nabble.com/> at Nabble.com.
>
>
>

Re: How to access Apache Ignite service grid services from a J2ee application server

Posted by Alexander Fedotov <al...@gmail.com>.
Could you describe or share the code where and how you create Ignite client?

Kind regards,
Alex

16 июля 2017 г. 11:32 AM пользователь "krutipatel" <kr...@gmail.com>
написал:

When I try to access using service-proxy through a client-mode ignite from
within the J2ee app. The app is stuck to receive the data from the service
proxy instance. On the service node I am getting the below exception: Caused
by: javax.cache.CacheException: class
org.apache.ignite.IgniteInterruptedException:
Got interrupted while waiting for future to complete. at
org.apache.ignite.internal.processors.cache.GridCacheUtils.
convertToCacheException(GridCacheUtils.java:1421) at
org.apache.ignite.internal.processors.cache.IgniteCacheProxy.cacheException(IgniteCacheProxy.java:2641)
at org.apache.ignite.internal.processors.cache.IgniteCacheProxy.get(IgniteCacheProxy.java:1205)
at app.ds.cnfg.mgr.service.impl.ComponentServiceImpl.getComponent(ComponentServiceImpl.java:46)
... 20 more On the Data Node I am seeing intermittent below exception,
however I have still not identified any pattern on when all this occurs:
[13:42:57,009][ERROR][tcp-disco-ip-finder-cleaner-#5%null%][TcpDiscoveryMulticastIpFinder]
Failed to request nodes addresses. java.net.SocketException: Can't assign
requested address (Error setting socket option) at java.net.
PlainDatagramSocketImpl.socketSetOption0(Native Method) at java.net.
PlainDatagramSocketImpl.socketSetOption(PlainDatagramSocketImpl.java:74) at
java.net.AbstractPlainDatagramSocketImpl.setOption(
AbstractPlainDatagramSocketImpl.java:309) at java.net.MulticastSocket.
setInterface(MulticastSocket.java:471) at org.apache.ignite.spi.
discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder.
requestAddresses(TcpDiscoveryMulticastIpFinder.java:565) at
org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.
TcpDiscoveryMulticastIpFinder.getRegisteredAddresses(
TcpDiscoveryMulticastIpFinder.java:454) at org.apache.ignite.spi.
discovery.tcp.TcpDiscoverySpi.registeredAddresses(TcpDiscoverySpi.java:1711)
at org.apache.ignite.spi.discovery.tcp.ServerImpl$
IpFinderCleaner.cleanIpFinder(ServerImpl.java:1837) at
org.apache.ignite.spi.discovery.tcp.ServerImpl$IpFinderCleaner.body(ServerImpl.java:1812)
at org.apache.ignite.spi.IgniteSpiThread.run(IgniteSpiThread.java:62)
------------------------------
View this message in context: Re: How to access Apache Ignite service grid
services from a J2ee application server
<http://apache-ignite-users.70518.x6.nabble.com/How-to-access-Apache-Ignite-service-grid-services-from-a-J2ee-application-server-tp14970p14979.html>
Sent from the Apache Ignite Users mailing list archive
<http://apache-ignite-users.70518.x6.nabble.com/> at Nabble.com.

Re: How to access Apache Ignite service grid services from a J2ee application server

Posted by krutipatel <kr...@gmail.com>.
When I try to access using service-proxy through a client-mode ignite from
within the J2ee app.The app is stuck to receive the data from the service
proxy instance. On the service node I am getting the below exception:Caused
by: javax.cache.CacheException: class
org.apache.ignite.IgniteInterruptedException: Got interrupted while waiting
for future to complete.	at
org.apache.ignite.internal.processors.cache.GridCacheUtils.convertToCacheException(GridCacheUtils.java:1421)at
org.apache.ignite.internal.processors.cache.IgniteCacheProxy.cacheException(IgniteCacheProxy.java:2641)
at
org.apache.ignite.internal.processors.cache.IgniteCacheProxy.get(IgniteCacheProxy.java:1205)
at
app.ds.cnfg.mgr.service.impl.ComponentServiceImpl.getComponent(ComponentServiceImpl.java:46)
... 20 more On the Data Node I am seeing intermittent below exception,
however I have still not identified any pattern on when all this occurs:
[13:42:57,009][ERROR][tcp-disco-ip-finder-cleaner-#5%null%][TcpDiscoveryMulticastIpFinder]
Failed to request nodes addresses.java.net.SocketException: Can't assign
requested address (Error setting socket option)	at
java.net.PlainDatagramSocketImpl.socketSetOption0(Native Method)	at
java.net.PlainDatagramSocketImpl.socketSetOption(PlainDatagramSocketImpl.java:74)
at
java.net.AbstractPlainDatagramSocketImpl.setOption(AbstractPlainDatagramSocketImpl.java:309)
at java.net.MulticastSocket.setInterface(MulticastSocket.java:471)	at
org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder.requestAddresses(TcpDiscoveryMulticastIpFinder.java:565)
at
org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder.getRegisteredAddresses(TcpDiscoveryMulticastIpFinder.java:454)
at
org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.registeredAddresses(TcpDiscoverySpi.java:1711)
at
org.apache.ignite.spi.discovery.tcp.ServerImpl$IpFinderCleaner.cleanIpFinder(ServerImpl.java:1837)
at
org.apache.ignite.spi.discovery.tcp.ServerImpl$IpFinderCleaner.body(ServerImpl.java:1812)
at org.apache.ignite.spi.IgniteSpiThread.run(IgniteSpiThread.java:62)



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-to-access-Apache-Ignite-service-grid-services-from-a-J2ee-application-server-tp14970p14979.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: How to access Apache Ignite service grid services from a J2ee application server

Posted by afedotov <al...@gmail.com>.
Well, before you request a service proxy you need to get an Ignite instance
first so there is no way to avoid creating that Ignite instance somewhere.
Do you anticipate/observe any problems with this approach?

Kind regards,
Alex

16 июля 2017 г. 10:46 AM пользователь "krutipatel [via Apache Ignite
Users]" <ml...@n6.nabble.com> написал:

Hi Alex,
Thanks for the info , i have read through and tried using service-proxy .
However to an instance of the service proxy first i need to get an access
to the "ignite" instance-object which i can only get through
"Ignition.start()" which internally triggers off a different tread. I want
to avoid this different tread being triggered.
So basically if i can get an instance of "ignite" or "serviceproxy" without
doing "Ignition.start()" that should solve the problem. Is there a way to
do this?

------------------------------
If you reply to this email, your message will be added to the discussion
below:
http://apache-ignite-users.70518.x6.nabble.com/How-to-
access-Apache-Ignite-service-grid-services-from-a-J2ee-application-server-
tp14970p14977.html
To start a new topic under Apache Ignite Users, email
ml+s70518n1h65@n6.nabble.com
To unsubscribe from Apache Ignite Users, click here
<http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1&code=YWxleGFuZGVyLmZlZG90b2ZmQGdtYWlsLmNvbXwxfC0xMzYxNTU0NTg=>
.
NAML
<http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-to-access-Apache-Ignite-service-grid-services-from-a-J2ee-application-server-tp14970p14978.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: How to access Apache Ignite service grid services from a J2ee application server

Posted by krutipatel <kr...@gmail.com>.
Hi Alex,
Thanks for the info , i have read through and tried using service-proxy .
However to an instance of the service proxy first i need to get an access to
the "ignite" instance-object which i can only get through "Ignition.start()"
which internally triggers off a different tread. I want to avoid this
different tread being triggered. 
So basically if i can get an instance of "ignite" or "serviceproxy" without
doing "Ignition.start()" that should solve the problem. Is there a way to do
this? 



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-to-access-Apache-Ignite-service-grid-services-from-a-J2ee-application-server-tp14970p14977.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: How to access Apache Ignite service grid services from a J2ee application server

Posted by Alexander Fedotov <al...@gmail.com>.
Posting from the duplicate thread

I am trying to access services that i have exposed over the apache-ignite
service-grid from out side the ignite-cluster.
I am trying to access them from a J2ee application running on a Wildfly10
j2ee application server.
However when i am trying to use the services-proxy api , it is starting a
new ignite-specific jvm from within my application-server and the 2 jvm are
running .

IS there a way to expose service-grid services to outside ignite-cluster ?
If not what would be the best/recommended way of accessing apache-service
grid from outside the ignite-cluster.

Kind regards,
Alex

16 июля 2017 г. 10:25 AM пользователь "afedotov" <
alexander.fedotoff@gmail.com> написал:

Hi,

Have you tried using ServiceProxy from an Ignite client running inside your
J2EE app?
Please check
https://apacheignite.readme.io/docs/service-example#section-service-proxy

Kind regards,
Alex

16 июля 2017 г. 10:04 AM пользователь "tmp [via Apache Ignite Users]" <[hidden
email] <http:///user/SendEmail.jtp?type=node&node=14974&i=0>> написал:

Hi team,
I am trying to use Apache Ignite for  project and I am trying to access the
apache-ignite service-grid services, which are exposed through the service
nodes from out side the cluster from an application deployed on a J2ee
application server .
Looking through the documentation and research I did in this regard I could
not find any way of achieving this.
Will this integration be achievable?
If not what would be the best approach to get data from Ignite services to
a J2ee app .


------------------------------
If you reply to this email, your message will be added to the discussion
below:
http://apache-ignite-users.70518.x6.nabble.com/How-to-access
-Apache-Ignite-service-grid-services-from-a-J2ee-applicati
on-server-tp14970.html
To start a new topic under Apache Ignite Users, email [hidden email]
<http:///user/SendEmail.jtp?type=node&node=14974&i=1>
To unsubscribe from Apache Ignite Users, click here.
NAML
<http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>



------------------------------
View this message in context: Re: How to access Apache Ignite service grid
services from a J2ee application server
<http://apache-ignite-users.70518.x6.nabble.com/How-to-access-Apache-Ignite-service-grid-services-from-a-J2ee-application-server-tp14970p14974.html>
Sent from the Apache Ignite Users mailing list archive
<http://apache-ignite-users.70518.x6.nabble.com/> at Nabble.com.

Re: How to access Apache Ignite service grid services from a J2ee application server

Posted by afedotov <al...@gmail.com>.
Hi,

Have you tried using ServiceProxy from an Ignite client running inside your
J2EE app?
Please check
https://apacheignite.readme.io/docs/service-example#section-service-proxy

Kind regards,
Alex

16 июля 2017 г. 10:04 AM пользователь "tmp [via Apache Ignite Users]" <
ml+s70518n14970h4@n6.nabble.com> написал:

Hi team,
I am trying to use Apache Ignite for  project and I am trying to access the
apache-ignite service-grid services, which are exposed through the service
nodes from out side the cluster from an application deployed on a J2ee
application server .
Looking through the documentation and research I did in this regard I could
not find any way of achieving this.
Will this integration be achievable?
If not what would be the best approach to get data from Ignite services to
a J2ee app .


------------------------------
If you reply to this email, your message will be added to the discussion
below:
http://apache-ignite-users.70518.x6.nabble.com/How-to-
access-Apache-Ignite-service-grid-services-from-a-J2ee-
application-server-tp14970.html
To start a new topic under Apache Ignite Users, email
ml+s70518n1h65@n6.nabble.com
To unsubscribe from Apache Ignite Users, click here
<http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1&code=YWxleGFuZGVyLmZlZG90b2ZmQGdtYWlsLmNvbXwxfC0xMzYxNTU0NTg=>
.
NAML
<http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-to-access-Apache-Ignite-service-grid-services-from-a-J2ee-application-server-tp14970p14974.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.