[Persistence, JBoss/CMP, Hibernate, Database] - IllegalAccessError with Hibernate Annotation
by apfeuti
Hi
If I try to build a SessionFactory for annotated classes
AnnotationConfiguration cfg = new AnnotationConfiguration();
| cfg.addAnnotatedClass(mypackage.MyAnnotatedEntity.class);
| SessionFactory sessionFactory = cfg.buildSessionFactory();
(or if I try with an xml-configuration instead the above code)
I get always this error:
java.lang.IllegalAccessError: tried to access method org.hibernate.cfg.Mappings.(Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/List;Ljava/util/List;Lorg/hibernate/cfg/NamingStrategy;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/List;Ljava/util/Map;Ljava/util/Map;)V from class org.hibernate.cfg.ExtendedMappings
at org.hibernate.cfg.ExtendedMappings.(ExtendedMappings.java:65)
at org.hibernate.cfg.AnnotationConfiguration.createExtendedMappings(AnnotationConfiguration.java:175)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:263)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1210)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
I use the latest Hibernate and Hibernate-Annotations.
I deployed the latest hibernate3.jar to /server/all/lib and
hibernate-annotations.jar, hibernate-commons-annotations.jar, ejb3-persistence.jar to /server/all/farm.
The same code works perfectly in a standalone-environment (no JBoss, just a VM for JUnit-Tests). So it cannot be a incompatibility between Hibernate and Hibernate-Annotations.
Thanks for any help
Andreas
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043259#4043259
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043259
19 years
[JBoss Seam] - ClassCastException: org.jboss.seam.jsf.SeamApplication11 inc
by titou09
Hello,
I'm trying to setup a project with seam 1.2.1 on WebSphere v6.1.0.7.
WAS v6.1.0.7 has a JSF 1.1 implementation based on JSF Sun RI. When WAS tries to start the application, I get the following exception:
WebApp E Extension processor failed to initialize in factory: com.ibm.ws.jsf.extprocessor.JSFExtensionFactory@cd60cd6
java.lang.ClassCastException: org.jboss.seam.jsf.SeamApplication11 incompatible with com.sun.faces.application.ApplicationImpl
at com.ibm.ws.jsf.configuration.FacesConfigParser.createFacesFactories(FacesConfigParser.java:1019)
at com.ibm.ws.jsf.configuration.FacesConfigParser.initializeConfiguration(FacesConfigParser.java:354)
at com.ibm.ws.jsf.util.FacesConfigUtil._parseJSFConfiguration(FacesConfigUtil.java:128)
at com.ibm.ws.jsf.util.FacesConfigUtil.parseJSFConfiguration(FacesConfigUtil.java:82)
at com.sun.faces.util.Util.verifyFactoriesAndInitDefaultRenderKit(Util.java:497)
at com.ibm.ws.jsf.configuration.FacesConfig.initialize(FacesConfig.java:96)
Q:
- Any idea for this exception (I'v tried lots of things to try to have it working, including playing with classloader...)
- What is the requirement for seam on JSF: Does seam absolutely requires "MyFaces" as JSF implementation? or can I use WAS JSF 1.1 implementation bases on Sun RI? or more generally any JSF 1.1 compatible implementation?
- Anyone there running seam 1.2.1 on WAS v6.1.0.7 with the builtin JSF implementation?
thx
file /WEB-INF/faces-config.xml:
------------------------------------
<?xml version="1.0"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
<phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>
</faces-config>
file /WEB-INF/web.xml:
--------------------------
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.jsp</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.NUMBER_OF_VIEWS_IN_SESSION</param-name>
<param-value>15</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.enableHighAvailability</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.COMPRESS_STATE</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>com.ibm.ws.jsf.JSP_UPDATE_CHECK</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>com.ibm.ws.jsf.LOAD_FACES_CONFIG_AT_STARTUP</param-name>
<param-value>true</param-value>
</context-param>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>-1</load-on-startup>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
</web-app>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043258#4043258
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043258
19 years
[JBoss Seam] - Performance issues with batch insert
by toni
Hi,
in our webapplication the user can trigger a batch insert, which will create about 400 entities. This takes about 40 minutes.
In the beginning each entity gets created within a second. The more entities are inserted and the further the process progreses, the slower it gets.
In the end it takes about 7 seconds to create one and this trend seems to continue. I'm currently running a test to insert a few thousand entities to see what happens.
First I thought that this might be because of some imperformant SELECT statements of mine. There is lots of business logic involved in creating a single entity with all it's relationships.
However, if after a batch insert has been completed successfully I start another one, then the same thing happens over. Considerably fast in the beginning and the slowly slowing down.
If it would be about the tables growing larger, then the second batch insert should be slow from the very start.
Does anybody know what could be the cause of this?
Also I was wondering, whether or not this is the right forum, because it could be actually an EJB/Hibernate issue instead of a seam issue?!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043247#4043247
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043247
19 years
[JNDI/Naming/Network] - Re: lookup database source weird problem
by jaikiran
anonymous wrote : oracleDS = (javax.sql.DataSource) initialContext.lookup("jdbc/OracleDS");
This should be
oracleDS = (javax.sql.DataSource) initialContext.lookup("java:comp/env/jdbc/OracleDS");
Also,
anonymous wrote :
| <resource-ref>
| <res-ref-name>jdbc/OracleDS</res-ref-name>
| <res-type>javax.sql.DataSource</res-type>
| <jndi-name>jdbc/OracleDS</jndi-name>
| </resource-ref>
The jndi-name here doesnt look right to me. Most of the times it is java:/OracleDS. So try using the following:
<resource-ref>
| <res-ref-name>jdbc/OracleDS</res-ref-name>
| <res-type>javax.sql.DataSource</res-type>
| <jndi-name>java:/OracleDS</jndi-name>
| </resource-ref>
|
If that doesnt work, post the error message that you are seeing and also the *-ds.xml file which you are using for configuring the datasource
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043245#4043245
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043245
19 years