Discussion:
MariaDB
Andreas Ernst
2015-11-19 14:13:18 UTC
Permalink
Hi,

i deployed Archiva on Payara/GlassFish 4.1.1.154. For installation you
need the Derby DB up and runing.

Now i want to go back to MariaDB.

http://archiva.apache.org/docs/2.2.0/adminguide/databases.html, but i
got no conf/jetty.xml.

asadmin> list-resource-refs
jdbc/__TimerPool
jdbc/__default
jms/__defaultConnectionFactory
concurrent/__defaultManagedScheduledExecutorService
concurrent/__defaultContextService
concurrent/__defaultManagedThreadFactory
concurrent/__defaultManagedExecutorService
mail/Session
mailSession
jdbc/archiva
jdbc/users
Command list-resource-refs executed successfully.

The jdbc/users is not used. The documentation is not really clear at
this point.

TIA
Andy
--
ae | Andreas Ernst | IT Spektrum
Postfach 5, 65612 Beselich
Schupbacher Str. 32, 65614 Beselich, Germany
Tel: +49-6484-91002 Fax: +49-6484-91003
***@ae-online.de | www.ae-online.de
www.tachyon-online.de
Olivier Lamy
2015-11-22 10:58:43 UTC
Permalink
jdbc/archiva is not used anymore but users is used.
see
https://github.com/apache/archiva/blob/master/archiva-jetty/src/main/conf/jetty.xml

HTH
Olivier
Post by Andreas Ernst
Hi,
i deployed Archiva on Payara/GlassFish 4.1.1.154. For installation you
need the Derby DB up and runing.
Now i want to go back to MariaDB.
http://archiva.apache.org/docs/2.2.0/adminguide/databases.html, but i got
no conf/jetty.xml.
asadmin> list-resource-refs
jdbc/__TimerPool
jdbc/__default
jms/__defaultConnectionFactory
concurrent/__defaultManagedScheduledExecutorService
concurrent/__defaultContextService
concurrent/__defaultManagedThreadFactory
concurrent/__defaultManagedExecutorService
mail/Session
mailSession
jdbc/archiva
jdbc/users
Command list-resource-refs executed successfully.
The jdbc/users is not used. The documentation is not really clear at this
point.
TIA
Andy
--
ae | Andreas Ernst | IT Spektrum
Postfach 5, 65612 Beselich
Schupbacher Str. 32, 65614 Beselich, Germany
Tel: +49-6484-91002 Fax: +49-6484-91003
www.tachyon-online.de
--
Olivier Lamy
http://twitter.com/olamy | http://linkedin.com/in/olamy
Andreas Ernst
2015-11-23 13:26:05 UTC
Permalink
Hi Olivier,
Post by Olivier Lamy
jdbc/archiva is not used anymore but users is used.
see
https://github.com/apache/archiva/blob/master/archiva-jetty/src/main/conf/jetty.xml
i saw that jdbc/archiva is not used anymore.

However, i put jetty.xml into domain/conf, but i does not have any effect:

<...>

<!-- Users / Security Database -->

<New id="users" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg>jdbc/users</Arg>
<Arg>
<New class="org.mariadb.jdbc.MySQLDataSource">
<Set
name="url">jdbc:mariadb://localhost:3306/archiva?autoReconnect=true</Set>
<Set name="DatabaseName">archiva</Set>
<Set name="user">archiva</Set>
<Set name="password">pw</Set>
</New>
</Arg>
</New>

<New id="usersShutdown" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg>jdbc/usersShutdown</Arg>
<Arg>
<New class="org.mariadb.jdbc.MySQLDataSource">
<Set name="DatabaseName">archiva</Set>
<Set name="user">archiva</Set>
<Set name="shutdownDatabase">shutdown</Set>
</New>
</Arg>
</New>

<...>

Or should i do this into conf/archiva.xml?

Thanks
Andy
--
ae | Andreas Ernst | IT Spektrum
Postfach 5, 65612 Beselich
Schupbacher Str. 32, 65614 Beselich, Germany
Tel: +49-6484-91002 Fax: +49-6484-91003
***@ae-online.de | www.ae-online.de
www.tachyon-online.de
Olivier Lamy
2015-11-23 22:42:38 UTC
Permalink
Hi,
I guess jetty.xml is specific to jetty container.
So as you use Glassfish you must have a look at the Glassfish documentation
and how to create datasources with Glassfish.

