Unexpexted exception

classic Classic list List threaded Threaded
21 messages Options
12
kajzur kajzur
Reply | Threaded
Open this post in threaded view
|

Unexpexted exception

Hi!
I'm trying to setup a "Web Session Clustering" in Tomcat 7. I followed by http://apacheignite.gridgain.org/v1.5/docs/web-session-clustering with replicated cacheMode. And I'm getting an exception:
class org.apache.ignite.IgniteException: Cache for web sessions is not started (is it configured?): replicated
	at org.apache.ignite.cache.websession.WebSessionFilter.init(WebSessionFilter.java:235)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4908)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5602)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:679)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:554)
	at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1779)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
	at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1506)
	at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:902)
	at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:361)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:614)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)

And this is my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
    <servlet>
        <servlet-name>Login</servlet-name>
        <servlet-class>pl.ocb.Login</servlet-class>
    </servlet>
    <servlet>
        <servlet-name>Logout</servlet-name>
        <servlet-class>pl.ocb.Logout</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>Login</servlet-name>
        <url-pattern>/login</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>Logout</servlet-name>
        <url-pattern>/logout</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <listener>
        <listener-class>org.apache.ignite.startup.servlet.ServletContextListenerStartup</listener-class>
    </listener>

    <filter>
        <filter-name>IgniteWebSessionsFilter</filter-name>
        <filter-class>org.apache.ignite.cache.websession.WebSessionFilter</filter-class>
    </filter>

    <!-- You can also specify a custom URL pattern. -->
    <filter-mapping>
        <filter-name>IgniteWebSessionsFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <!-- Specify Ignite configuration (relative to META-INF folder or Ignite_HOME). -->
    <context-param>
        <param-name>IgniteConfigurationFilePath</param-name>
        <param-value>config/default-config.xml </param-value>
    </context-param>

    <!-- Specify the name of Ignite cache for web sessions. -->
    <context-param>
        <param-name>IgniteWebSessionsCacheName</param-name>
        <param-value>replicated</param-value>
    </context-param>

</web-app>

and my default-config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd">
    <!--
        Alter configuration below as needed.
    -->
    
    <bean class="org.apache.ignite.configuration.CacheConfiguration">
        <!-- Cache name. --> 
        <property name="cacheMode" value="REPLICATED"/>
<!--        <property name="backups" value="1"/>-->
 
    </bean>
    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
        <property name="discoverySpi">
            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                <property name="ipFinder">
                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
                        <property name="addresses">
                            <list>
              
                                <!-- 
                                    IP Address and optional port range.
                                    You can also optionally specify an individual port.
                                -->
                                <value>192.168.5.15:47500..47509</value>
                            </list>
                        </property>
                    </bean>
                </property>
            </bean>
        </property>
    </bean>
</beans>


And ofcourse my pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>pl.flomedia</groupId>
    <artifactId>OCB</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>

    <name>OCB</name>

    <properties>
        <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    
    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-core</artifactId>
            <version>1.5.0.final</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-web</artifactId>
            <version>1.5.0.final</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-log4j</artifactId>
            <version>1.5.0.final</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-spring</artifactId>
            <version>1.5.0.final</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <compilerArguments>
                        <endorseddirs>${endorsed.dir}</endorseddirs>
                    </compilerArguments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${endorsed.dir}</outputDirectory>
                            <silent>true</silent>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>javax</groupId>
                                    <artifactId>javaee-endorsed-api</artifactId>
                                    <version>7.0</version>
                                    <type>jar</type>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

I will be very grateful if some one could help me with it :)

Best regards!
Roman Shtykh Roman Shtykh
Reply | Threaded
Open this post in threaded view
|

Re: Unexpexted exception

How about adding
<property name="name" value="replicated"/>
to CacheConfiguration in your default-config.xml?

-Roman



On Tuesday, May 10, 2016 3:13 AM, kajzur <[hidden email]> wrote:


Hi!
I'm trying to setup a "Web Session Clustering" in Tomcat 7. I followed by
http://apacheignite.gridgain.org/v1.5/docs/web-session-clustering with
replicated cacheMode. And I'm getting an exception:


And this is my web.xml:


and my default-config.xml:


And ofcourse my pom.xml:


I will be very grateful if some one could help me with it :)

Best regards!



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Unexpexted-exception-tp4847.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


kajzur kajzur
Reply | Threaded
Open this post in threaded view
|

Re: Unexpexted exception

