[Hibernate-JIRA] Created: (HV-14) Minor typo in regular expression in class EmailValidator
by Talal Al-Tamimi (JIRA)
Minor typo in regular expression in class EmailValidator
--------------------------------------------------------
Key: HV-14
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-14
Project: Hibernate Validator
Issue Type: Bug
Components: validators
Affects Versions: 3.0.0.ga
Reporter: Talal Al-Tamimi
Priority: Trivial
It looks like there is a small mistake in the regular expression below from class EmailValidator:
private static String ATOM = "[^\\x00-\\x1F^\\(^\\)^\\<^\\>^\\@^\\,^\\(;^\\:^\\\\^\\\"^\\.^\\[^\\]^\\s]";
The substring to exclude a semicolon should be "^\\;" but above it is shown as "^\\(;"
Instead of excluding a semicolon, this will exclude the left parenthesis (which is already done earlier in the regular expression) and allow a semicolon.
Also, the initialize method is instantiating instance variable 'pattern' twice. The first seems to be an older line of code, so it might be a good idea to comment it out. This is not a bug though, since the first instance is just discarded.
--
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, 1 month
[Hibernate-JIRA] Created: (HHH-3232) Null Pointer Exception on Sort in a set
by FOIRET (JIRA)
Null Pointer Exception on Sort in a set
---------------------------------------
Key: HHH-3232
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3232
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.0 final
Environment: Windows Apache mySQL Tomcat
Reporter: FOIRET
Priority: Critical
Hi,
Find below a null pointer exception error when i try to find the ElemactionDAO by his ID (vdo.epi.hibernate.ElemactionDAO.findById)
This error appears when i add a sort="natural" in the set of the entity (Action). An Action contains a set of Elemaction
(Find after a part of the mapping file Action)
This parameter resolves my sort issue in the set but it creates this one ...
I use a TreeSet in the POJO Action for the Elemaction
Could you tell me what is the issue ?
java.lang.NullPointerException
at java.lang.String.compareTo(Unknown Source)
at vdo.epi.hibernate.Elemaction.compareTo(Elemaction.java:491)
at java.util.TreeMap.compare(Unknown Source)
at java.util.TreeMap.put(Unknown Source)
at java.util.TreeSet.add(Unknown Source)
at org.hibernate.collection.PersistentSet.initializeFromCache(PersistentSet.java:104)
at org.hibernate.cache.entry.CollectionCacheEntry.assemble(CollectionCacheEntry.java:35)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.initializeCollectionFromCache(DefaultInitializeCollectionEventListener.java:130)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:48)
at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1716)
at org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:454)
at org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:755)
at org.hibernate.event.def.DefaultLoadEventListener.assembleCacheEntry(DefaultLoadEventListener.java:567)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:494)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:356)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:137)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:193)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:101)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:846)
at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266)
at org.hibernate.type.ManyToOneType.assemble(ManyToOneType.java:196)
at org.hibernate.type.TypeFactory.assemble(TypeFactory.java:404)
at org.hibernate.cache.entry.CacheEntry.assemble(CacheEntry.java:96)
at org.hibernate.cache.entry.CacheEntry.assemble(CacheEntry.java:82)
at org.hibernate.event.def.DefaultLoadEventListener.assembleCacheEntry(DefaultLoadEventListener.java:540)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:494)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:356)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:137)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:193)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:101)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:301)
at $Proxy3.get(Unknown Source)
at vdo.epi.hibernate.ElemactionDAO.findById(ElemactionDAO.java:159)
at vdo.epi.page.ActioncreaPage.onEditElem(ActioncreaPage.java:424)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.sf.click.util.ClickUtils.invokeListener(ClickUtils.java:1393)
at net.sf.click.control.ActionLink.onProcess(ActionLink.java:498)
at net.sf.click.ClickServlet.processPage(ClickServlet.java:555)
at net.sf.click.ClickServlet.handleRequest(ClickServlet.java:356)
at net.sf.click.ClickServlet.doGet(ClickServlet.java:284)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)
Lines in the Mapping file of Action which defines the set of Elemaction
<set name="elemaction" inverse="true" cascade="all" lazy="false" sort="natural">
<cache usage="read-write" />
<key column="actionId" />
<one-to-many class="Elemaction" />
</set>
--
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, 1 month
[Hibernate-JIRA] Created: (EJB-278) Missing sequence or table on Oracle
by André Fernandes (JIRA)
Missing sequence or table on Oracle
-----------------------------------
Key: EJB-278
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-278
Project: Hibernate Entity Manager
Type: Patch
Components: EntityManager
Environment: JBoss 4.0.5.GA, Using JBoss SEAM and Oracle 9i, EJB/JPA annotations
Reporter: André Fernandes
Here we use a user "project_web" to access a "dbproject" schema.
The problem is, when Hibernate looks for the sequences, it looks in the user_sequences, but my user (project_web) don't have any sequences.
The solving is: when getting the sequence names (org.hibernate.dialect.Oracle9Dialect .getQuerySequencesString) use that:
select SEQUENCE_NAME from all_sequences where SEQUENCE_OWNER='DBPROJECT'
i.e. use the schema to look in the all_sequences.
Sorry for the bad english.
package org.hibernate.dialect;
public class Oracle9Dialect extends Dialect {
public String getQuerySequencesString() {
return "select sequence_name from user_sequences";
}
@GeneratedValue(generator="sqCoSeqProjeto", strategy=GenerationType.SEQUENCE)
@SequenceGenerator(name="sqCoSeqProjeto", sequenceName="sq_coseqprojeto", allocationSize=5)
--
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, 1 month
[Hibernate-JIRA] Created: (HHH-2382) DefaultLoadEventListener#onLoad throws exception when DelayedPostInsertIdentifier is set as an entity id
by Eelco Hillenius (JIRA)
DefaultLoadEventListener#onLoad throws exception when DelayedPostInsertIdentifier is set as an entity id
--------------------------------------------------------------------------------------------------------
Key: HHH-2382
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2382
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.1, 3.2.2, 3.2.0.ga
Reporter: Eelco Hillenius
DefaultLoadEventListener#onLoad has this code:
if ( idClass != null && ! idClass.isInstance( event.getEntityId() ) ) {
throw new TypeMismatchException(
"Provided id of the wrong type. Expected: " + idClass + ", got " + event.getEntityId().getClass());
}
However, EntityIdentityInsertAction has this in it's constructor:
delayedEntityKey = isDelayed ? generateDelayedEntityKey() : null;
and method:
private synchronized EntityKey generateDelayedEntityKey() {
if ( !isDelayed ) {
throw new AssertionFailure( "cannot request delayed entity-key for non-delayed post-insert-id generation" );
}
return new EntityKey( new DelayedPostInsertIdentifier(), getPersister(), getSession().getEntityMode() );
}
In case an insert is tried outside of an existing transaction users may run into this problem (like I did).
I don't know what the best fix is. The easiest fix would be:
Index: /Users/eelcohillenius/Documents/workspace/hibernate3/src/org/hibernate/event/def/DefaultLoadEventListener.java
===================================================================
--- /Users/eelcohillenius/Documents/workspace/hibernate3/src/org/hibernate/event/def/DefaultLoadEventListener.java (revision 11098)
+++ /Users/eelcohillenius/Documents/workspace/hibernate3/src/org/hibernate/event/def/DefaultLoadEventListener.java (working copy)
@@ -5,6 +5,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.hibernate.EntityMode;
import org.hibernate.HibernateException;
import org.hibernate.LockMode;
import org.hibernate.NonUniqueObjectException;
@@ -10,7 +11,7 @@
import org.hibernate.NonUniqueObjectException;
import org.hibernate.PersistentObjectException;
import org.hibernate.TypeMismatchException;
-import org.hibernate.EntityMode;
+import org.hibernate.action.DelayedPostInsertIdentifier;
import org.hibernate.cache.CacheConcurrencyStrategy;
import org.hibernate.cache.CacheKey;
import org.hibernate.cache.entry.CacheEntry;
@@ -82,7 +83,7 @@
}
else {
Class idClass = persister.getIdentifierType().getReturnedClass();
- if ( idClass != null && ! idClass.isInstance( event.getEntityId() ) ) {
+ if ( idClass != null && ! (idClass.isInstance( event.getEntityId() ) || event.getEntityId() instanceof DelayedPostInsertIdentifier )) {
throw new TypeMismatchException(
"Provided id of the wrong type. Expected: " + idClass + ", got " + event.getEntityId().getClass()
);
but that would look like a quick hack to me.
--
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, 1 month