From 9d01327960b0531da64ae3ffd1b39592830dd425 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Tue, 27 Feb 2018 08:54:36 +0100 Subject: some more updates are required to support postgresql databases --- .../config/ConfigurationProvider.java | 26 ++++++++++------ id/server/doc/handbook/config/config.html | 3 ++ id/server/doc/handbook/install/install.html | 6 ++-- .../moa/id/config/ConfigurationProviderImpl.java | 3 ++ .../egovernment/moa/id/commons/MOAIDConstants.java | 3 +- .../config/persistence/MOAIDConfigurationImpl.java | 13 ++++---- .../db/dao/config/AbstractConfigProperty.java | 23 +++++++++++--- .../id/commons/db/dao/config/ConfigProperty.java | 11 ++++--- .../db/dao/config/ConfigPropertyByteValues.java | 16 ++++++---- .../db/dao/config/DatabaseConfigPropertyImpl.java | 22 +++++++++---- .../db/dao/session/AuthenticatedSessionStore.java | 11 ++++--- .../src/main/resources/configuration.beans.xml | 36 ++++++++++++---------- .../moa/id/auth/MOAIDAuthSpringInitializer.java | 10 +++--- pom.xml | 1 - 14 files changed, 118 insertions(+), 66 deletions(-) diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java index 8aab7ef06..abde2089d 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java @@ -35,6 +35,7 @@ import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.cert.CertificateException; import java.util.ArrayList; +import java.util.Arrays; import java.util.Properties; import java.util.Timer; import java.util.jar.Attributes; @@ -52,9 +53,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.AutowireCapableBeanFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; -import org.springframework.web.context.support.GenericWebApplicationContext; +import org.springframework.context.support.GenericApplicationContext; -import at.gv.egovernment.moa.id.commons.config.SpringProfileConstants; import at.gv.egovernment.moa.id.commons.db.NewConfigurationDBRead; import at.gv.egovernment.moa.id.commons.ex.MOAHttpProtocolSocketFactoryException; import at.gv.egovernment.moa.id.commons.utils.MOAHttpProtocolSocketFactory; @@ -91,7 +91,7 @@ public class ConfigurationProvider { private boolean pvp2logininitialzied = false; - private ApplicationContext context = null; + private ClassPathXmlApplicationContext context = null; private MOAIDConfigurationModul configModule = null; private NewConfigurationDBRead deprecatedDBRead = null; private FileBasedUserConfiguration userManagement = null; @@ -140,13 +140,15 @@ public class ConfigurationProvider { fis.close(); //initialize generic SpringContext to set profiles - GenericWebApplicationContext rootContext = new GenericWebApplicationContext(); - if (Boolean.valueOf(props.getProperty("configuration.database.byteBasedValues", "false"))) - activeProfiles.add(SpringProfileConstants.BYTEBASEDCONFIG); - - log.info("Activate SpingProfiles: " + activeProfiles.toString()); - for (String el: activeProfiles) - rootContext.getEnvironment().addActiveProfile(el); + GenericApplicationContext rootContext = new GenericApplicationContext(); + +// if (Boolean.valueOf(props.getProperty("configuration.database.byteBasedValues", "false"))) +// activeProfiles.add(SpringProfileConstants.BYTEBASEDCONFIG); +// for (String el: activeProfiles) +// rootContext.getEnvironment().addActiveProfile(el); + + //refresh generic context + rootContext.refresh(); //initialize SpringContext context = new ClassPathXmlApplicationContext( @@ -155,6 +157,10 @@ public class ConfigurationProvider { "moaid.migration.beans.xml", "moaid.configurationtool.beans.xml" }, rootContext); + + + log.info("Spring-context was initialized with active profiles: " + + Arrays.asList(context.getEnvironment().getActiveProfiles())); //Autowire beans in these context AutowireCapableBeanFactory acbFactory = context.getAutowireCapableBeanFactory(); diff --git a/id/server/doc/handbook/config/config.html b/id/server/doc/handbook/config/config.html index 1972d2150..8b2f6a632 100644 --- a/id/server/doc/handbook/config/config.html +++ b/id/server/doc/handbook/config/config.html @@ -275,6 +275,8 @@ UNIX: -Duser.properties=file:C:/Programme/apache/tomcat-8.x.x/conf/moa-id-config

 

+

Hinweis: Defaultmäßig werden Konfigurationswerte textuell in der Datenbank abgelegt. Sollte es mit dem verwendeten Datenbank-Backend Probleme mit rein textueller Representation von Konfigurationswerten geben kann alternativ eine generische Datenrepresentation verwendet werden. Zur Aktivierung dieser generischen Datenrepresentation muss das Spring Profile byteBasedConfig siehe Kapitel Installation als System-Property gesetzt werden (z.B. -Dspring.profiles.active=byteBasedConfig).

+

 

Die Beispielkonfiguration beinhaltet noch zusätzliche Konfigurationsparameter für den Datenbankzugriff welche direkt aus der Beispielkonfiguration übernommen werden können. Eine detaillierte Beschreibung der einzelnen Einstellungsparameter kann der Hibernate Dokumention entnommen werden.

2.1.3 Initialisierung des Modules MOA-ID-Configuration

Für den ersten Start muss die Authentifizierung deaktiviert werden (siehe general.login.deaktivate Abschnitt 2.2.2.1). Anschließend kann die Benutzerverwaltung des Modules MOA-ID-Configuration unter der folgenden Adresse aufgerufen werden.

@@ -656,6 +658,7 @@ https://<host>:<port>/moa-id-auth/MonitoringServlet

 

+

Hinweis: Defaultmäßig werden Konfigurationswerte textuell in der Datenbank abgelegt. Sollte es mit dem verwendeten Datenbank-Backend Probleme mit rein textueller Representation von Konfigurationswerten geben kann alternativ eine generische Datenrepresentation verwendet werden. Zur Aktivierung dieser generischen Datenrepresentation muss das Spring Profile byteBasedConfig siehe Kapitel Installation als System-Property gesetzt werden (z.B. -Dspring.profiles.active=byteBasedConfig).

2.2.2.4.2 Session Informationen

Alle Parameter aus der Basiskonfiguration welche als Prefix moasession.hibernate. im Parameternamen aufweisen konfigurieren den Zugriff auf das Datenbank Schema in welchem MOA-ID-Auth die Session Informationen temporär ablegt. Eine Konfiguration dieser Parameter ist nicht optional.

diff --git a/id/server/doc/handbook/install/install.html b/id/server/doc/handbook/install/install.html index db96cda3c..bcd802b75 100644 --- a/id/server/doc/handbook/install/install.html +++ b/id/server/doc/handbook/install/install.html @@ -147,6 +147,7 @@
  • javax.net.ssl.trustStore: Pfad und Dateiname des Truststores für vertrauenswürdige SSL Zertifikate. Die SSL Serverzertifikate der Server von denen mittels https Dateien bezogen werden müssen im Truststore abgelegt werden. Ein relativer Pfad werden relativ zum Startverzeichnis der Java Virtual Machine interpretiert.
  • javax.net.ssl.trustStorePassword: Passwort für den Truststore (optional; nur, wenn SSL Client-Authentisierung durchgeführt werden soll).
  • javax.net.ssl.trustStoreType: Truststore-Typ (optional; nur, wenn SSL Client-Authentisierung durchgeführt werden soll). Je nach verwendetem Keystore-Typ muss jks (Java Key Store) oder pkcs12 (PKCS#12-Datei) angegeben werden.
  • +
  • spring.profiles.active: Set generic configuration parameters in MOA-ID-Auth Spring-Context. Configuartion values are added as comma-separated list (e.g. byteBasedConfig,value2,value3). Details on possible configuration values are in Chapter Configuration.
  • @@ -159,12 +160,13 @@
  • Folgende System Properties können gesetzt werden (wird beim Starten von Tomcat der Java Virtual Machine in der Umgebungsvariablen CATALINA_OPTS in der Form -D<name>=<wert> übergeben):
  • diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProviderImpl.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProviderImpl.java index 151eda89f..804b98a5f 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProviderImpl.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProviderImpl.java @@ -279,9 +279,12 @@ public abstract class ConfigurationProviderImpl implements ConfigurationProvider if (Boolean.valueOf(props.getProperty("configuration.database.byteBasedValues", "false"))) activeProfiles.add(SpringProfileConstants.BYTEBASEDCONFIG); + + } public String[] getActiveProfiles(){ + Logger.debug("Set active Spring-Profiles to: " + activeProfiles); return activeProfiles.toArray(new String[0]); } diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/MOAIDConstants.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/MOAIDConstants.java index 98f0616a5..436dcc91d 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/MOAIDConstants.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/MOAIDConstants.java @@ -134,7 +134,8 @@ public class MOAIDConstants { static { List jdbcDriverWorkaround = new ArrayList(); jdbcDriverWorkaround.add("oracle.jdbc."); - jdbcDriverWorkaround.add("com.microsoft.sqlserver."); + jdbcDriverWorkaround.add("com.microsoft.sqlserver."); + jdbcDriverWorkaround.add("org.postgresql."); JDBC_DRIVER_NEEDS_WORKAROUND = Collections.unmodifiableList(jdbcDriverWorkaround); } diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java index 4fd382606..4944813ad 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java @@ -1,6 +1,5 @@ package at.gv.egovernment.moa.id.commons.config.persistence; -import java.sql.SQLSyntaxErrorException; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; @@ -17,7 +16,7 @@ import at.gv.egiz.components.configuration.api.Configuration; import at.gv.egiz.components.configuration.api.ConfigurationException; import at.gv.egovernment.moa.id.commons.config.MOAIDConfigurationConstants; import at.gv.egovernment.moa.id.commons.db.dao.config.AbstractConfigProperty; -import at.gv.egovernment.moa.id.commons.db.dao.config.ConfigProperty; +//import at.gv.egovernment.moa.id.commons.db.dao.config.ConfigProperty; import at.gv.egovernment.moa.id.commons.db.dao.config.DatabaseConfigPropertyImpl; import at.gv.egovernment.moa.id.commons.utils.KeyValueUtils; import at.gv.egovernment.moa.logging.Logger; @@ -56,7 +55,7 @@ public class MOAIDConfigurationImpl extends DatabaseConfigPropertyImpl implement } - TypedQuery configQuery = em.createQuery("select dbconfig from ConfigProperty dbconfig where dbconfig.key like :key", AbstractConfigProperty.class); + TypedQuery configQuery = em.createQuery("select dbconfig from " + dataBaseEntityName + " dbconfig where dbconfig.key like :key", AbstractConfigProperty.class); configQuery.setParameter("key", preFix + "%"); List configResult = configQuery.getResultList(); @@ -94,7 +93,7 @@ public class MOAIDConfigurationImpl extends DatabaseConfigPropertyImpl implement } - TypedQuery configQuery = em.createQuery("select dbconfig from ConfigProperty dbconfig where dbconfig.key like :key", AbstractConfigProperty.class); + TypedQuery configQuery = em.createQuery("select dbconfig from " + dataBaseEntityName + " dbconfig where dbconfig.key like :key", AbstractConfigProperty.class); configQuery.setParameter("key", searchKey.replace("*", "%")); List configResult = configQuery.getResultList(); @@ -128,7 +127,7 @@ public class MOAIDConfigurationImpl extends DatabaseConfigPropertyImpl implement + MOAIDConfigurationConstants.SERVICE_UNIQUEIDENTIFIER; List oaSearchResult = null; - TypedQuery oaSearchQuery = em.createQuery("select dbconfig from ConfigProperty dbconfig where dbconfig.key like :key and dbconfig.value = SUBSTRING(:uniqueID, 1, LENGTH(dbconfig.value))", AbstractConfigProperty.class); + TypedQuery oaSearchQuery = em.createQuery("select dbconfig from " + dataBaseEntityName + " dbconfig where dbconfig.key like :key and dbconfig.value = SUBSTRING(:uniqueID, 1, LENGTH(dbconfig.value))", AbstractConfigProperty.class); oaSearchQuery.setParameter("key", keyId); oaSearchQuery.setParameter("uniqueID", publicURLPrefix); oaSearchResult = oaSearchQuery.getResultList(); @@ -159,7 +158,7 @@ public class MOAIDConfigurationImpl extends DatabaseConfigPropertyImpl implement List oaSearchResult = new ArrayList(); - TypedQuery oaSearchQuery = em.createQuery("select dbconfig from ConfigProperty dbconfig where dbconfig.key like :key", AbstractConfigProperty.class); + TypedQuery oaSearchQuery = em.createQuery("select dbconfig from " + dataBaseEntityName + " dbconfig where dbconfig.key like :key", AbstractConfigProperty.class); oaSearchQuery.setParameter("key", keyId); List intermResult = oaSearchQuery.getResultList(); if (intermResult != null) { @@ -224,7 +223,7 @@ public class MOAIDConfigurationImpl extends DatabaseConfigPropertyImpl implement String oaType = KeyValueUtils.getFirstChildAfterPrefix(oaIdKey, MOAIDConfigurationConstants.PREFIX_MOAID_SERVICES); String oaKey = KeyValueUtils.getPrefixFromKey(oaIdKey, MOAIDConfigurationConstants.SERVICE_UNIQUEIDENTIFIER); - TypedQuery oaConfigQuery = em.createQuery("select dbconfig from ConfigProperty dbconfig where dbconfig.key like :key", AbstractConfigProperty.class); + TypedQuery oaConfigQuery = em.createQuery("select dbconfig from " + dataBaseEntityName + " dbconfig where dbconfig.key like :key", AbstractConfigProperty.class); oaConfigQuery.setParameter("key", oaKey + ".%"); List oaConfigResult = oaConfigQuery.getResultList(); diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AbstractConfigProperty.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AbstractConfigProperty.java index d50aa9c6e..0d9a1bf8b 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AbstractConfigProperty.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AbstractConfigProperty.java @@ -8,6 +8,9 @@ import javax.persistence.MappedSuperclass; @MappedSuperclass public abstract class AbstractConfigProperty implements Serializable{ + + + /** * */ @@ -65,7 +68,7 @@ public abstract class AbstractConfigProperty implements Serializable{ return false; if (getClass() != obj.getClass()) return false; - ConfigProperty other = (ConfigProperty) obj; + AbstractConfigProperty other = (AbstractConfigProperty) obj; if (key == null) { if (other.key != null) return false; @@ -76,7 +79,7 @@ public abstract class AbstractConfigProperty implements Serializable{ public String toString() { StringBuilder builder = new StringBuilder(); - builder.append(getImpplementationName()); + builder.append(getImplementationName()); builder.append(" [key="); builder.append(getKey()); builder.append(", value="); @@ -86,9 +89,21 @@ public abstract class AbstractConfigProperty implements Serializable{ } /** - * Get a name for this Entity-Implementation for logging purposes + * Get a name for this Entity-Implementation class * * @return */ - abstract protected String getImpplementationName(); + protected String getImplementationName() { + return getImplementationClass().getSimpleName(); + + } + + /** + * Get get Class of the implemented Entity + * + * @return + */ + abstract protected Class getImplementationClass(); + + } \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigProperty.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigProperty.java index 07770fdf3..2cea90e7b 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigProperty.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigProperty.java @@ -14,8 +14,7 @@ import javax.persistence.Table; @Entity public class ConfigProperty extends AbstractConfigProperty{ - - + /** * */ @@ -46,9 +45,13 @@ public class ConfigProperty extends AbstractConfigProperty{ this.value = value; } + /* (non-Javadoc) + * @see at.gv.egovernment.moa.id.commons.db.dao.config.AbstractConfigProperty#getImplementationClass() + */ @Override - protected String getImpplementationName() { - return this.getClass().getName(); + protected Class getImplementationClass() { + return this.getClass(); + } } diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyByteValues.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyByteValues.java index 51f7e4da6..c31ca98ed 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyByteValues.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyByteValues.java @@ -1,11 +1,9 @@ package at.gv.egovernment.moa.id.commons.db.dao.config; import java.io.UnsupportedEncodingException; -import java.nio.charset.Charset; import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.Lob; import javax.persistence.Table; import at.gv.egovernment.moa.logging.Logger; @@ -27,7 +25,6 @@ public class ConfigPropertyByteValues extends AbstractConfigProperty{ private static final long serialVersionUID = 1L; - @Lob @Column(name = "propertyValueBytes") private byte[] value = null; @@ -58,7 +55,10 @@ public class ConfigPropertyByteValues extends AbstractConfigProperty{ @Override public void setValue(String value) { try { - this.value = value.getBytes("UTF-8"); + if (value == null) + this.value = null; + else + this.value = value.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { Logger.error("Internal DB write error! Can not read write to configuration DB.", e); @@ -66,8 +66,12 @@ public class ConfigPropertyByteValues extends AbstractConfigProperty{ } } + /* (non-Javadoc) + * @see at.gv.egovernment.moa.id.commons.db.dao.config.AbstractConfigProperty#getImplementationClass() + */ @Override - protected String getImpplementationName() { - return this.getClass().getName(); + protected Class getImplementationClass() { + return this.getClass(); + } } diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DatabaseConfigPropertyImpl.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DatabaseConfigPropertyImpl.java index 213d1a860..c202e231b 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DatabaseConfigPropertyImpl.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DatabaseConfigPropertyImpl.java @@ -3,9 +3,9 @@ package at.gv.egovernment.moa.id.commons.db.dao.config; import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import java.util.Map.Entry; import java.util.regex.Pattern; +import javax.annotation.PostConstruct; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.TypedQuery; @@ -36,6 +36,15 @@ public class DatabaseConfigPropertyImpl extends AbstractConfigurationImpl { @Autowired(required=true) private ApplicationContext appContext; + + static protected String dataBaseEntityName; + + @PostConstruct + void postConstructor() { + dataBaseEntityName = appContext.getBean(AbstractConfigProperty.class).getImplementationName(); + log.info("DB-Entity for config: " + dataBaseEntityName); + + } /** * @@ -51,7 +60,7 @@ public class DatabaseConfigPropertyImpl extends AbstractConfigurationImpl { log.error("No EntityManager set!"); throw new ConfigurationException("No EntityManager set!"); } - TypedQuery query = em.createQuery("select key from ConfigProperty", String.class); + TypedQuery query = em.createQuery("select key from " + dataBaseEntityName, String.class); List result = query.getResultList(); return result; } @@ -109,7 +118,7 @@ public class DatabaseConfigPropertyImpl extends AbstractConfigurationImpl { protected void deleteKey(String key) { log.debug("Deleting entry with key '{}'.", key); - AbstractConfigProperty el = em.find(AbstractConfigProperty.class, key); + AbstractConfigProperty el = em.find(appContext.getBean(AbstractConfigProperty.class).getClass(), key); if (el != null) em.remove(el); @@ -126,7 +135,7 @@ public class DatabaseConfigPropertyImpl extends AbstractConfigurationImpl { throw new ConfigurationException("No EntityManager set!"); } - TypedQuery query = em.createQuery("select key from ConfigProperty dbconfig where dbconfig.key like :key", String.class); + TypedQuery query = em.createQuery("select key from " + dataBaseEntityName + " dbconfig where dbconfig.key like :key", String.class); query.setParameter("key", searchString.replace("*", "%")); List result = query.getResultList(); if (result == null) @@ -146,7 +155,7 @@ public class DatabaseConfigPropertyImpl extends AbstractConfigurationImpl { throw new ConfigurationException("No EntityManager set!"); } - TypedQuery query = em.createQuery("select * from ConfigProperty dbconfig", AbstractConfigProperty.class); + TypedQuery query = em.createQuery("select * from " + dataBaseEntityName + " dbconfig", AbstractConfigProperty.class); List all = query.getResultList(); searchString = searchString.replace(".", "\\."); @@ -195,7 +204,8 @@ public class DatabaseConfigPropertyImpl extends AbstractConfigurationImpl { private AbstractConfigProperty getProperty(String key) { log.trace("Looking for configuration property for key '{}'.", key); - AbstractConfigProperty result = em.find(AbstractConfigProperty.class, key); + + AbstractConfigProperty result = em.find(appContext.getBean(AbstractConfigProperty.class).getClass(), key); if (result != null) { log.trace("Found configuration property {}.", result); } else { diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/AuthenticatedSessionStore.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/AuthenticatedSessionStore.java index 7cb921ee7..b13f0ba5b 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/AuthenticatedSessionStore.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/AuthenticatedSessionStore.java @@ -98,9 +98,12 @@ public class AuthenticatedSessionStore implements Serializable{ @Column(name = "pendingRequestID", nullable=true) private String pendingRequestID = ""; - @Column(name = "additionalInformationBytes", nullable=true) + @Column(name = "additionalInformation", nullable=true) @Lob - private byte[] additionalInformation; + private String additionalInformation; + + @Column(name = "additionalInformationBytes", nullable=true) + private byte[] additionalInformationBytes; @Column(name = "created", updatable=false, nullable=false) @Temporal(TemporalType.TIMESTAMP) @@ -350,14 +353,14 @@ public class AuthenticatedSessionStore implements Serializable{ * @return the additionalInformation */ public byte[] getAdditionalInformation() { - return additionalInformation; + return additionalInformationBytes; } /** * @param additionalInformation the additionalInformation to set */ public void setAdditionalInformation(byte[] additionalInformation) { - this.additionalInformation = additionalInformation; + this.additionalInformationBytes = additionalInformation; } diff --git a/id/server/moa-id-commons/src/main/resources/configuration.beans.xml b/id/server/moa-id-commons/src/main/resources/configuration.beans.xml index 1251cf406..79e2decc1 100644 --- a/id/server/moa-id-commons/src/main/resources/configuration.beans.xml +++ b/id/server/moa-id-commons/src/main/resources/configuration.beans.xml @@ -12,30 +12,32 @@ + class="at.gv.egovernment.moa.id.commons.db.dao.config.ConfigProperty" + scope="prototype"/> + class="at.gv.egovernment.moa.id.commons.db.dao.config.ConfigPropertyByteValues" + scope="prototype"/> - + + - + - - - - - - - - - - - + + + + + + + + + + + \ No newline at end of file diff --git a/id/server/moa-id-spring-initializer/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthSpringInitializer.java b/id/server/moa-id-spring-initializer/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthSpringInitializer.java index b6fd8de8e..bf0273898 100644 --- a/id/server/moa-id-spring-initializer/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthSpringInitializer.java +++ b/id/server/moa-id-spring-initializer/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthSpringInitializer.java @@ -1,5 +1,6 @@ package at.gv.egovernment.moa.id.auth; +import java.util.Arrays; import java.util.Map; import java.util.Map.Entry; @@ -67,12 +68,10 @@ public class MOAIDAuthSpringInitializer implements WebApplicationInitializer { GenericWebApplicationContext rootContext = new GenericWebApplicationContext(); rootContext.setServletContext(servletContext); rootContext.setParent(cfgRootContext); - + ConfigurationProvider moaidconfig = (ConfigurationProvider) cfgRootContext.getBean("moaidauthconfig"); String[] springProfiles = moaidconfig.getActiveProfiles(); - - - + Logger.info("=============== Setting active profiles! ==============="); if (this.activeProfiles != null) { for (String profile : this.activeProfiles) { @@ -86,6 +85,9 @@ public class MOAIDAuthSpringInitializer implements WebApplicationInitializer { } } + Logger.info("Spring-context was initialized with active profiles: " + + Arrays.asList(rootContext.getEnvironment().getActiveProfiles())); + Logger.info("=============== Loading Local Contexts! ==============="); XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader( rootContext); diff --git a/pom.xml b/pom.xml index 5ccd01a52..3716d4382 100644 --- a/pom.xml +++ b/pom.xml @@ -581,7 +581,6 @@ iaik.prod iaik_jce_full 5.5_MOA - compile -- cgit v1.2.3