Data is not persisted in ModeShape 3.8 - infinispan

Recently I started working on a project using ModeShape 3.8 and Infinispan 5.3. Original developer already left without any documentation. Application is working fine unless it is not restarted. All data was lost as soon as it is shutdown. May be some transient repository but not sure.
In the pom.xml
modeshape-jcr
modeshape-jcr-api
modeshape-schematic
modeshape-bom-embedded
infinispan-core
In the repo.json
{
"name":"repo",
"workspaces":{
"default":"default",
"allowCreation":true
},
"security":{"providers" : [
{
"name" : "Custom Provider",
"classname" : "security.CustomRepoAuthProvider"
}
]
},
"storage":{
"cacheConfiguration":"/conf/infinispan-conf.xml",
"cacheName":"filesystem"
}
}
In the infinispan-conf.xml
http://www.infinispan.org/schemas/infinispan-config-5.3.xsd">
<global>
<globalJmxStatistics enabled="false" allowDuplicateDomains="true"/>
</global>
<namedCache name="filesystem">
<transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" transactionMode="TRANSACTIONAL" lockingMode="OPTIMISTIC"/>
<loaders passivation="false" shared="false" preload="true">
<fileStore fetchPersistentState="true" purgerThreads="3" purgeSynchronously="true" ignoreModifications="false" purgeOnStartup="false" location="/lfs/enve/apps/tomcat/temp/">
<async enabled="true" flushLockTimeout="15000" threadPoolSize="5" />
<singletonStore enabled="true" pushStateWhenCoordinator="true" pushStateTimeout="20000" />
</fileStore>
</loaders>
</namedCache>
Any body help me???

In the infinispan-conf.xml made following changes
http://www.infinispan.org/schemas/infinispan-config-5.3.xsd">
<global>
<globalJmxStatistics enabled="false" allowDuplicateDomains="true"/>
</global>
<namedCache name="filesystem">
<locking isolationLevel="READ_COMMITTED"/>
<transaction
transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup"
transactionMode="TRANSACTIONAL"
lockingMode="PESSIMISTIC"/>
<loaders
passivation="false"
shared="false"
preload="true">
<loader
class="org.infinispan.loaders.file.FileCacheStore"
fetchPersistentState="true"
ignoreModifications="false"
purgeOnStartup="false">
<properties>
<property name="location" value="/lfs/envd/apps/tomcat/temp/"/>
</properties>
</loader>
</loaders>
</namedCache>

Your file store is writing to "/lfs/enve/apps/tomcat/temp/"
My guess is that you are deleting the temp directory when you are restarting tomcat. You would need to make sure to write it to a more "permanent" directory.

Related

Issue in 2 node cluster using infinispan 5.3 | ActionStatus.ABORT_ONLY > is not in a valid state to be invoking cache operations on

