Category Archives: exception

Hibernate exception : cannot simultaneously fetch multiple bags

Problem

Exception class : org.hibernate.loader.MultipleBagFetchException
Exception : cannot simultaneously fetch multiple bags

Solution

Use @LazyCollection(LazyCollectionOption.FALSE) rather than fetch=FetchType.EAGER
Annotation @LazyCollection(LazyCollectionOption.FALSE) makes that collecion is loaded like with FetchType.EAGER and you can use it on two and more collections.

Example

Initial Code : Works with lazy fetch type

Wrong manipulation : wanna set fetch type to eager

Solution : if you want to force loading collection

nexus exception : Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor

Sonatype Nexus deployed on tomcat 6. At starting catalina raises following exception ($TOMCAT_HOME/log/catalina.out)
2013-12-09 09:36:09 WARN  – o.c.p.PlexusContain~          – Error starting: class org.sonatype.nexus.DefaultNexus
org.codehaus.plexus.personality.plexus.lifecycle.phase.StartingException: Could not start Nexus!
        at org.sonatype.nexus.DefaultNexus.start(DefaultNexus.java:663)
        at org.codehaus.plexus.PlexusLifecycleManager.start(PlexusLifecycleManager.java:303)
        at org.codehaus.plexus.PlexusLifecycleManager.manageLifecycle(PlexusLifecycleManager.java:254)
        at org.codehaus.plexus.PlexusLifecycleManager.manage(PlexusLifecycleManager.java:154)
        at org.sonatype.guice.plexus.binders.PlexusBeanBinder.afterInjection(PlexusBeanBinder.java:78)

[…]

Caused by: com.thoughtworks.xstream.converters.ConversionException: Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor : Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
—- Debugging information —-
message             : Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
cause-exception     : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
cause-message       : Cannot construct org.codehaus.plexus.util.xml.Xpp3Dom as it does not have a no-args constructor
class               : org.sonatype.nexus.configuration.model.CRepository
required-type       : org.codehaus.plexus.util.xml.Xpp3Dom
path                : /org.sonatype.nexus.configuration.model.CRepository/externalConfiguration
line number         : 23
——————————-

It happens because the version of nexus is not working correctly with java7. Must use java6 alternative.
Edit $TOMCAT_HOME/bin/setclasspath.sh
and add at the begining simple export env variable JAVA_HOME locating java6 home.

exception: Can’t connect to X11 window server using ‘:0’ as the value of the DISPLAY variable


=========================================== 30/05/2013
If you have following error: Can’t connect to X11 window server using ‘:0’ as the value of the DISPLAY variable.
you must know that :
– linux user (launching process requsting Xserver) is not authorized to access Xserver
– OR DISPLAY variable is bad configured

type xhost to know:

> xhost
No protocol specified
No protocol specified
xhost:  unable to open display “???”
==> means you don’t have authorization to any Xserver
==> to authorize access type: > sudo xhost +SI:localuser:youruser

> xhost
xhost:  unable to open display “???”
==> means DISPLAY variable is bad configured
==> you must fix DISPLAY variable. type: > export DISPLAY=hostname:D.S
– hostname is the name of the computer where the X server runs. An omitted hostname means the localhost.
– D is a sequence number (usually 0). It can be varied if there are multiple displays connected to one computer.
– S is the screen number. A display can actually have multiple screens. Usually there’s only one screen though where 0 is the default.

oracle: exception : Ora-28001: the password has expired

May 6, 2013

this error tell us that user password has expired. check this with following request:
SELECT USERNAME, PROFILE, ACCOUNT_STATUS, EXPIRY_DATE FROM dba_users WHERE username=’your_oracle_username’;
value of ACCOUNT_STATUS column (expired or expired&locked)

password policies are defined in oracle PROFILE associated to user (value of PROFILE column). profile properties can be found here:
select * from dba_profiles where profile = ‘profile_name’;

take a look of line : resource_name =’PASSWORD_LIFE_TIME’ and depending on your security policies you can change the value to UNLIMITED to avoid password expiry