[JBoss Portal] - Re: Data access / persistence - could you help?
by JohnnyTheHun
Thank you for answering,
I am moving step by step, but moving nontheless.
I tried creating and persisting EJB beans, but there where too many unknown errors, so know I'm trying to just persist a simple class with Hibernate.
But I am still unable to persist a class, because of the following exception:
| org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of a.b.c.Cikk.cim
| org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:171)
| org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of a.b.c.Cikk.cim
| org.hibernate.property.BasicPropertyAccessor$BasicGetter.getForInsert(BasicPropertyAccessor.java:182)
| org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of a.b.c.Cikk.cim
| org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValuesToInsert(AbstractEntityTuplizer.java:271)
| org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of a.b.c.Cikk.cim
| ....
|
If anyone could lend a hand, I would be happy.
I created my Hibernate mbean in my .har in the jboss-service.xml file:
| </mbean>
| <mbean code="org.jboss.hibernate.jmx.Hibernate"
| name="jboss.har:service=Hibernate">
| <attribute name="DatasourceName">java:/DefaultDS</attribute>
| <attribute name="Dialect">
| org.hibernate.dialect.HSQLDialect
| </attribute>
| <attribute name="SessionFactoryName">
| java:/hibernate/SessionFactory
| </attribute>
|
| <attribute name="ScanForMappingsEnabled">true</attribute>
| <attribute name="Hbm2ddlAuto">create</attribute>
| </mbean>
|
|
My simple class I want to be able to persist:
| package a.b.c;
|
| import java.io.Serializable;
| import javax.persistence.Id;
| import javax.persistence.*;
|
| /*@Entity
| @Table(name = "cikk")*/
| public class Cikk implements Serializable{
| private Long id;
| private String cim="Alapérték";
| private String valami="Alapérték";
|
| /** Creates a new instance of Cikk */
| public Cikk() {
| }
|
| public Cikk(Long id,String cim) {
| setId(id);
| setCim(cim);
| }
|
| public Cikk(String cim) {
| setCim(cim);
| }
|
| //@Id
| public Long getId() { return id; }
|
| public void setId(Long id) {
| this.id = id;
| }
|
| public String getCim() {
| return cim;
| }
|
| public void setCim(String cim) {
| this.cim = cim;
| }
|
| public String getValami() {
| return valami;
| }
|
| public void setValami(String valami) {
| this.valami = valami;
| }
|
| }
|
I wanted to use annotations for persistance, but Hibernate was unable to find them, I didn't find how to use the Annotation SessionFactory or something like that. (I tried a persistance.xml with mapping class, but that didn't help)
So I created my mapping file cikk.hbm.xml instead:
| <?xml version="1.0"?>
| <!DOCTYPE hibernate-mapping PUBLIC
| "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
| "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
|
| <hibernate-mapping>
| <class name="a.b.c.Cikk" table="cikk">
| <id name="id">
| <generator class="native"/>
| </id>
| <property name="cim"/>
| <property name="valami"/>
| </class>
| </hibernate-mapping>
|
I do not know why I get the exception.
I tried taking properties out from the mapping file, until only the id remained, but the error persisted, except it said:
org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling setter of a.b.c.Cikk.id
I must be missing something basic, can anyone help?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4107876#4107876
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4107876
18 years, 5 months
[JBossWS] - Re: Webservice not starting in AS 4.2.2
by richard.opalka@jboss.com
| ...
| 20:43:03,655 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
| 20:43:04,665 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
| 20:43:04,975 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
| 20:43:04,996 INFO [Server] JBoss (MX MicroKernel) [4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200711201921)] Started in 45s:236ms
| 20:44:15,086 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer
| 20:44:15,102 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=test2.jar,name=HelloWorld,service=EJB3 with dependencies:
| 20:44:15,600 INFO [EJBContainer] STARTED EJB: org.jboss.test.ws.jaxws.jbws.HelloWorld ejbName: HelloWorld
| 20:44:15,784 INFO [EJB3Deployer] Deployed: file:/opt/svn/jbossas/tags/JBoss_4_2_2_GA/build/output/jboss-4.2.2.GA/server/default/deploy/test2.jar/
| 20:44:16,001 INFO [DefaultEndpointRegistry] register: jboss.ws:context=test2,endpoint=HelloWorld
| 20:44:19,366 INFO [WSDLFilePublisher] WSDL published to: file:/opt/svn/jbossas/tags/JBoss_4_2_2_GA/build/output/jboss-4.2.2.GA/server/default/data/wsdl/test2.jar/HelloWorld50713.wsdl
| 20:44:19,606 INFO [TomcatDeployer] deploy, ctxPath=/test2, warUrl=.../tmp/deploy/test2.jar50712.war
Richard
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4107868#4107868
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4107868
18 years, 5 months
[JBoss Seam] - maven 2 junit and seam test
by pete76
Hi
I am trying to get Seam tests to work under maven so I am using:
org.jboss.embedded
hibernate-all
beta2
test
<dependenc
org.jboss.embedded
jboss-embedded-all
beta2
test
org.jboss.embedded
thirdparty-all
beta2
test
and then when I run mvn test the Embeeded complained that it could not find conf/boostrap-beans.xml so I copied the conf dir (from the Seam 2.0 GA) example into my test resources folder and now I get this error, if anyone knows what causes this or can assist in any way I be very grateful!
java.lang.RuntimeException: Unable to bootstrap:
at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:167)
at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:201)
at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:214)
at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:11)
at org.jboss.seam.mock.JunitBaseSeamTest.startJbossEmbeddedIfNecessary(JunitBaseSeamTest.java:1006)
at org.jboss.seam.mock.JunitBaseSeamTest.init(JunitBaseSeamTest.java:931)
at org.jboss.seam.mock.JunitSeamTest.init(JunitSeamTest.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.junit.internal.runners.ClassRoadie.runBefores(ClassRoadie.java:49)
at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:36)
at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818)
Caused by: java.lang.IllegalStateException: ServerConfig is already installed.
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:264)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:192)
at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:84)
at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:161)
... 23 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4107858#4107858
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4107858
18 years, 5 months