I have a setup of 2 node cluster using Infinispan 5.3. I am testing the failover scenario. When I killed one node, i'm getting the below exception (I'm using the sync cache). The cluster is not getting. So I need to restart the application, which is not practically possible in production environment
2020-05-06 18:50:28,082 ERROR [org.infinispan.interceptors.InvocationContextInterceptor] ISPN000136: Execution error
java.lang.IllegalStateException: Transaction TransactionImple < ac, BasicAction: -3f57f478:dd0a:5eb2b455:2d461 status: ActionStatus.ABORT_ONLY > is not in a valid state to be invoking cache operations on.
at org.infinispan.interceptors.TxInterceptor.enlist(TxInterceptor.java:275)
at org.infinispan.interceptors.TxInterceptor.enlistIfNeeded(TxInterceptor.java:239)
at org.infinispan.interceptors.TxInterceptor.enlistReadAndInvokeNext(TxInterceptor.java:233)
at org.infinispan.interceptors.TxInterceptor.visitGetKeyValueCommand(TxInterceptor.java:229)
at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:62)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:120)
at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:134)
at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:96)
at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:62)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:120)
at org.infinispan.statetransfer.StateTransferInterceptor.handleTopologyAffectedCommand(StateTransferInterceptor.java:216)
at org.infinispan.statetransfer.StateTransferInterceptor.handleDefault(StateTransferInterceptor.java:200)
at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:96)
at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:62)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:120)
at org.infinispan.interceptors.CacheMgmtInterceptor.visitGetKeyValueCommand(CacheMgmtInterceptor.java:113)
at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:62)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:120)
at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:134)
at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:96)
at org.infinispan.interceptors.IsMarshallableInterceptor.visitGetKeyValueCommand(IsMarshallableInterceptor.java:97)
at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:62)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:120)
at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:128)
at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:92)
at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:96)
at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:62)
at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:343)
at org.infinispan.CacheImpl.containsKey(CacheImpl.java:372)
at org.infinispan.DecoratedCache.containsKey(DecoratedCache.java:410)
at com.abcr.ServiceContext.existsInSyncCache(ServiceContext.java:1740)
at com.abcr.ServiceContext.getObjectForUpdateInSyncCache(ServiceContext.java:1778)
at com.abcr.core.cache.ClusterServiceNodeListCacheManager.getObjectForUpdate(ClusterServiceNodeListCacheManager.java:90)
at com.suntecgroup.tbms.tpe.core.server.ServerManager.callBackOnMembersModified(ServerManager.java:3385)
at com.abcr.core.ServiceContainerCommandDespatcher.run(ServiceContainerCommandDespatcher.java:64)
2020-05-06 18:50:28,086 ERROR [com.abcr.core.ServiceContainer] Invocation of callback APIs on leaving coordinator role failed for service 'ABC'.
com.suntecgroup.tbms.container.services.ContainerPlatformServicesException: Failed to retrieve object[SERVER/SERVICE_NODES/28000] for update.
This my infinspan and jgroups configuration
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:5.3 http://www.infinispan.org/schemas/infinispan-config-5.3.xsd"
xmlns="urn:infinispan:config:5.3">
<global>
<!-- Note that if these are left blank, defaults are used. See the user guide for what these defaults are -->
<asyncListenerExecutor factory="org.infinispan.executors.DefaultExecutorFactory">
<properties>
<property name="maxThreads" value="5" />
<property name="threadNamePrefix" value="AsyncListenerThread" />
</properties>
</asyncListenerExecutor>
<asyncTransportExecutor factory="org.infinispan.executors.DefaultExecutorFactory">
<properties>
<property name="maxThreads" value="25" />
<property name="threadNamePrefix" value="AsyncSerializationThread" />
</properties>
</asyncTransportExecutor>
<evictionScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
<properties>
<property name="threadNamePrefix" value="EvictionThread" />
</properties>
</evictionScheduledExecutor>
<replicationQueueScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
<properties>
<property name="threadNamePrefix" value="ReplicationQueueThread" />
</properties>
</replicationQueueScheduledExecutor>
<globalJmxStatistics enabled="false" jmxDomain="infinispan_1" />
<!--
If the transport is omitted, there is no way to create distributed or clustered caches.
There is no added cost to defining a transport but not creating a cache that uses one, since the transport
is created and initialized lazily.
-->
<transport clusterName="PC_SITE_1" distributedSyncTimeout="50000" transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport">
<properties>
<property name="configurationFile" value="./tmp/_clusterconfig/pc_jgroups_main_sync.xml" />
</properties>
</transport>
<!-- Note that the JGroups transport uses sensible defaults if no configuration property is defined. -->
<!-- See the JGroupsTransport javadocs for more flags -->
<!-- Again, sensible defaults are used here if this is omitted. -->
<serialization marshallerClass="org.infinispan.marshall.VersionAwareMarshaller" version="1.0" />
<!--
Used to register JVM shutdown hooks.
hookBehavior: DEFAULT, REGISTER, DONT_REGISTER
-->
<shutdown hookBehavior="DEFAULT" />
</global>
<!-- *************************** -->
<!-- Default "template" settings -->
<!-- *************************** -->
<!-- this is used as a "template" configuration for all caches in the system. -->
<default>
<!--
isolation levels supported: READ_COMMITTED and REPEATABLE_READ
-->
<locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="60000" writeSkewCheck="false" concurrencyLevel="5000" useLockStriping="false" />
<!--
Used to register a transaction manager and participate in ongoing transactions.
-->
<!-- ECPCacheTxManagerLookup -->
<!--
Used to register JMX statistics in any available MBean server
-->
<jmxStatistics enabled="false" />
<!--
Used to enable invocation batching and allow the use of Cache.startBatch()/endBatch() methods.
-->
<clustering mode="replication">
<sync replTimeout="600000" />
<stateTransfer timeout="480000" fetchInMemoryState="true" />
</clustering>
<storeAsBinary enabled="true" />
</default>
<namedCache name="GLOBAL_SYNC_CACHE">
<transaction transactionMode="TRANSACTIONAL" transactionManagerLookupClass="com.suntecgroup.tbms.container.services.cluster.ContainerCacheTxManagerLookup" syncRollbackPhase="false" syncCommitPhase="true" useEagerLocking="true" lockingMode="PESSIMISTIC" />
</namedCache>
<namedCache name="GLOBAL_NONTX_SYNC_CACHE">
<transaction transactionMode="NON_TRANSACTIONAL" />
</namedCache>
</infinispan>
JGROUPS configuration..
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="urn:org:jgroups" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:org:jgroups file:schema/JGroups-2.8.xsd">
<TCP bind_port="7800" loopback="true" recv_buf_size="20M" send_buf_size="640K" max_bundle_size="64000" max_bundle_timeout="30" enable_bundling="false" use_send_queues="true" sock_conn_timeout="300" tcp_nodelay="true" thread_pool.enabled="true" thread_pool.min_threads="1" thread_pool.max_threads="25" thread_pool.keep_alive_time="5000" thread_pool.queue_enabled="false" thread_pool.queue_max_size="100" thread_pool.rejection_policy="run" oob_thread_pool.enabled="true" oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="8" oob_thread_pool.keep_alive_time="5000" oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="100" oob_thread_pool.rejection_policy="run" enable_diagnostics="false" />
<!--MPING mcast_addr="232.1.2.13"
mcast_port="7500"
num_initial_members="2"
timeout="2000" /-->
<TCPPING timeout="3000" initial_hosts="${jgroups.tcpping.initial_hosts:localhost[7800],localhost[7801]}" port_range="0" num_initial_members="3" />
<MERGE2 max_interval="100000" min_interval="20000" />
<FD_SOCK />
<FD timeout="60000" max_tries="5" />
<VERIFY_SUSPECT timeout="30000" />
<BARRIER />
<pbcast.NAKACK use_mcast_xmit="false" exponential_backoff="500" discard_delivered_msgs="true" />
<UNICAST timeout="300,600,1200" />
<pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000" max_bytes="400000" />
<pbcast.GMS print_local_addr="false" join_timeout="3000" view_bundling="true" />
FRAG2 frag_size="60000"
pbcast.STATE_TRANSFER
</config>
Current transaction was aborted (probably due to a timeout, but maybe as a consequence of delivery failure). You need to rollback current transaction and start new.
However let me note that 5.3 was released 2013/06/26 - you're using almost 7 years old version. If there is a bug, no-one will even try to check it out.

