[Hibernate-JIRA] Created: (HHH-2281) CLONE -Calling Session.connection() generates java.lang.IllegalArgumentException: interface org.hibernate.jdbc.ConnectionWrapper is not visible from class loader
by Sergey Polzunov (JIRA)
CLONE -Calling Session.connection() generates java.lang.IllegalArgumentException: interface org.hibernate.jdbc.ConnectionWrapper is not visible from class loader
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Key: HHH-2281
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2281
Project: Hibernate3
Type: Bug
Versions: 3.2.1
Environment: Hibernate checked out from trunk; revision 10717
Reporter: Sergey Polzunov
Calling Session.connection() always generates an exception. Here is the stacktrace I get from the attached test case:
Exception in thread "main" java.lang.IllegalArgumentException: interface org.hibernate.jdbc.ConnectionWrapper is not visible from class loader
at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
at org.hibernate.jdbc.BorrowedConnectionProxy.generateProxy(BorrowedConnectionProxy.java:56)
at org.hibernate.jdbc.ConnectionManager.borrowConnection(ConnectionManager.java:163)
at org.hibernate.jdbc.JDBCContext.borrowConnection(JDBCContext.java:111)
at org.hibernate.impl.SessionImpl.connection(SessionImpl.java:359)
at TestSession.main(TestSession.java:16)
Changing the Connection.class.getClassLoader() to BorrowedConnectionProxy.class.getClassLoader() on line 57 in the generateProxy() method solves the problem. I am not very familiar with class loaders so I don't know if this is likeley to cause other problems elsewhere. Removing the ConnectionWrapper.class from the PROXY_INTERFACES array in the org.hibernate.jdbc.BorrowedConnectionProxy also solves the problem, but I guess it was added for a reason.
--
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
16 years, 3 months
[Hibernate-JIRA] Created: (HHH-2883) ManyToMany doesn't work with polymorfism
by Dirk (JIRA)
ManyToMany doesn't work with polymorfism
----------------------------------------
Key: HHH-2883
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2883
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.4
Environment: Hibernate 3.2.4, Annotations 3.3.0, Entitymanager 3.3.0
Reporter: Dirk
We tried out the SingleTable inheritance with a ManyToMany
@Entity
@Table(name="SHB_PRINCIPAL")
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="TYPE",discriminatorType=DiscriminatorType.INTEGER)
@Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL)
public class Principal implements Serializable {
....
@Entity
@DiscriminatorValue(PrincipalType.USER_NR)
@Cache(usage=CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class ApplicationUser extends Principal {
private static final long serialVersionUID = 1L;
@ManyToMany(fetch=FetchType.LAZY, cascade={CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH},
targetEntity=Role.class)
@JoinTable(name="SHB_PRINCIPAL_TO_PRINCIPAL",
joinColumns=@JoinColumn(name="FROM_PRINCIPAL_ID"),
inverseJoinColumns=@JoinColumn(name="TO_PRINCIPAL_ID"))
private Set<Role> roles;
@ManyToMany(fetch=FetchType.LAZY, cascade={CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH},
targetEntity=ApplicationGroup.class)
@JoinTable(name="SHB_PRINCIPAL_TO_PRINCIPAL",
joinColumns=@JoinColumn(name="FROM_PRINCIPAL_ID"),
inverseJoinColumns=@JoinColumn(name="TO_PRINCIPAL_ID"))
private Set<ApplicationGroup> groups;
@Entity
@DiscriminatorValue(PrincipalType.GROUP_NR)
@Cache(usage=CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class ApplicationGroup extends Principal {
private static final long serialVersionUID = 1L;
@ManyToMany(fetch=FetchType.LAZY, cascade={CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH})
@JoinTable(name="SHB_PRINCIPAL_TO_PRINCIPAL",
joinColumns=@JoinColumn(name="TO_PRINCIPAL_ID"),
inverseJoinColumns=@JoinColumn(name="FROM_PRINCIPAL_ID"))
private Set<ApplicationUser> users;
public ApplicationGroup() {
super();
this.type = PrincipalType.GROUP;
}
public Set<ApplicationUser> getUsers() {
return users;
}
public void setUsers(Set<ApplicationUser> users) {
this.users = users;
}
}
But in the groups and the roles of the user, hibernate returns all principals, not only the users or groups. In the query it's clear that the descriminator is NOT used.
--
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
16 years, 3 months
[Hibernate-JIRA] Created: (HHH-2254) A query validation bug produces QueryException: "Expected positional parameter count: 1, actual parameters: [Parent@bec357b] [from Child this where this.id.parent = ?]"
by Hernan Liendo (JIRA)
A query validation bug produces QueryException: "Expected positional parameter count: 1, actual parameters: [Parent@bec357b] [from Child this where this.id.parent = ?]"
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Key: HHH-2254
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2254
Project: Hibernate3
Type: Bug
Components: query-hql
Versions: 3.2.0.ga
Environment: Hibernate 3.2 using Sybase. However this is not an environment caused problem. It's supposed to happen in every environment.
Reporter: Hernan Liendo
-- Short description ============================================================================ --
A query validation bug produces QueryException: "Expected positional parameter count: 1, actual parameters: [Parent@bec357b] [from Child this where this.id.parent = ?].
Both Parent and Child use composite keys.
-- Context ====================================================================================== --
Having composite keys for a Parent class and a Child class, I want to retrieve childs that belong to an specific Parent.
-- Parent Definition ============================================================================ --
public class Parent {
public ParentId ParentId;
...
}
public class ParentId {
private String idField1;
private int idField2;
...
}
// the parent mapping
<hibernate-mapping>
<class mutable="false" table="xx" name="Parent">
<composite-id class="ParentId" access="field" name="parentId">
<key-property column="idField1" access="field" name="idField1"/>
<key-property column="idField2" access="field" name="idField2"/>
</composite-id>
</class>
</hibernate-mapping>
-- Child Definition ============================================================================ --
public class Child {
public ChildId childId;
...
}
public class ChildId {
public Parent parent;
public String aditionalIdField;
...
}
// the mapping
<hibernate-mapping>
<class mutable="false" table="yyy" name="Child">
<composite-id class="ChildId" access="field" name="childId">
<key-many-to-one name="parent" class="Parent" access="field">
<column name="idField1" not-null="true" />
<column name="idField2" not-null="true" />
</key-many-to-one>
<key-property column="aditionalIdField" access="field" name="aditionalIdField"/>
</composite-id>
</class>
</hibernate-mapping>
-- HQL Statement ============================================================================ --
from Child this where this.childId.parent = ?
or
from Child this where this.id.parent = ? // using aliased id
-- The Exception ============================================================================ --
org.hibernate.QueryException: Expected positional parameter count: 1, actual parameters: [Parent@bec357b] [from Child this where this.childId.parent = ?]
at org.hibernate.impl.AbstractQueryImpl.verifyParameters(AbstractQueryImpl.java:319)
at org.hibernate.impl.AbstractQueryImpl.verifyParameters(AbstractQueryImpl.java:275)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:75)
...
-- The Problem ============================================================================ --
class: org.hibernate.impl.AbstractQueryImpl
method: protected void verifyParameters(boolean reserveFirstParameter) throws HibernateException
line: 286
The method validates parameters. It resolves the "positionalValueSpan" variable witch in my case gets the value of 2 (One for parent's idField1 and the other for parent's idField2).
The method compares positionalValueSpan (2) with parameterMetadata.getOrdinalParameterCount() witch it is 1 (the quantity of "?" signs in the HQL statement".
This bug only happens when:
1. composed keys are used (and)
2. having a parent-child relationship (and)
3. resolving children from certain parent.
-- Hibernate user workaround ============================================================================ --
Not to use a parent instance variable in the Child class.
Hope this helps. If you guys need the source code in order to check the bug, please let me know it. Good luck!
Hernan
--
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
16 years, 3 months
[Hibernate-JIRA] Created: (EJB-287) Upload 3.3.1.GA to the Maven repository
by Aleksei Valikov (JIRA)
Upload 3.3.1.GA to the Maven repository
---------------------------------------
Key: EJB-287
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-287
Project: Hibernate Entity Manager
Issue Type: Improvement
Components: EntityManager
Affects Versions: 3.3.1.GA
Reporter: Aleksei Valikov
Priority: Minor
Attachments: hibernate-entitymanager-3.3.1.ga.pom
Would you please upload the entity manager as well as dependent artifacts to the Maven repository?
This is quite important for Maven builds.
Dependent artifacts are:
hibernate-commons-annotations (3.0.0.ga)
hibernate-validator (3.0.0.ga)
jboss-archive-browsing (2.0.2.alpha)
Below are the commands I used to deploy these artifacts, I hope this helps.
I also attach the POM file for the entity manager. I hope you could reuse it in further versions.
Thank you!
mvn deploy:deploy-file -DgroupId=org.hibernate -DartifactId=hibernate-entitymanager -Dversion=3.3.1.ga -Dpackaging=jar -Dfile=hibernate-entitymanager-3.3.1.ga.jar -DpomFile=hibernate-entitymanager-3.3.1.ga.pom -Durl=file://C:/Projects/p2.external/maven2-repository/www/repository
mvn deploy:deploy-file -DgroupId=org.hibernate -DartifactId=hibernate-commons-annotations -Dversion=3.0.0.ga -Dpackaging=jar -Dfile=hibernate-commons-annotations-3.0.0.ga.jar -Durl=file://C:/Projects/p2.external/maven2-repository/www/repository
mvn deploy:deploy-file -DgroupId=org.hibernate -DartifactId=hibernate-validator -Dversion=3.0.0.ga -Dpackaging=jar -Dfile=hibernate-validator-3.0.0.ga.jar -Durl=file://C:/Projects/p2.external/maven2-repository/www/repository
mvn deploy:deploy-file -DgroupId=jboss -DartifactId=jboss-archive-browsing -Dversion=2.0.2.alpha -Dpackaging=jar -Dfile=jboss-archive-browsing-2.0.2.alpha.jar -Durl=file://C:/Projects/p2.external/maven2-repository/www/repository
--
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
16 years, 3 months
[Hibernate-JIRA] Created: (EJB-308) Space in path result in error durring deployment
by Max Rydahl Andersen (JIRA)
Space in path result in error durring deployment
------------------------------------------------
Key: EJB-308
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-308
Project: Hibernate Entity Manager
Issue Type: Bug
Components: EntityManager
Affects Versions: 3.2.1
Environment: both linux and windows, JBoss EAP 4.2 or JBoss 4.2
Reporter: Max Rydahl Andersen
Assignee: Emmanuel Bernard
Priority: Critical
16:38:05,991 ERROR [[/test]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
javax.persistence.PersistenceException: java.lang.IllegalArgumentException: Unable to visit JAR file:/home/max/rh devstudio/jboss-eap/jboss-as/server/default/deploy/test.war/WEB-INF/classes. Cause: Illegal character in path at index 17: file:/home/max/rh devstudio/jboss-eap/jboss-as/server/default/deploy/test.war/WEB-INF/classes
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:252)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:120)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
at org.jboss.seam.core.EntityManagerFactory.startup(EntityManagerFactory.java:74)
When testing JBoss EAP 4.2 with RHDS I we created http://jira.jboss.org/jira/browse/JBIDE-691
and this is with Hibernate Annotations 3.2.1 which should have this one fixed according what i could find (i'll link to it)
--
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
16 years, 3 months