HSEARCH - Assorted fixes to the pom files
by Guillaume Smet
Hi,
I'm planning to work on the pom files in the next few days.
Here is more or less the plan I have in mind:
- centralize all dependencies versions in the properties of the parent
pom file. A couple of them are directly in the dependencyManagement
block. It's easier to update them this way.
- same for the Maven plugins;
- I would like to enforce the dependency convergence rule via the
enforcer plugin: a few additional dependency management declaration
will be needed to get everything right. See
http://maven.apache.org/enforcer/enforcer-rules/dependencyConvergence.html
for more information.
- remove the commons-logging API altogether and use slf4j and its
wrapper for commons-logging
- update a few core dependencies (especially Javassist to the version
used in ORM, slf4j, log4j, commons-io which is a solr dependency and
Solr is now using 2.1, not 1.4)
- update the activemq dependency if it's not too much of a pain as
it's only a test dependency;
- remove outdated comments: I'm especially thinking about the one for
the log4j dependency: the problem has been fixed a while ago;
- in latest JBoss EAP, Jackson is in a custom version of 1.9.9 (there
is a "redhat" qualifier in the version string): maybe, I was thinking
about upgrading the dependency to at least 1.9.9, instead of 1.9.2
(which is effectively the version used in AS 7.1);
- remove the lucene-regex dependency management definition: this
dependency isn't declared anywhere, except in the modules file. I
think it's a leftover of something and we should get rid of it
altogether;
- remove the luceneRegexJakartaVersion property: it's not used anywhere.
Interested in a couple of +1/-1 before starting this work.
--
Guillaume
11 years, 3 months
Exceptions while trying to use HibernateOGM
by Babak Bastan
I would not have using mailing list this unless I was truely frustrated. I
want to implement a very simple example using HibernateOGM but I get some
exceptions, which I don't know really how can to solve them.
in the main I have started with this lock of code:
OgmConfiguration cfgogm=new OgmConfiguration();
cfgogm.configure();
serviceregistry=new
ServiceRegistryBuilder().applySettings(cfgogm.getProperties()).buildServiceRegistry();
sessionfactory=cfgogm.buildSessionFactory(serviceregistry);
I can build my code successfully but if I run it I get some exceptions:
Exception in thread "main" org.hibernate.service.spi.ServiceException:
Unable to create requested service
[org.hibernate.engine.transaction.spi.TransactionFactory]
at
org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:186)
at
org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:150)
at
org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:180)
at
org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2283)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2279)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1748)
at hogm.hibernateogm_mongodb.App.main(App.java:33)
Caused by: org.hibernate.HibernateException: Unable to instantiate
specified TransactionFactory class [org.transaction.JDBCTransactionFactory]
at
org.hibernate.engine.transaction.internal.TransactionFactoryInitiator.initiateService(TransactionFactoryInitiator.java:80)
at
org.hibernate.ogm.transaction.impl.OgmTransactionFactoryInitiator.buildServiceInstance(OgmTransactionFactoryInitiator.java:61)
at
org.hibernate.ogm.transaction.impl.OgmTransactionFactoryInitiator.buildServiceInstance(OgmTransactionFactoryInitiator.java:41)
at
org.hibernate.ogm.service.impl.OptionalServiceInitiator.initiateService(OptionalServiceInitiator.java:37)
at
org.hibernate.service.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:69)
at
org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:176)
... 7 more
Caused by: org.hibernate.service.classloading.spi.ClassLoadingException:
Unable to load class [org.transaction.JDBCTransactionFactory]
at
org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:141)
at
org.hibernate.engine.transaction.internal.TransactionFactoryInitiator.initiateService(TransactionFactoryInitiator.java:77)
... 12 more
Caused by: java.lang.ClassNotFoundException: Could not load requested class
: org.transaction.JDBCTransactionFactory
at
org.hibernate.service.classloading.internal.ClassLoaderServiceImpl$1.findClass(ClassLoaderServiceImpl.java:99)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:266)
at
org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:138)
... 13 more
If I do this line of code comment, I see no exceptions:
sessionfactory=cfgogm.buildSessionFactory(serviceregistry);
it is my *hibernate.cfg.xml:*
*
*
*
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate
Configuration DTD 3.0//EN" "
http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.o"></property>
<property
name="hibernate.transaction.factory_class">org.transaction.JDBCTransactionFactory</property>
<property
name="hibernate.current_session_context_class">thread</property>
<property
name="hibernate.ogm.datastore.grid_dialect">org.hibernate.ogm.dialect.mongodb.MongoDBDialect</property>
<property name="hibernate.ogm.datastore.provider">mongodb</property>
<property name="hibernate.ogm.mongodb.database">rcfdb</property>
<property name="hibernate.ogm.mongodb.host">127.0.0.1</property>
<property name="hibernate.ogm.mongodb.port">27017</property>
<mapping resource="hibernate-contact.hbm.xml"/>
</session-factory>
</hibernate-configuration>
*
could you please explain me, why I get this problem and how can I solve
this?
11 years, 3 months
[hibernate-hql-parser] 1.0.0.Alpha3 released
by Sanne Grinovero
@Gunnar I've included your last pull, tagged it and uploaded it already.
I've sent a pull to OGM including your tests and more tests to verify
the LIKE behavior; I think they are quite comprehensive and are
passing, but if you are able to add more failing ones please send them
to me :-)
No changes where needed, it just worked fine. I suspect you didn't
take case sensitivity in consideration when trying? It is case
sensitive, and should not be applied on analyzed fields.
@Adrian, this should contain all the fixes you needed; if not we don't
mind making more releases soon.
Cheers,
Sanne
11 years, 3 months
Search and JDK 6: @Override annotations
by Guillaume Smet
Hi,
AFAICS in the pom.xml, Search is now compiled for Java 6.
I think It would be a good idea to add the @Override annotation to the
methods implemented from an interface, considering it's supported in
Java 6.
I'm willing to do the grunt work and prepare a pull request in the
next few days if you think it's a good idea.
Feedback welcome.
--
Guillaume
11 years, 3 months
Updated build script using git clone
by Sanne Grinovero
Hi all,
I updated the build script which Emmanuel shared initially:
https://gist.github.com/Sanne/789588
I now maintain an environment variable BUILD_COMMAND which is
automatically set depending on the project I'm working on (among JAVA
env, Maven versions, Maven options & all that stuff which is always
different for some reason)
That's what works best for me, I assume others are in the same boat.
enjoy
11 years, 3 months
unit test PSA
by Brett Meyer
A friendly PSA regarding unit tests...
I spent the afternoon cleaning up tests that were failing in our matrix CI job. There were lots of failures on various DBs due to the following:
1.) Columns referenced by a UK/PK must NOT be nullable.
2.) Tests that solely use ConnectionProviderBuilder in the Configuration (pure unit tests, not functional tests) should use "@RequiresDialectFeature( value = ConnectionProviderBuilder.class )". ConnectionProviderBuilder now extends DialectCheck. The Dialect used by ConnectionProviderBuilder (currently H2) will therefore be required and all others skipped.
3.) Avoid the use of reserved keywords ("User", "Table", "Comment", etc.). If it seems like it's possible for it to be reserved somewhere, please avoid.
4.) Table and column name lengths, including collection tables, should be less than 30 characters. This was mainly an issue with entities embedded in the test class (implicit name is ParentClass$SubClass).
https://hibernate.atlassian.net/browse/HHH-8420
If everyone could keep those in mind, I'd sincerely appreciate it. It removes time-consuming debugging later on (although I realize that most of those are very dialect-specific). Thanks!
11 years, 3 months