Error during storage in a File [Infinispan] [org.infinispan.commons.CacheConfigurationException:]

in my application im using infinispan to manage my data, and now i want to save my data in a flat file and it doesn't work.
here is my infinispan conf file :
http://infinispan.org/schemas/infinispan-config-9.3.xsd"
xmlns="urn:infinispan:config:9.3">
<loaders passivation="false" shared="false" preload="true">
<loader class="org.infinispan.loaders.file.FileCacheStore" fetchPersistentState="true"
ignoreModifications="false" purgeOnStartup="false">
<properties>
<property name="location" value="C:\infinispan-4.0.0.FINAL\store"/>
</properties>
</loader>
</loaders>
</namedCache>
when i run my class , i encounter this error :
org.infinispan.commons.CacheConfigurationException: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[4,35]
Message: Unexpected element '{urn:infinispan:config:9.3}namedCache' encountered
Have you any idea please ?
You are using an old configuration format which we have abandoned since Infinispan 7.0. For 9.3 you should use something like the following:
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:9.3 http://www.infinispan.org/schemas/infinispan-config-9.3.xsd"
xmlns="urn:infinispan:config:9.3">
<cache-container default-cache="local">
<local-cache name="local">
<persistence>
<file-store path="path" shared="false" purge="false"/>
</persistence>
</local-cache>
</cache-container>
</infinispan>

