[Beginners Corner] - Problem with JBoss Examples
by Hirschniesel
Hi,
I just tried to execute the JBoss example application found in org.jboss.book.jms.ex3.SendRecvClient. I executed the build.xml found in the example root directory and got a BUILD SUCCESSFULLY. So I think, everything needed is installed on the jboss. I changed the "jboss.dist" property within the build.xml to my local jboss directory. Now I tried to execute the SendRecvClient application using the java command from the shell. I also added the concurrent.jar and the jboss-j2ee.jar to my classpath. But now I got hte following exception:
anonymous wrote : Exception in thread "main" javax.naming.CommunicationException: Can't find SerialContextProvider
| at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:63)
| at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:120)
| at javax.naming.InitialContext.lookup(InitialContext.java:351)
| at org.jboss.book.jms.ex3.SendRecvClient.setupPubSub(SendRecvClient.java:55)
| at org.jboss.book.jms.ex3.SendRecvClient.sendRecvAsync(SendRecvClient.java:71)
| at org.jboss.book.jms.ex3.SendRecvClient.main(SendRecvClient.java:95)
|
Can someone tell me, what is going wrong here? Thanks for your help and best reagrds,
Andreas
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082335#4082335
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082335
18 years, 7 months
[EJB 3.0] - CascadeType.PERSIST question
by ttrepper
Hi all,
I am running into troubles with the cascdetype, Please imagine the following szenario:
SQL (tables)
| CREATE TABLE Party (
| PartyID BIGINT DEFAULT nextval('seq_PartyID') NOT NULL,
| CONSTRAINT PK_Party PRIMARY KEY (PartyID)
| );
|
| CREATE TABLE PartyIsPerson (
| PartyIDPerson BIGINT NOT NULL,
| Forename CHARACTER VARYING(80) NOT NULL,
| Lastname CHARACTER VARYING(80) NOT NULL,
| CONSTRAINT PK_PartyIsPerson PRIMARY KEY (PartyIDPerson)
| );
|
| CREATE TABLE PersonHasCustomization (
| PartyIDPerson BIGINT NOT NULL,
| Locale CHARACTER VARYING(5),
| CONSTRAINT PK_PersonHasCustomization PRIMARY KEY (PartyIDPerson)
| );
The Party-class ist declared with @Inheritance(strategy=InheritanceType.JOINED)
and the PartyIsPerson extends from it.
| package com.auctonova.ejb.persistence;
|
| import java.io.Serializable;
| import java.sql.Date;
|
| import javax.persistence.Entity;
| import javax.persistence.OneToOne;
| import javax.persistence.PrimaryKeyJoinColumn;
| import javax.persistence.CascadeType;
|
| @Entity
| @PrimaryKeyJoinColumn(name="partyidperson", referencedColumnName="partyid")
| public class PartyIsPerson extends Party implements Serializable {
| private static final long serialVersionUID = 1L;
| private String forename;
| private String lastname;
| private PersonHasCustomization customization;
|
| //--------------------------------------------------------------------------
| public String getForename() {
| return this.forename;
| }
|
| //--------------------------------------------------------------------------
| public void setForename(String forename) {
| this.forename = forename;
| }
|
| //--------------------------------------------------------------------------
| public String getLastname() {
| return this.lastname;
| }
|
| //--------------------------------------------------------------------------
| public void setLastname(String lastname) {
| this.lastname = lastname;
| }
|
| //--------------------------------------------------------------------------
| @OneToOne(cascade=CascadeType.PERSIST)
| @PrimaryKeyJoinColumn(name="partyidperson", referencedColumnName="partyidperson")
| public PersonHasCustomization getCustomization() {
| return this.customization;
| }
|
| //--------------------------------------------------------------------------
| public void setCustomization(PersonHasCustomization customization) {
| this.customization = customization;
| }
| }
|
When I am now trying to execute the following code in a bean
| PartyIsPerson p = new PartyIsPerson();
| p.setUsername("Guest"); //Guest
| p.setPassword("Guest"); //Guest
| p.setForename("Guest"); //Guest
| p.setLastname("Guest"); //Guest
| p.setPartyId(100);
|
| PersonHasCustomization phc = new PersonHasCustomization();
| phc.setLocale("DE_de");
| p.setCustomization(phc);
|
| EntityManager.persist(p)
than I get the following error:
| 11:19:28,953 ERROR [JDBCExceptionReporter] Batch-Eintrag 0 insert into PersonHasCustomization (locale, pm_forward_to, partyidperson) values (DE_de, NULL, 0) wurde abgebrochen. Rufen Sie 'getNextException' auf, um die Ursache zu erfahren.
| 11:19:28,953 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: 23503
| 11:19:28,953 ERROR [JDBCExceptionReporter] ERROR: insert or update on table "personhascustomization" violates foreign key constraint "partyisperson_personhascustomization"
| Detail: Key (partyidperson)=(0) is not present in table "partyisperson".
| 11:19:28,953 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
In my opinion this part of the exception
Detail: Key (partyidperson)=(0) is not present in table "partyisperson"
means, that something is wrong with the Primary-keys, of course there is no person with the id=0, but i want the EntityManager automatically to assign the customisation the SAME id (in this case 100), before inserting both.
Does anybody has an idea, what i am doing wrong?
Thank you very much for help and kind regards,
Thomas
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082332#4082332
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082332
18 years, 7 months
[JBoss Seam] - HTMLLoadStyle definition not found
by mindgame
Using Seam 2 Nightly build and Richfaces 3.1.0 RC5, got the following exception,
Caused by: java.lang.NoClassDefFoundError: org/ajax4jsf/ajax/html/HtmlLoadStyle
| at java.lang.ClassLoader.defineClass1(Native Method)
| at java.lang.ClassLoader.defineClass(Unknown Source)
| at java.security.SecureClassLoader.defineClass(Unknown Source)
| at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1817)
| at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872)
| at org.jboss.web.tomcat.service.WebAppClassLoader.findClass(WebAppClassLoader.java:139)
| at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1325)
| at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
| at java.lang.ClassLoader.loadClassInternal(Unknown Source)
| at java.lang.ClassLoader.defineClass1(Native Method)
| at java.lang.ClassLoader.defineClass(Unknown Source)
| at java.security.SecureClassLoader.defineClass(Unknown Source)
| at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1817)
| at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872)
| at org.jboss.web.tomcat.service.WebAppClassLoader.findClass(WebAppClassLoader.java:139)
| at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1325)
| at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
| at java.lang.ClassLoader.loadClassInternal(Unknown Source)
| at java.lang.Class.forName0(Native Method)
| at java.lang.Class.forName(Unknown Source)
| at com.sun.faces.util.Util.loadClass(Util.java:227)
| at com.sun.faces.application.ApplicationImpl.newThing(ApplicationImpl.java:1003)
| ... 139 more
The HtmlLoadStyle in RichFaces 3.1.0 RC5 is now packaged in "/org/ajax4jsf/component/html" inside richfaces-ui-3.1.0-rc5.jar.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082331#4082331
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082331
18 years, 7 months