HTH
Olivier
Post by Andreas Ernst
Hi Olivier,
Post by Olivier Lamy
jdbc/archiva is not used anymore but users is used.
see
https://github.com/apache/archiva/blob/master/archiva-jetty/src/main/conf/jetty.xml
i saw that jdbc/archiva is not used anymore.
<...>
<!-- Users / Security Database -->
<New id="users" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg>jdbc/users</Arg>
<Arg>
<New class="org.mariadb.jdbc.MySQLDataSource">
<Set
name="url">jdbc:mariadb://localhost:3306/archiva?autoReconnect=true</Set>
<Set name="DatabaseName">archiva</Set>
<Set name="user">archiva</Set>
<Set name="password">pw</Set>
</New>
</Arg>
</New>
<New id="usersShutdown" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg>jdbc/usersShutdown</Arg>
<Arg>
<New class="org.mariadb.jdbc.MySQLDataSource">
<Set name="DatabaseName">archiva</Set>
<Set name="user">archiva</Set>
<Set name="shutdownDatabase">shutdown</Set>
</New>
</Arg>
</New>
<...>
Or should i do this into conf/archiva.xml?
Thanks
Andy
--
ae | Andreas Ernst | IT Spektrum
Postfach 5, 65612 Beselich
Schupbacher Str. 32, 65614 Beselich, Germany
Tel: +49-6484-91002 Fax: +49-6484-91003
www.tachyon-online.de
--
Olivier Lamy
http://twitter.com/olamy | http://linkedin.com/in/olamy
Andreas Ernst
2015-11-25 10:47:53 UTC
Permalink
Hi Olivier,
Post by Olivier Lamy
Hi,
I guess jetty.xml is specific to jetty container.
So as you use Glassfish you must have a look at the Glassfish documentation
and how to create datasources with Glassfish.
thanks for your answer. I know this, but i got the following entries in
Glassfish:

jdbc/__default
mail/Session
mailSession
jdbc/users
jdbc/usersShutdown

But Archiva uses jdbc/__default and not jdbc/users. That is the issue.
This seems to be the default. I can ping jdbc/users.

apache-archiva/WEB-INF/applicationContext.xml has this entry:

<bean name="jdoFactory#users"
class="org.apache.archiva.redback.components.jdo.DataSourceConfigurableJdoFactory">
<property name="connectionFactoryName"
value="java:comp/env/jdbc/users"/>
<property name="shutdownConnectionFactoryName"
value="java:comp/env/jdbc/usersShutdown"/>
<property name="persistenceManagerFactoryClass"
value="org.jpox.PersistenceManagerFactoryImpl"/>
<property name="otherProperties">
<props>
<prop key="org.jpox.autoCreateSchema">true</prop>
<prop key="org.jpox.validateTables">false</prop>
<prop key="org.jpox.validateConstraints">false</prop>
<prop key="org.jpox.validateColumns">false</prop>
<prop key="org.jpox.autoStartMechanism">None</prop>
<prop key="org.jpox.transactionIsolation">READ_COMMITTED</prop>
<prop
key="org.jpox.poid.transactionIsolation">READ_COMMITTED</prop>
<prop key="org.jpox.rdbms.dateTimezone">JDK_DEFAULT_TIMEZONE</prop>
<!-- NEEDED FOR MYSQL UTF-8 Databases -->
<prop key="org.jpox.rdbms.stringDefaultLength">255</prop>

<!-- NEEDED FOR POSTGRES, But causes problems in other JDBC
implementations.
<prop key="org.jpox.identifier.case">PreserveCase</prop>
-->

<!-- cache activation -->
<prop key="org.jpox.cache.level2">true</prop>
<prop key="org.jpox.cache.level2.type">ehcacheclassbased</prop>
<prop key="org.jpox.cache.level2.cacheName">defaultJpox</prop>
<prop
key="org.jpox.cache.level2.configurationFile">/ehcache.xml</prop>
</props>
</property>
</bean>


I got no idea, where to put the jdbc configuration. The Redback site
http://archiva.apache.org/redback/configuration.html is not really helpful:

jdbc.driver.name=org.apache.derby.jdbc.EmbeddedDriver
jdbc.url=jdbc:derby:$plexus.home/database;create=true
jdbc.username=sa
jdbc.password=

Thanks
Andy
--
ae | Andreas Ernst | IT Spektrum
Postfach 5, 65612 Beselich
Schupbacher Str. 32, 65614 Beselich, Germany
Tel: +49-6484-91002 Fax: +49-6484-91003
***@ae-online.de | www.ae-online.de
www.tachyon-online.de
Loading...