setup installer script in magento module

Hi i am developing a little magento module.
below is my directory structure of module
app/code/local/Xyz/Total
/var/www/magext/app/code/local/Xyz/Total/Block/Prototal.php
/var/www/magext/app/code/local/Xyz/Total/controllers/IndexController.php
/var/www/magext/app/code/local/Xyz/Total/etc/config.xml
/var/www/magext/app/code/local/Xyz/Total/Model/Price/Observer.php
below is my config file code
<?xml version="1.0"?>
<config>
<global>
<blocks>
<total>
<class>Xyz_Total_Block</class>
</total>
</blocks>
<models>
<xyztotal>
<class>Xyz_Total_Model</class>
</xyztotal>
</models>
<events>
<sales_order_place_after>
<observers>
<xyz_total_price_observer>
<type>singleton</type>
<class>Xyz_Total_Model_Price_Observer</class>
<method>apply_discount_percent</method>
</xyz_total_price_observer>
</observers>
</sales_order_place_after>
</events>
</global>
<frontend>
<routers>
<total>
<use>standard</use>
<args>
<module>Xyz_Total</module>
<frontName>newcatalog</frontName>
</args>
</total>
</routers>
<layout>
<updates>
<total>
<file>total.xml</file>
</total>
</updates>
</layout>
</frontend>
</config>
now what i need to install a product attribute through my module
.But i cant understand understand where should i put my installer
script and how to modify config file.
please suggest.
I saw your config.xml i am not able to find xml vesrion.
So you need to give xml version like below example:
<config>
<modules>
<Xyz_Total>
<version>0.1.0</version> <!-- Version of module -->
</Xyz_Total>
</modules>
</config>
Now create the file app/code/local/Xyz/Total/sql/total_setup/mysql4-install-0.1.0.ph‌​p
After that reinstall the module And check it.
You also have to add below code in config.xml under config tag.
<global>
<resources> <!-- These are resource setting giving access to module, read/write permission on database -->
<total_setup>
<setup>
<module>Xyz_Total</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</total_setup>
<total_write>
<connection>
<use>core_write</use>
</connection>
</total_write>
<total_read>
<connection>
<use>core_read</use>
</connection>
</total_read>
</resources>
</global>
After that reinstall module.
Take a look # Adding custom product attributes in Magento using setup script
<modules>
<Xyz_Total>
<version>0.1.0</version>
</Xyz_Total>
</modules>
<global>
....
<models>
<xyztotal>
<class>Xyz_Total_Model</class>
<resourceModel>total_setup</resourceModel>
</xyztotal>
</models>
<resources>
<catalog_setup>
<setup>
<module>Mage_Catalog</module>
<class>Mage_Catalog_Model_Resource_Setup</class><!-- that line !-->
</setup>
</catalog_setup>
</resources>
...
In
app/code/local/Xyz/Total/sql/total_setup/mysql4-install-0.1.0.ph‌​p
$installer->addAttribute('catalog_product', 'offer_type', array(
'backend' => '',
...
));

Unable to add a core in Solr 3.6