Hi!
Thanks for response, but is still the same error :(
Roman Shtykh Roman Shtykh
Reply | Threaded
Open this post in threaded view
|

Re: Unexpexted exception

It is possible to see the full log? As the error message says, grid is not started.

-Roman



On Wednesday, May 11, 2016 12:14 AM, kajzur <[hidden email]> wrote:


Hi!
Thanks for response, but is still the same error :(



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Unexpexted-exception-tp4847p4863.html

Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Roman Shtykh Roman Shtykh
Reply | Threaded
Open this post in threaded view
|

Re: Unexpexted exception

I think you have to
1. Have <property name="cacheConfiguration"> with your CacheConfiguration inside IgniteConfiguration in your default-config.xml
2. Have <property name="gridName" value="some_gridName"/> in your default-config.xml and specify the grid name with IgniteWebSessionsGridName at web.xml

-Roman

kajzur kajzur
Reply | Threaded
Open this post in threaded view
|

Re: Unexpexted exception

Hi,
thank, now it's working, but now I have other problem.

All is working but my session isn't saved. I have HttpSession object and in one servler setting an attr and in other servler I trying to get this attr and it's not there. I checked in debugger - my session is WebSession from ingniter.

Have you got, maybe, aby idea, why it's not working?

I have four servers:
[18:13:58,879][INFO][disco-event-worker-#44%null%][GridDiscoveryManager] Topology snapshot [ver=148, servers=4, clients=0, CPUs=6, heap=4.7GB]
Roman Shtykh Roman Shtykh
Reply | Threaded
Open this post in threaded view
|

Re: Unexpexted exception

Hi,

Do you have an MRE on github or elsewhere I can reproduce it?

-Roman



On Thursday, May 12, 2016 3:23 AM, kajzur <[hidden email]> wrote:


Hi,
thank, now it's working, but now I have other problem.

All is working but my session isn't saved. I have HttpSession object and in
one servler setting an attr and in other servler I trying to get this attr
and it's not there. I checked in debugger - my session is WebSession from
ingniter.

Have you got, maybe, aby idea, why it's not working?

I have four servers:
[18:13:58,879][INFO][disco-event-worker-#44%null%][GridDiscoveryManager]
Topology snapshot [ver=148, servers=4, clients=0, CPUs=6, heap=4.7GB]




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Unexpexted-exception-tp4847p4879.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.



kajzur kajzur
Reply | Threaded
Open this post in threaded view
|

Re: Unexpexted exception

What is MRE? Whole code of project? Repository on github?
Alexey Kuznetsov Alexey Kuznetsov
Reply | Threaded
Open this post in threaded view
|

Re: Unexpexted exception

MRE - minimal reproducible example
This may be a simple project with a couple of files.

On Thu, May 12, 2016 at 10:31 PM, kajzur <[hidden email]> wrote:
What is MRE? Whole code of project? Repository on github?



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Unexpexted-exception-tp4847p4900.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.



--
Alexey Kuznetsov
GridGain Systems
www.gridgain.com
vkulichenko vkulichenko
Reply | Threaded
Open this post in threaded view
|

Re: Unexpexted exception

kajzur kajzur
Reply | Threaded
Open this post in threaded view
|

Re: Unexpexted exception

Hi,
thanks for response. This is link for git repository - https://gitlab.com/kajzur/temp.git - repository has no access restrictions, so every one can clone it.

My config is in first mail :)

Thanks!
Roman Shtykh Roman Shtykh
Reply | Threaded
Open this post in threaded view
|

Re: Unexpexted exception

Hi,

Your Externalizable StringWrapper does not have a default constructor and is not saved.

Please enable logging to see the error messages.

-Roman



On Friday, May 13, 2016 8:36 PM, kajzur <[hidden email]> wrote:


Hi,
thanks for response. This is link for git repository -
https://gitlab.com/kajzur/temp.git - repository has no access restrictions,
so every one can clone it.

My config is in first mail :)

Thanks!



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Unexpexted-exception-tp4847p4929.html

Sent from the Apache Ignite Users mailing list archive at Nabble.com.


kajzur kajzur
Reply | Threaded
Open this post in threaded view
|

Re: Unexpexted exception

I have added default constructor but it still not working. How to enable logs?
vkulichenko vkulichenko
Reply | Threaded
Open this post in threaded view
|

Re: Unexpexted exception

What is not working? Do you still have the original issue? Did you see my response on SO?

-Val
kajzur kajzur
Reply | Threaded
Open this post in threaded view
|

Re: Unexpexted exception

Yes of course, I have seen your answer - I have accepted it.

Yes it still the same issue, all node's are working but session is no stored.
vkulichenko vkulichenko
Reply | Threaded
Open this post in threaded view
|

Re: Unexpexted exception

Are there any exceptions or errors? Please check both client and server logs.

-Val
kajzur kajzur
Reply | Threaded
Open this post in threaded view
|

Re: Unexpexted exception

Client (no clientMode):
http://pastebin.com/kmQ41aqJ

and server (one from three servers):
http://pastebin.com/3Y9D36rf
kajzur kajzur
Reply | Threaded
Open this post in threaded view
|

Re: Unexpexted exception

I turn on logs and I have an message:
[14:45:41,764][WARN ][http-bio-8080-exec-11][root] Failed to apply updates for session (will retry): 109FAEC0CB2406A7AE6E9143C8CB7CB6
[14:45:41,770][WARN ][http-bio-8080-exec-11][root] Failed to apply updates for session (will retry): 109FAEC0CB2406A7AE6E9143C8CB7CB6
[14:45:41,776][WARN ][http-bio-8080-exec-11][root] Failed to apply updates for session (will retry): 109FAEC0CB2406A7AE6E9143C8CB7CB6
[14:45:41,781][WARN ][http-bio-8080-exec-11][root] Failed to apply updates for session (will retry): 109FAEC0CB2406A7AE6E9143C8CB7CB6
[14:45:41,788][WARN ][http-bio-8080-exec-11][root] Failed to apply updates for session (will retry): 109FAEC0CB2406A7AE6E9143C8CB7CB6
[14:45:41,798][WARN ][http-bio-8080-exec-11][root] Failed to apply updates for session (will retry): 109FAEC0CB2406A7AE6E9143C8CB7CB6
[14:45:41,805][WARN ][http-bio-8080-exec-11][root] Failed to apply updates for session (will retry): 109FAEC0CB2406A7AE6E9143C8CB7CB6
[14:45:41,812][WARN ][http-bio-8080-exec-11][root] Failed to apply updates for session (will retry): 109FAEC0CB2406A7AE6E9143C8CB7CB6
[14:45:41,824][WARN ][http-bio-8080-exec-11][root] Failed to apply updates for session (will retry): 109FAEC0CB2406A7AE6E9143C8CB7CB6
[14:45:41,850][WARN ][http-bio-8080-exec-11][root] Failed to apply updates for session (will retry): 109FAEC0CB2406A7AE6E9143C8CB7CB6
[14:45:41,873][WARN ][http-bio-8080-exec-11][root] Failed to apply updates for session (will retry): 109FAEC0CB2406A7AE6E9143C8CB7CB6
[14:45:41,885][WARN ][http-bio-8080-exec-11][root] Failed to apply updates for session (will retry): 109FAEC0CB2406A7AE6E9143C8CB7CB6
[14:45:41,898][WARN ][http-bio-8080-exec-11][root] Failed to apply updates for session (will retry): 109FAEC0CB2406A7AE6E9143C8CB7CB6
[14:45:41,909][WARN ][http-bio-8080-exec-11][root] Failed to apply updates for session (will retry): 109FAEC0CB2406A7AE6E9143C8CB7CB6
[14:45:41,916][WARN ][http-bio-8080-exec-11][root] Failed to apply updates for session (will retry): 109FAEC0CB2406A7AE6E9143C8CB7CB6
[14:45:41,928][WARN ][http-bio-8080-exec-11][root] Failed to apply updates for session (maximum number of retries exceeded) [sesId=109FAEC0CB2406A7AE6E9143C8CB7CB6, retries=25]
vkulichenko vkulichenko
Reply | Threaded
Open this post in threaded view
|

Re: Unexpexted exception

There is some exception exception happening during the cache update. Due to a bug in the code it's lost and actual reason is not shown. I just fixed this in master, can you build from there and try? There trace should appear in the log.

You can also wait for a nightly build which should be available tomorrow. It can be downloaded from here: https://builds.apache.org/view/H-L/view/Ignite/job/Ignite-nightly/lastSuccessfulBuild/

-Val
kajzur kajzur
Reply | Threaded
Open this post in threaded view
|

Re: Unexpexted exception

Hi,

I downloaded version 1.6.0 from https://ignite.apache.org/download.cgi and all is working! :)

What was wrong?

Thanks for your help!
12