[Hibernate-JIRA] Created: (HBX-915) CLONE -Hibernate ant task does not work in a multi-project Maven 2 build if other mojos use javax.xml.transform
by Brill Pappin (JIRA)
CLONE -Hibernate ant task does not work in a multi-project Maven 2 build if other mojos use javax.xml.transform
---------------------------------------------------------------------------------------------------------------
Key: HBX-915
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-915
Project: Hibernate Tools
Type: Bug
Components: ant
Versions: 3.1beta4
Environment: Hibernate 3.1, database is Oracle (but not relevant to this)
Reporter: Brill Pappin
Fix For: 3.2beta7
I have a reasonably complex maven 2 build with multiple projects. More than one of the projects uses the hbm2java task and at least one of the projects uses the Codehaus xslt-maven-plugin. When running the project that uses both hbm2java and XSLT, it works fine. But running the master build throws the following error.
org.apache.maven.lifecycle.LifecycleExecutionException: Error executing ant tasks
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
[snip]
Caused by: java.lang.IllegalStateException: 3.1.0.beta4 found when setting version
at org.hibernate.tool.hbm2x.TemplateHelper.putInContext(TemplateHelper.java:223)
[snip]
I can't really explain where this error is coming from. I looked at the source for putInContext and it is using the Plexus options class and failing because the value of "version" is already in the options.
I assumed from this it was a problem with the xstl-maven-plugin from Codehaus also using some Plexus libraries, but I refactored the mojo so it was ONLY using javax.xml.transform and the problem remained.
I then changed my slimmed down mojo to force use of Saxon instead of the default JAXP implementation (Xalan?).
.. and it worked fine!
So this is definitely a problem with the instantiation of the default XSLT functionality in JDK1.4, although how that can possibly affect the build in this way is beyond me.
You might consider this a Maven bug but it's very strange that it doesn't happen for any old mojo combination. I also think it is probably much easier to fix in Hibernate tools than in Maven.
I'd suggest a couple of possible fixes/improvements:
- Make "version" key more specific, eg. hibernate.tools.version to avoid possible clash with other Plexus clients in the same JVM
- Don't throw an exception on any existing value being set as it is now but compare the value in the options to the new value and only throw an exception if they differ
I can't think of a way to track down the underlying cause of this issue. It's a very odd one.
Attached is a simple three project build to reproduce the problem. Just run 'mvn clean package' on the parent project to reproduce.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
17 years, 6 months
[Hibernate-JIRA] Created: (HBX-953) java.lang.UnsupportedOperationException: accept on org.hibernate.mapping.DependantValue
by Ray DeCampo (JIRA)
java.lang.UnsupportedOperationException: accept on org.hibernate.mapping.DependantValue
---------------------------------------------------------------------------------------
Key: HBX-953
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-953
Project: Hibernate Tools
Issue Type: Bug
Components: hbm2doc
Affects Versions: 3.2beta9
Environment: Hibernate 3.2.3, tested with 3.2.0 and 3.2.4.sp1
Reporter: Ray DeCampo
Priority: Minor
When running hbm2doc via ANT and using the GraphViz dot.executable property, I get the following error:
[hibernatetool] Jun 22, 2007 2:59:22 PM freemarker.log.JDK14LoggerFactory$JDK14Logger error
[hibernatetool] SEVERE:
[hibernatetool]
[hibernatetool] Method public java.lang.String org.hibernate.tool.hbm2x.Cfg2HbmTool.getHibernateTypeName(org.hibernate.mapping.Property) threw an exce
ption when invoked on org.hibernate.tool.hbm2x.Cfg2HbmTool@7f5580
[hibernatetool] The problematic instruction:
[hibernatetool] ----------
[hibernatetool] ==> if c2h.getHibernateTypeName(property)?exists [on line 62, column 6 in dot/entitygraph.dot.ftl]
[hibernatetool] in user-directive propertyEdges [on line 32, column 3 in dot/entitygraph.dot.ftl]
[hibernatetool] ----------
[hibernatetool]
[hibernatetool] Java backtrace for programmers:
[hibernatetool] ----------
[hibernatetool] freemarker.template.TemplateModelException: Method public java.lang.String org.hibernate.tool.hbm2x.Cfg2HbmTool.getHibernateTypeName(o
rg.hibernate.mapping.Property) threw an exception when invoked on org.hibernate.tool.hbm2x.Cfg2HbmTool@7f5580
[hibernatetool] at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:136)
[hibernatetool] at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)
[hibernatetool] at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
[hibernatetool] at freemarker.core.BuiltIn$existsBI._getAsTemplateModel(BuiltIn.java:635)
[hibernatetool] at freemarker.core.BuiltIn$existsBI.isTrue(BuiltIn.java:646)
[hibernatetool] at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:77)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:351)
[hibernatetool] at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.Macro$Context.runMacro(Macro.java:164)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:537)
[hibernatetool] at freemarker.core.UnifiedCall.accept(UnifiedCall.java:128)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:351)
[hibernatetool] at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.Environment.process(Environment.java:176)
[hibernatetool] at freemarker.template.Template.process(Template.java:231)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:247)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateProducer.produceToString(TemplateProducer.java:67)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:28)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:97)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter$1.process(GenericExporter.java:30)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java:126)
[hibernatetool] at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:95)
[hibernatetool] at org.hibernate.tool.hbm2x.DocExporter.generateDot(DocExporter.java:182)
[hibernatetool] at org.hibernate.tool.hbm2x.DocExporter.doStart(DocExporter.java:151)
[hibernatetool] at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:95)
[hibernatetool] at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:40)
[hibernatetool] at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:183)
[hibernatetool] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[hibernatetool] at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
[hibernatetool] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[hibernatetool] at java.lang.reflect.Method.invoke(Method.java:597)
[hibernatetool] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
[hibernatetool] at org.apache.tools.ant.Task.perform(Task.java:348)
[hibernatetool] at org.apache.tools.ant.Target.execute(Target.java:357)
[hibernatetool] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[hibernatetool] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
[hibernatetool] at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
[hibernatetool] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[hibernatetool] at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
[hibernatetool] at org.apache.tools.ant.Main.runBuild(Main.java:698)
[hibernatetool] at org.apache.tools.ant.Main.startAnt(Main.java:199)
[hibernatetool] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
[hibernatetool] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
[hibernatetool] Caused by: java.lang.UnsupportedOperationException: accept on org.hibernate.mapping.DependantValue([org.hibernate.mapping.Column(serve
_id)])
[hibernatetool] at org.hibernate.tool.hbm2x.visitor.DefaultValueVisitor.handle(DefaultValueVisitor.java:40)
[hibernatetool] at org.hibernate.tool.hbm2x.visitor.DefaultValueVisitor.accept(DefaultValueVisitor.java:97)
[hibernatetool] at org.hibernate.mapping.DependantValue.accept(DependantValue.java:31)
[hibernatetool] at org.hibernate.tool.hbm2x.Cfg2HbmTool.getHibernateTypeName(Cfg2HbmTool.java:380)
[hibernatetool] at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
[hibernatetool] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[hibernatetool] at java.lang.reflect.Method.invoke(Method.java:597)
[hibernatetool] at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:583)
[hibernatetool] at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:113)
[hibernatetool] ... 56 more
[hibernatetool] An exception occurred while running exporter #2:hbm2doc (Generates html schema documentation)
[hibernatetool] To get the full stack trace run ant with -verbose
[hibernatetool] org.hibernate.tool.hbm2x.ExporterException: Error while processing template dot/entitygraph.dot.ftl
[hibernatetool] freemarker.template.TemplateModelException: Method public java.lang.String org.hibernate.tool.hbm2x.Cfg2HbmTool.getHibernateTypeName(o
rg.hibernate.mapping.Property) threw an exception when invoked on org.hibernate.tool.hbm2x.Cfg2HbmTool@7f5580
[hibernatetool] java.lang.UnsupportedOperationException: accept on org.hibernate.mapping.DependantValue([org.hibernate.mapping.Column(serve_id)])
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 6 months
[Hibernate-JIRA] Created: (HSEARCH-90) negative List capacity in FullTextQueryImpl.list()
by Sheldon Shi (JIRA)
negative List capacity in FullTextQueryImpl.list()
--------------------------------------------------
Key: HSEARCH-90
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-90
Project: Hibernate Search
Issue Type: Bug
Components: query
Affects Versions: 3.0.0.beta3
Reporter: Sheldon Shi
Priority: Minor
I did this query:
fullTextQuery.setFirstResult(sr.getOffset());
fullTextQuery.setMaxResults(sr.getLength());
List results = fullTextQuery.list();
sr.getOffset() and sr.getLength() are pagination parameters. They happened to be carried from another query as a session properties (not the right thing to do here but it happened). In my case offset was 10 and length was 10. The new search result is empty, so these lines of code in FullTextQueryImpl gave a negative capacity for list exception:
int first = first();
int max = max( first, hits );
Session sess = (Session) this.session;
List<EntityInfo> infos = new ArrayList<EntityInfo>( max - first + 1);
because max=-1 and first=10. Would it be nice if a check is done before assign List capacities?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 6 months
[Hibernate-JIRA] Created: (HHH-2152) Optimistic lock error although using LockMode.UPGRADE
by Per-Olov Wingren (JIRA)
Optimistic lock error although using LockMode.UPGRADE
-----------------------------------------------------
Key: HHH-2152
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2152
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.1.3
Environment: Oracle 10.2, Hibernate 3.1.3
Reporter: Per-Olov Wingren
Priority: Critical
Attachments: OptLockProblem.zip
I have a situation where two threads tries to update the same entity object at the same time. I use the Hibernate managed versioning using a version number but also a pessimistic lock using LockMode.UPGRADE.
One thread will lock the object in the database and the other will wait for the transaction of the first thread to commit (or rollback). The first thread updates the object, which also will make its version to be incremented. When the second tread get access to the object after the first is commited, it get an incorrect value of the version attribute. This leads to a StaleObjectStateException when the transaction is commited.
The entity object conists of a parent class and a subclass mapped to the database into two tables using <joined-subclass>.
If the testcase is modified to update an attribute in the subclass (numberB) instead of in the superclass it works without errors. Is the problem caused by the fact that Hibernate only locks the subclass in the database (for update of classb.oid) and not the superclass?
I attache a zip file containing a simple but complete test case that shows the problem.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
17 years, 6 months