[EJB 3.0] - Embedded JBoss & MBean
by jc7442
I use embedded JBoss alpha8.
When I try to deploy an MBean into embedded JBoss, I have an exception:
@Service (objectName="trail:service=calculator")
| @Management(Calculator.class)
| public class CalculatorMBean implements Calculator {
| ...
java.lang.RuntimeException: Problem registering @Management interface for @Service class fr.biomerieux.audit.browser.CalculatorMBean
| at org.jboss.ejb3.service.ServiceContainer.registerManagementInterface(ServiceContainer.java:381)
| at org.jboss.ejb3.service.ServiceContainer.start(ServiceContainer.java:107)
| ...
| at org.jboss.ejb3.embedded.EJB3StandaloneDeployer.start(EJB3StandaloneDeployer.java:460)
| at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.scanClasspath(EJB3StandaloneBootstrap.java:291)
| ...
| Caused by: java.lang.IllegalStateException: No 'jboss' MBeanServer found!
| at org.jboss.mx.util.MBeanServerLocator.locateJBoss(MBeanServerLocator.java:122)
| at org.jboss.ejb3.service.ServiceContainer.registerManagementInterface(ServiceContainer.java:360)
| ... 42 more
|
Is it possible to deploy MBean in Embedded JBoss ?
Should I add a deployment file to start MBeanServer ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4007787#4007787
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4007787
19 years, 2 months
[EJB 3.0] - Re: ERM to Entity relationship problem
by te-bachi
Fifth approach:
| org.hibernate.AnnotationException: com.ubs.gis.audit.entity.AuditSearchAssignPK has no persistent id property
| at org.hibernate.cfg.AnnotationBinder.bindId(AnnotationBinder.java:1702)
| at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1171)
| at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:706)
| at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:452)
| at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:268)
| at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1039)
| at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1211)
| at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:154)
| at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:847)
| at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:385)
| at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:126)
| at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264)
| [...]
|
Assign PK:
| @Embeddable
| public class AuditSearchAssignPK implements Serializable {
| //
| }
|
Assign Entity:
| @Entity(name = "AuditSearchAssignEntity")
| @Table(schema = "UGIS1004", name = "GIS_T_AUDIT_SEARCH_ASSIGN")
| public class AuditSearchAssignEntity {
| private AuditSearchAssignPK pk;
| private BigInteger criteriaOrder;
| private BigInteger isSpecific;
| private AuditSearchCriteriaEntity criteriaId;
| private AuditSearchTemplateEntity templateId;
|
| @EmbeddedId
| public AuditSearchAssignPK getPk() {
| return pk;
| }
|
| public void setPk(AuditSearchAssignPK pk) {
| this.pk = pk;
| }
|
| @ManyToOne
| @JoinColumn(name = "CRITERIA_ID", referencedColumnName = "CRITERIA_ID", nullable = false)
| public AuditSearchCriteriaEntity getCriteriaId() {
| return criteriaId;
| }
|
| public void setCriteriaId(AuditSearchCriteriaEntity criteriaId) {
| this.criteriaId = criteriaId;
| }
|
| @ManyToOne
| @JoinColumn(name = "TEMPLATE_ID", referencedColumnName = "TEMPLATE_ID", nullable = false)
| public AuditSearchTemplateEntity getTemplateId() {
| return templateId;
| }
|
| public void setTemplateId(AuditSearchTemplateEntity templateId) {
| this.templateId = templateId;
| }
|
| @Column(name = "CRITERIA_ORDER", nullable = false, length = 4)
| public BigInteger getCriteriaOrder() {
| return criteriaOrder;
| }
|
| public void setCriteriaOrder(BigInteger criteriaOrder) {
| this.criteriaOrder = criteriaOrder;
| }
|
| @Column(name = "IS_SPECIFIC", nullable = false, length = 1)
| public BigInteger getIsSpecific() {
| return isSpecific;
| }
|
| public void setIsSpecific(BigInteger specific) {
| isSpecific = specific;
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4007773#4007773
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4007773
19 years, 2 months
[JBoss Seam] - Re: How to avoid implicit database update
by umarzubair
Now I am using your recommendation
@Begin(flushMode=MANUAL) and at end of conversation calling session.flush() explicitly.
Now I have another problem. Suppose 1 conversation has 2 requests.
In request 1, Application fetch a record say 'A' from database.
Before second request, Record 'A' gets updated by some other transaction.
In request 2, Application need to execute same query to find record 'A' again with latest data. HibernateSession does not go into database to find latest values for Record 'A' and it return same record 'A' fetched in request 1.
If I use session.evict(model) in request 1, then request 2 returns latest record from database.
Is there any way to get latest record from database every time without using evict method.
Regards,
Umar
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4007770#4007770
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4007770
19 years, 2 months