mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.1 to HEAD
13037: PostgreSQL upgrade scripts from 2.1.6, 2.2.0, and 2.2.1 12995: Fix build: account for change of path to log4j jar in 3rd party project 12981: Added support for monitoring of installed modules via JMX 12971: Correction to 12970 - better handle case when log4j not available. 12970: Work around log4j bug to allow editing of the "threshold" property of HierarchyDynamicBean through JMX 12926: Merged V3.0 to V3.1 Merged V2.2 to V3.0 12861: ETHREEOH-19, ETHREEOH-24, ETHREEOH-113, ETHREEOH-115, ETHREEOH-449, ETHREEOH-537, ETHREEOH-561, ETHREEOH-566, ETHREEOH-572, ETHREEOH-1072: Retry failed transactions from MS SQL Server in snapshot mode 12924: Avoid direct log4j dependencies 12918: Avoided Log4J imports by using introspection git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13516 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -86,8 +86,6 @@
|
||||
<property name="server" ref="alfrescoMBeanServer"/>
|
||||
<property name="beans">
|
||||
<map>
|
||||
<!-- MBeans to register with alfrescoMBeanServer -->
|
||||
<entry key="Alfresco:Name=Log4jHierarchy,Type=Log4JHierarchy" value-ref="log4jHierarchy"/>
|
||||
<!-- Used by Alfresco WCM Virtualisation server -->
|
||||
<entry key="Alfresco:Name=VirtServerRegistry,Type=VirtServerRegistry" value-ref="VirtServerRegistry"/>
|
||||
</map>
|
||||
@@ -130,9 +128,6 @@
|
||||
<property name="nfsServer"><ref bean="nfsServer"/></property>
|
||||
</bean>
|
||||
|
||||
<!-- Log4J Hierarchy -->
|
||||
<bean id="log4jHierarchy" class="org.apache.log4j.jmx.HierarchyDynamicMBean"/>
|
||||
|
||||
<!-- This bean will attempt to export extra beans to log4jHierarchy's MBeanServer, so it's vital that the exporter has been initialised -->
|
||||
<bean id="log4JHierarchyInit" class="org.alfresco.repo.admin.Log4JHierarchyInit" depends-on="exporter" init-method="init">
|
||||
<property name="log4jHierarchy" ref="log4jHierarchy"/>
|
||||
|
@@ -38,10 +38,13 @@ import net.sf.acegisecurity.providers.dao.User;
|
||||
import org.alfresco.repo.tenant.TenantService;
|
||||
import org.alfresco.service.cmr.security.PermissionService;
|
||||
import org.alfresco.util.EqualsHelper;
|
||||
import org.alfresco.util.log.NDC;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.log4j.NDC;
|
||||
|
||||
/**
|
||||
* Utility helper methods to change the authenticated context for threads.
|
||||
*/
|
||||
public abstract class AuthenticationUtil
|
||||
{
|
||||
static Log s_logger = LogFactory.getLog(AuthenticationUtil.class);
|
||||
|
@@ -48,6 +48,7 @@ import org.hibernate.StaleStateException;
|
||||
import org.hibernate.cache.CacheException;
|
||||
import org.hibernate.exception.ConstraintViolationException;
|
||||
import org.hibernate.exception.LockAcquisitionException;
|
||||
import org.hibernate.exception.SQLGrammarException;
|
||||
import org.springframework.aop.MethodBeforeAdvice;
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.dao.ConcurrencyFailureException;
|
||||
@@ -101,7 +102,8 @@ public class RetryingTransactionHelper
|
||||
StaleStateException.class,
|
||||
ObjectNotFoundException.class,
|
||||
CacheException.class, // Usually a cache replication issue
|
||||
RemoteCacheException.class // A cache replication issue
|
||||
RemoteCacheException.class, // A cache replication issue
|
||||
SQLGrammarException.class // Actually specific to MS SQL Server 2005 - we check for this
|
||||
};
|
||||
}
|
||||
|
||||
@@ -456,16 +458,14 @@ public class RetryingTransactionHelper
|
||||
public static Throwable extractRetryCause(Throwable cause)
|
||||
{
|
||||
Throwable retryCause = ExceptionStackUtil.getCause(cause, RETRY_EXCEPTIONS);
|
||||
if (retryCause == null)
|
||||
if (retryCause == null || retryCause instanceof SQLGrammarException
|
||||
&& ((SQLGrammarException) retryCause).getErrorCode() != 3960)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
// A simple match
|
||||
return retryCause;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method to get the active transaction. The transaction status can be queried and
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2008 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2009 Alfresco Software Limited.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -80,6 +80,8 @@ public class Main
|
||||
/**
|
||||
* Creates a new instance of this tool..
|
||||
*
|
||||
* @param contextPath
|
||||
* path to the context xml file
|
||||
* @throws SQLException
|
||||
* the SQL exception
|
||||
* @throws IOException
|
||||
@@ -94,12 +96,12 @@ public class Main
|
||||
* the no such field exception
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Main() throws SQLException, IOException, InstantiationException, IllegalAccessException,
|
||||
public Main(final String contextPath) throws SQLException, IOException, InstantiationException, IllegalAccessException,
|
||||
ClassNotFoundException, NoSuchFieldException
|
||||
{
|
||||
final ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]
|
||||
{
|
||||
"classpath:/org/alfresco/extension/dump-context.xml"
|
||||
"file:" + contextPath
|
||||
});
|
||||
final DataSource datasource = (DataSource) context.getBean("dataSource");
|
||||
this.con = datasource.getConnection();
|
||||
@@ -142,7 +144,13 @@ public class Main
|
||||
*/
|
||||
public static void main(final String[] args) throws Exception
|
||||
{
|
||||
final NamedElementCollection result = new Main().execute();
|
||||
if (args.length != 2)
|
||||
{
|
||||
System.out.println("Usage:");
|
||||
System.out.println("java " + Main.class.getName() + " <context.xml> <output.xml>");
|
||||
System.exit(1);
|
||||
}
|
||||
final NamedElementCollection result = new Main(args[0]).execute();
|
||||
|
||||
// Set up a SAX TransformerHandler for outputting XML
|
||||
final SAXTransformerFactory stf = (SAXTransformerFactory) TransformerFactory.newInstance();
|
||||
@@ -157,7 +165,7 @@ public class Main
|
||||
// It was worth a try
|
||||
}
|
||||
t.setOutputProperty(OutputKeys.INDENT, "yes");
|
||||
xmlOut.setResult(new StreamResult(args[0]));
|
||||
xmlOut.setResult(new StreamResult(args[1]));
|
||||
|
||||
xmlOut.startDocument();
|
||||
result.output(xmlOut);
|
||||
|
Reference in New Issue
Block a user