I'm trying to add multiple cores in solr 3.6 but i'm unable to do it. I wrote the following in solr.xml file
<solr persistent="true" sharedLib="lib">
<cores adminPath="/admin/cores" defaultCoreName="collection1">
<core name="collection1" instanceDir="." />
</cores>
<core name="core1" instanceDir="./core1">
<property name="dataDir" value="./core1/data" />
</core>
</solr>
core1 is the new core i want to create, I copied the config folder of the default core into core1, when I try to access localhost:8983/solr/core1/admin I get 404 error.
New core should be defined within the cores tag :-
<solr persistent="true" sharedLib="lib">
<cores adminPath="/admin/cores" defaultCoreName="collection1">
<core name="collection1" instanceDir="." />
<core name="core1" instanceDir="./core1">
<property name="dataDir" value="./core1/data" />
</core>
</cores>
</solr>

Problems getting Tiles work with Struts2

I'm using struts 2.2.1 and tiles 2.2.2. I've done every step described here but I cannot get tiles work... I get the following error while deploying my war to glassfish 3.1:
[#|2011-10-04T08:43:28.117+0200|SEVERE|glassfish3.1|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=74;_ThreadName=AutoDeployer;|Exception while invoking class com.sun.enterprise.web.WebApplication start method
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: java.lang.ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:130)
In my WEB-INF/lib I've got commons-collections-3.1.jar, commons-fileupload-1.2.1.jar, struts2-core-2.2.1.jar, tiles-api-2.2.2.jar, tiles-core-2.2.2.jar, tiles-jsp-2.2.2.jar and xwork-core-2.2.1.jar.
This is my struts.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.devMode" value="true" />
<package name="basicstruts2" extends="struts-default">
<interceptors>
<interceptor-stack name="appDefault">
<interceptor-ref name="defaultStack">
<param name="exception.logEnabled">true</param>
<param name="exception.logLevel">ERROR</param>
</interceptor-ref>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="appDefault" />
<result-types>
<result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult" />
</result-types>
<global-results>
<result name="exception">/jsp/exceptions/exception.jsp</result>
<result name="webServiceException">/jsp/exceptions/webserviceexception.jsp</result>
</global-results>
<global-exception-mappings>
<exception-mapping exception="java.lang.Exception" result="exception" />
<exception-mapping exception="java.io.IOException" result="exception" />
<exception-mapping exception="exceptions.WebServiceExceptionForStruts"
result="webServiceException" />
</global-exception-mappings>
<action name="tilesTest" class="test.action.TilesTest">
<result name="success" type="tiles">/welcome.tiles</result>
</action>
<action name="index">
<result>/jsp/index.jsp</result>
</action>
</package>
</struts>
After inserting the code into my struts.xml, I get this error in eclipse:
And this is my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Consumer</display-name>
<welcome-file-list>
<welcome-file>/jsp/index.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>
<context-param>
<param-name>tilesDefinitions</param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>
</web-app>
Thank you very much!
You're missing the S2 tiles plugin. It's listed in the referenced article.
Your second issue with the XML is clearly stated in the IDE error; the order of elements given in the error message isn't the order you define the elements in your XML file.
ClassNotFoundException, looks like missing jar issue. Can you see the tiles plugin jar in war that is getting deployed on glassfish server.if not check check the war creation setting in you IDE. We faced this problem when it was not pushing jars from lib to the war.
ClassNotFoundException Always alerts you that some class/jar which is referenced is missing. Make sure you have all the basic jars required for tiles.
In my case, I have these jars (besides struts2 jars) in my struts2 application to test a demo tile project.
commons-beanutils-1.7.0.jar
commons-digester-2.0.jar
commons-logging-1.1.1.jar
commons-logging-api-1.1.jar
ognl-3.0.1.jar
slf4j-api-1.6.2.jar
slf4j-simple-1.6.2.jar
struts2-tiles-plugin-2.2.3.1.jar
tiles-api-2.2.2.jar
tiles-compat-2.2.2.jar
tiles-core-2.2.2.jar
tiles-jsp-2.2.2.jar
tiles-servlet-2.2.2.jar
tiles-template-2.2.2.jar
Best of luck.
Regards,
Amir Ali