[JBoss Portal] - Re: ClassCastException accessing EJB3 from portlet
by cuoz
Thank you for the responses. Here is the packaging details:
for the EJB3 deployment:
panel-server.ejb3:
class files for both client & server
META-INF/persistence.xml
META-INF/jboss.xml (security domain declaration)
for the portlet deployment:
panel-email.war:
WEB-INF/classes (portlet related classes)
WEB-INF/lib/panel-client.jar (client jar for session & interfaces)
WEB-INF/email-object.xml
WEB-INF/portlet-instances.xml
WEB-INF/portlet.xml
WEB-INF/web.xml
unibrew: you indicated that I should not have client classes in both places, but my past experience (regular webapps, not portlets) is that to hot-deploy and not affect multiple applications I need to have them in both places and have call-by-value & such configured (which I believe I do). I am able to do this with my regular test war file.
My goal is to have appropriate packaging to allow updates to the EJB3 application without needed to redeploy all the portlets & other applications (jbpm will be in the mix also).
Thank you for the help,
gary.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961102#3961102
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961102
19 years, 9 months
[Persistence, JBoss/CMP, Hibernate, Database] - facing issues in persisting standalone application using hib
by gup123
Hi I am new to this area and I am using hibernate3.2, hibernate-annotation3.2 and hibernate-entitymanager3.2 for persisting a object in the database in a standalone program i.e. plain java, but i am getting the following program when i run.
Please suggest any solution or if i am missing anything: exception is =:
[java] Exception in thread "main" java.lang.IllegalAccessError: tried to access method net.s
f.ehcache.CacheManager.()V from class org.hibernate.cache.EhCacheProvider
[java] at org.hibernate.cache.EhCacheProvider.start(EhCacheProvider.java:124)
[java] at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:180)
[java] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1213)
[java] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuratio
n.java:631)
[java] at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configurati
on.java:760)
[java] at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:151)
[java] at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configurati
on.java:205)
[java] at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePer
sistence.java:114)
[java] at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
[java] at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27)
[java] at com.FirstApp.SSTest.addNS(Unknown Source)
[java] at com.FirstApp.SSTest.main(Unknown Source)
[java] Java Result: 1
Code is some thing like this:
/**
* AB generated by hbm2java
*/
@Entity
@Table(name="ABs"
,schema="Cat"
, uniqueConstraints = { }
)
public class ABs implements java.io.Serializable {
// Fields
private NId id;
private Cdates cdates;
// Constructors
/** default constructor */
public ABs() { }
/** full constructor */
public ABs(NId id, Cdates cdates) {
this.id = id;
this.cdates = cdates; }
// Property accessors
@EmbeddedId
@AttributeOverrides( {
@AttributeOverride(name="A",...))
@AttributeOverride(name="B", ...) ) } )
public NId getId() { return this.id; }
public void setId(NId id) { this.id = id; }
@ManyToOne(cascade={},
fetch=FetchType.LAZY)
@JoinColumn(name="A", unique=false, nullable=false, insertable=false, updatable=false)
......
}
another class
/**
* NId generated by hbm2java
*/
@Embeddable
public class NId implements java.io.Serializable {
// Fields
private String a;
private String b;
// Constructors
/** default constructor */
public NId() {
}
/** full constructor */
public NId(String a, String b) {
this.a = a;
this.b = b;
}
// Property accessors
@Column(name="a", unique=false, nullable=false, insertable=true, updatable=true, length=200)
public String getA() { return this.a; }
public void setA(String a) { this.a = a; }
@Column(name="B", unique=false, nullable=false, insertable=true, updatable=true, length=30)
public String getB() { return this.b; }
public void setB(String b) { this.b = b; }
public boolean equals(Object other){.....}
public int hashCode() {....)
}
and the main class is
public class SSTest {
public static void main(String[] arg)
{
SSTest sstest = new SSTest();
sstest.addNS();
}
public void addNS()
{
EntityManagerFactory emf = Persistence.createEntityManagerFactory("manager1");
NId item = new NId( "111111", "111111" );
ABs ns = new ABs();
ns.setId(item);
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
em.persist( ns );
em.getTransaction().commit();
}// end of method
}// End of Class
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961090#3961090
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961090
19 years, 9 months