Java 类org.hibernate.InstantiationException 实例源码
项目:lams
文件:PojoInstantiator.java
public Object instantiate() {
if ( isAbstract ) {
throw new InstantiationException( "Cannot instantiate abstract class or interface: ", mappedClass );
}
else if ( optimizer != null ) {
return optimizer.newInstance();
}
else if ( constructor == null ) {
throw new InstantiationException( "No default constructor for entity: ", mappedClass );
}
else {
try {
return constructor.newInstance( (Object[]) null );
}
catch ( Exception e ) {
throw new InstantiationException( "Could not instantiate entity: ", mappedClass, e );
}
}
}
项目:cacheonix-core
文件:PojoInstantiator.java
public Object instantiate() {
if ( ReflectHelper.isAbstractClass(mappedClass) ) {
throw new InstantiationException( "Cannot instantiate abstract class or interface: ", mappedClass );
}
else if ( optimizer != null ) {
return optimizer.newInstance();
}
else if ( constructor == null ) {
throw new InstantiationException( "No default constructor for entity: ", mappedClass );
}
else {
try {
return constructor.newInstance( null );
}
catch ( Exception e ) {
throw new InstantiationException( "Could not instantiate entity: ", mappedClass, e );
}
}
}
项目:lams
文件:InstantiationOptimizerAdapter.java
@Override
public Object newInstance() {
try {
return fastClass.newInstance();
}
catch ( Exception e ) {
throw new InstantiationException(
"Could not instantiate entity with Javassist optimizer: ",
fastClass.getJavaClass(),
e
);
}
}
项目:lewei_angul
文件:WebSecurityConfig.java
/**
* Creates an iv-user header filter to get user id from TAM/Webseal.
*
* @return the request header authentication filter
* @throws Exception
* the exception if something goes wrong
*/
private RequestHeaderAuthenticationFilter createIVUserHeaderFilter() {
RequestHeaderAuthenticationFilter requestFilter = new RequestHeaderAuthenticationFilter();
requestFilter.setPrincipalRequestHeader("iv-user");
requestFilter.setExceptionIfHeaderMissing(false);
requestFilter.setCheckForPrincipalChanges(true);
try {
requestFilter.setAuthenticationManager(this.authenticationManagerBean());
} catch (Exception e) {
LOG.error("Error during security setup", e);
throw new InstantiationException("Error creating authentication manager", WebSecurityConfig.class, e);
}
return requestFilter;
}
项目:cacheonix-core
文件:UnsavedValueFactory.java
private static Object instantiate(Constructor constructor) {
try {
return constructor.newInstance(null);
}
catch (Exception e) {
throw new InstantiationException( "could not instantiate test object", constructor.getDeclaringClass(), e );
}
}
项目:cacheonix-core
文件:InstantiationOptimizerAdapter.java
public Object newInstance() {
try {
return fastClass.newInstance();
}
catch ( Throwable t ) {
throw new InstantiationException(
"Could not instantiate entity with Javassist optimizer: ",
fastClass.getJavaClass(), t
);
}
}
项目:cacheonix-core
文件:InstantiationOptimizerAdapter.java
public Object newInstance() {
try {
return fastClass.newInstance();
}
catch ( Throwable t ) {
throw new InstantiationException(
"Could not instantiate entity with CGLIB optimizer: ",
fastClass.getJavaClass(),
t
);
}
}
项目:lams
文件:UnsavedValueFactory.java
/**
* Instantiate a class using the provided Constructor
*
* @param constructor The constructor
*
* @return The instantiated object
*
* @throws InstantiationException if something went wrong
*/
private static Object instantiate(Constructor constructor) {
try {
return constructor.newInstance();
}
catch (Exception e) {
throw new InstantiationException( "could not instantiate test object", constructor.getDeclaringClass(), e );
}
}