Page 1 of 1

BroadLeaf and Glassfish

Posted: Mon Mar 28, 2011 8:17 pm
by idont
I have been working as you know trying to get BroadLeaf up and running, I took a break. I now realize some of my issues are actually GlassFish related. For instance, I had to change the transaction type of blPU and blSecurePU from "RESOURCE_LOCAL" to "JTA"; otherwise, Glassfish would not work. I now notice that similarly there are errors in regard to Date Columns not being marked in regard to being Temporal (see error below)....

I am curious should I simply change all this core code myself, or will this be released soon as a fix in soon to come versions? Is there any plan to make this project available to a GlassFish Server Implementation?

Btw, The error that I have seen is as follows (though it is likely applicable to every EJB without the @Temporal annotation, which I think is standard notation now):

SEVERE: Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method
javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [blSecurePU] failed.
Internal Exception: Exception [EclipseLink-7212] (Eclipse Persistence Services - 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The attribute [reivewSubmittedDate] from the entity class [class org.broadleafcommerce.rating.domain.ReviewDetailImpl] does not specify a temporal type. A temporal type must be specified for persistent fields or properties of type java.util.Date and java.util.Calendar.
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(
at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(
at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(
at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(
at org.glassfish.persistence.jpa.JPADeployer.prepare(
at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(
at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(
at org.glassfish.javaee.full.deployment.EarDeployer.access$200(
at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(
at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(
at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(
at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(
at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(
at org.glassfish.javaee.full.deployment.EarDeployer.prepare(
at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(
at org.glassfish.deployment.admin.DeployCommand.execute(
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(
at com.sun.enterprise.v3.admin.AdminAdapter.service(
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(
at com.sun.grizzly.http.ProcessorTask.doProcess(
at com.sun.grizzly.http.ProcessorTask.process(
at com.sun.grizzly.http.DefaultProtocolFilter.execute(
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(
at com.sun.grizzly.DefaultProtocolChain.execute(
at com.sun.grizzly.DefaultProtocolChain.execute(
at com.sun.grizzly.http.HttpProtocolChain.execute(
at com.sun.grizzly.ProtocolChainContextTask.doCall(
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(
at com.sun.grizzly.util.AbstractThreadPool$

Re: BroadLeaf and Glassfish

Posted: Tue Mar 29, 2011 10:04 am
by idont
I have been working on trying to make the code ready for GlassFish, so far I have changed quite a few classes:



But I am a little stuck here.... Because to make CategoryXref to work, CategoryXrefPK must be declared with @Embeddable, but it is referenced as an @EmbeddableId; however, @EmbeddableId does not allow for complex annotations like joins, changing it from @EmbeddableId to a simple embedded object of course makes CategoryXref no longer have any id to itself.

I guess I am a little over my head here in regard to Hibernate and EJBs in this framework. Any advice of how to solve this issue and make it Glassfish ready?

The error:
Exception Description: The mapping [category] from the embedded ID class [class org.broadleafcommerce.catalog.domain.CategoryXrefPK] is an invalid mapping for this class. An embeddable class that is used with an embedded ID specification (attribute [categoryXrefPK] from the source [class org.broadleafcommerce.catalog.domain.CategoryXref]) can only contain basic mappings. Either remove the non basic mapping or change the embedded ID specification on the source to be embedded.

Re: BroadLeaf and Glassfish

Posted: Tue Mar 29, 2011 7:47 pm
by idont
I really do need help.... I cannot seem to solve this otherwise....

Re: BroadLeaf and Glassfish

Posted: Thu Mar 31, 2011 6:06 am
by jefffischer
I think this is what you're looking for. The trick I think is to get Glassfish to use Hibernate as the JPA provider instead of its own internal JPA provider. Take a look at this link: ... a_provider

Of course, once you've made this change, If I were you I would try to see if Broadleaf back in its original state (before your changes) works, as you should no longer be battling the default JPA provider.