[EJB 3.0] - unidirectional Many-To-Many relationships
by urkens_jp
When trying to model unidirectional M-t-M relations I get a org.hibernate.MappingException.
I tried the example from Mastering EJB3.0 from Wiley Publishing:
| @Entity(name="CourseUni")
| public class Course implements Serializable {
| private int id;
| private String courseName;
|
| private Collection<Student> students = new ArrayList<Student>();
|
| public Course() { id = (int)System.nanoTime(); }
|
| @Id
| public int getId() { return id; }
|
| public void setId(int id) { this.id = id;}
|
| public String getCourseName() { return courseName;}
|
| public void setCourseName(String courseName) {
| this.courseName = courseName;
| }
|
| public Collection<Student> getStudents() {
| return students;
| }
|
| public void setStudents(Collection<Student> students) {
| this.students = students;
| }
| }
|
| @Entity(name="StudentUni")
| public class Student implements Serializable {
| private int id;
| private String name;
| private Collection<Course> courses = new ArrayList<Course>();
|
| public Student() { id = (int)System.nanoTime(); }
|
| @Id
| public int getId() { return id; }
| public void setId(int id) { this.id = id;}
| public String getName() { return name; }
| public void setName(String name) { this.name = name; }
|
| @ManyToMany(cascade={CascadeType.ALL},fetch=FetchType.EAGER)
| @JoinTable(name="STUDENTUNI_COURSEUNI")
| public Collection<Course> getCourses() {
| return courses;
| }
|
| public void setCourses(Collection<Course> courses) {
| this.courses = courses;
| }
|
|
When deploying this on JBOSS-4.0.5.GA following Exception is thrown:
:49:41,641 DEBUG [org.jboss.ejb3.ServiceDelegateWrapper] Starting failed persistence.units:jar=tutorial.jar,unitName=tempdb
| javax.persistence.PersistenceException: org.hibernate.MappingException: Could not determine type for: java.util.Collection, for columns: [org.hibernate.mapping.Column(students)]
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037526#4037526
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037526
19 years
[JBoss Seam] - ClassNotFoundException while invoking EL function during ren
by nstoddar
I wrote a simple EL function to retrieve the clientId of a UIComponentBase object -- I'm generating some javascript. The first time I load the page (without a submit), the page generates just fine, including the javascript output that successfully invoked my EL function from a h:outputText element.
However, when I submit the form it throws a ClassNotFoundException (for my EL function class) and generally freaks out after that. Now, obviously it should be able to find the class since it managed to find it on the initial rendering of the page.
Am I missing something about using EL functions in a JSF tag?
[#|2007-04-16T08:48:20.964-0400|WARNING|sun-appserver-pe9.0|javax.enterprise.system.stream.err|_ThreadID=13;_ThreadName=httpWorkerThread-8080-0;_RequestID=4b5ea96a-bb72-4f91-b3d8-b6e133212a32;|
| java.lang.ClassNotFoundException: biz.apexsurvey.tags.jsf.functions.ClientIdFunctions
| at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
| at java.security.AccessController.doPrivileged(Native Method)
| at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
| at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
| at com.sun.appserv.server.util.ASURLClassLoader.loadClass(ASURLClassLoader.java:100)
| at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
| at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
| at java.lang.Class.forName0(Native Method)
| at java.lang.Class.forName(Class.java:169)
| at com.sun.el.lang.FunctionMapperImpl$Function.getMethod(FunctionMapperImpl.java:167)
| at com.sun.el.lang.FunctionMapperImpl.resolveFunction(FunctionMapperImpl.java:59)
| at com.sun.el.parser.AstFunction.getValue(AstFunction.java:91)
| at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
| at javax.faces.component.UIOutput.getValue(UIOutput.java:173)
| at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:189)
| at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:320)
| at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:200)
| at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:833)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:896)
| at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
| at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
| at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:244)
| at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:175)
| at org.jboss.seam.jsf.SeamViewHandler.renderView(SeamViewHandler.java:59)
| at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
| at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:278)
| at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
| at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
| at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
| at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
| at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
| at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
| at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
| at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
| at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
| at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
| at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
| at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
| at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
| at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
| at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
| at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
| at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
| at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
| at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
| |#]
|
| [#|2007-04-16T08:48:20.967-0400|WARNING|sun-appserver-pe9.0|javax.enterprise.resource.webcontainer.jsf.lifecycle|_ThreadID=13;_ThreadName=httpWorkerThread-8080-0;_RequestID=4b5ea96a-bb72-4f91-b3d8-b6e133212a32;|executePhase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl@5ef727) threw exception
| javax.faces.FacesException: javax.el.ELException: Function 'cu:getClientId' not found
| at javax.faces.component.UIOutput.getValue(UIOutput.java:176)
| at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:189)
| at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:320)
| at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:200)
| at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:833)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:896)
| at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
| at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
| at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:244)
| at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:175)
| at org.jboss.seam.jsf.SeamViewHandler.renderView(SeamViewHandler.java:59)
| at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
| at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:278)
| at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
| at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
| at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
| at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
| at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
| at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
| at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
| at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
| at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
| at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
| at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
| at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
| at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
| at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
| at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
| at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
| at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
| at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
| at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
| Caused by: javax.el.ELException: Function 'cu:getClientId' not found
| at com.sun.el.parser.AstFunction.getValue(AstFunction.java:93)
| at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
| at javax.faces.component.UIOutput.getValue(UIOutput.java:173)
| ... 40 more
| |#]
|
| [#|2007-04-16T08:48:20.972-0400|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.container.web|_ThreadID=13;_ThreadName=httpWorkerThread-8080-0;_RequestID=4b5ea96a-bb72-4f91-b3d8-b6e133212a32;|StandardWrapperValve[faces-servlet]: Servlet.service() for servlet faces-servlet threw exception
| javax.el.ELException: Function 'cu:getClientId' not found
| at com.sun.el.parser.AstFunction.getValue(AstFunction.java:93)
| at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
| at javax.faces.component.UIOutput.getValue(UIOutput.java:173)
| at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:189)
| at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:320)
| at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:200)
| at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:833)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:896)
| at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
| at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
| at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:244)
| at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:175)
| at org.jboss.seam.jsf.SeamViewHandler.renderView(SeamViewHandler.java:59)
| at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
| at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:278)
| at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
| at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
| at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
| at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
| at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
| at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
| at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
| at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
| at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
| at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
| at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
| at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
| at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
| at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
| at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
| at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
| at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
| at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
| at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
| |#]
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037523#4037523
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037523
19 years
[JBoss AOP] - Unable to use/run JBossAOP on JBossAS 4.0.5.GA
by varkon
I'm trying to use AOP inside JBoss AS 4.0.5.GA but to no avail.
I've downloaded and installed the latest version of JBossAOP and:
-Deleted existing jboss-aop.deployer from the deploy folder
-Copied over the jboss-aop-jdk50.deployer to the deploy folder
-added pluggable-instrumentor.jar to the bin folder
-added -javaagent:pluggable-instrumentor.jar to JAVA_OPTS
-Using JDK/JRE 1.5.0 update 11
My jboss-service.xml for aop.deployer is the following:
| <mbean code="org.jboss.aop.deployment.AspectManagerServiceJDK5"
| name="jboss.aop:service=AspectManager">
| <attribute name="EnableLoadtimeWeaving">true</attribute>
| <attribute name="SuppressTransformationErrors">true</attribute>
| <attribute name="Prune">true</attribute>
| <attribute name="Include">org.jboss.test, org.jboss.injbossaop</attribute>
| <attribute name="Exclude">org.jboss.</attribute>
| <!-- This avoids instrumentation of hibernate cglib enhanced proxies
| <attribute name="Ignore">*$$EnhancerByCGLIB$$*</attribute> -->
| <attribute name="Optimized">true</attribute>
| <attribute name="Verbose">false</attribute>
| </mbean>
|
| <mbean code="org.jboss.aop.deployment.AspectDeployer"
| name="jboss.aop:service=AspectDeployer">
| </mbean>
|
| </server>
|
My jboss-aop.xml is:
| <aop>
| <aspect class="org.lg.eapp.aop.AOPLoggingAspect" scope="PER_VM"/>
| <bind pointcut="execution(public org.lg.eapp.web.Handlers.ResponseHandler org.lg.eapp.web.Controller.Login->ProccessRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse))">
| <advice aspect="org.lg.eapp.aop.AOPLoggingAspect" name="log"/>
| </bind>
| </aop>
|
and is located in aspects.aop/META-INF/
my application.xml is:
| <application>
| <module>
| <java>aspects.aop</java>
| </module>
| <module>
| <java>support.jar</java>
| </module>
| <module>
| <ejb>ejbs.jar</ejb>
| </module>
| <module>
| <web>
| <web-uri>webapp.war</web-uri>
| <context-root>eapp</context-root>
| </web>
| </module>
| </application>
|
and finally my jboss-app.xml is:
| <jboss-app>
| <loader-repository>eapp:loader=eapp.ear</loader-repository>
| <module>
| <har>hibernate.har</har>
| </module>
| </jboss-app>
|
I should note that I'm using isolated class-loading, so my UseJBossWebLoader attribute in the Tomcat service conf. is "false".
However, When the "ProccessRequest" method is called in the Login Servlet (as defined in the jboss-aop.xml above), nothing happens(there should be a console message saying "Hello AOP!"). No errors, no info. Nothing. The only thing I did notice, is a measurable slowdown when using the -javaagent option.
Any help will be much appreciated. Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037521#4037521
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037521
19 years