[EJB 3.0] - entity bean name in ejb3 RC7
by michalzel
Hello!
I have just migrated from JBoss4.0.3, EJB3 RC3 to JBoss 4.0.4, EJB3 RC7. My EAR project consists of two packages: logic.jar (previously .ejb3) with SLSB & SFSB, and data.jar (previously .par) with entity beans. After consulting wiki EJB migration guide, I deployed application to new server. When I try to execute following query:
SELECT u FROM User AS u WHERE u.login= :login
I got the following exception:
| javax.persistence.PersistenceException: org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [SELECT u FROM User AS u where u.login = :login]
|
Which is strange, as User should be the enity bean name by the specification.
When I put fully qualified name of the entity:
SELECT u FROM myPackage.User AS u WHERE u.login= :login
I got
| javax.persistence.PersistenceException: org.hibernate.HibernateException: could not locate named parameter [login]
|
User entity is defined as:
| package myPackage;
| @Entity
| @Table(name = "APPLICATION_USERS")
| public class User implements Serializable
| {
| ...
| private String login;
| @Column(name = "USERNAME", nullable = false, unique = true)
| public String getLogin()
| {
| return this.login;
| }
|
| public void setLogin(String login)
| {
| this.login = login;
| }
| }
|
persistence.xml is defined as:
| <?xml version="1.0" encoding="UTF-8"?>
| <persistence xmlns="http://java.sun.com/xml/ns/persistence"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
| version="1.0">
| <persistence-unit name="MyEntityManager" transaction-type="JTA">
| <jta-data-source>java:/MyDS</jta-data-source>
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="none" />
| <property name="hibernate.dialect"
| value="org.hibernate.dialect.Oracle9Dialect" /> </properties>
| </persistence-unit>
|
| </persistence>
|
I have put it into logic and data jars. Am I missing something?
regards
Micha?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963374#3963374
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963374
19 years, 9 months
[JBoss Seam] - Re: @WebRemote: problem with client site instantiation of ob
by rlhr
Hello,
So I got time to do more testing. Now the interface generated for the SelectItem is fine and got all the methods defined.
Seam.Remoting.type.javax$faces$model$SelectItem = function() {
| this.value = undefined;
| this.label = undefined;
| this.disabled = undefined;
| this.description = undefined;
| Seam.Remoting.type.javax$faces$model$SelectItem.prototype.getValue = function() { return this.value; }
| Seam.Remoting.type.javax$faces$model$SelectItem.prototype.getLabel = function() { return this.label; }
| Seam.Remoting.type.javax$faces$model$SelectItem.prototype.isDisabled = function() { return this.disabled; }
| Seam.Remoting.type.javax$faces$model$SelectItem.prototype.getDescription = function() { return this.description; }
| Seam.Remoting.type.javax$faces$model$SelectItem.prototype.setValue = function(value) { this.value = value; }
| Seam.Remoting.type.javax$faces$model$SelectItem.prototype.setLabel = function(label) { this.label = label; }
| Seam.Remoting.type.javax$faces$model$SelectItem.prototype.setDisabled = function(disabled) { this.disabled = disabled; }
| Seam.Remoting.type.javax$faces$model$SelectItem.prototype.setDescription = function(description) { this.description = description; }
| }
|
| Seam.Remoting.type.javax$faces$model$SelectItem.__name = "javax.faces.model.SelectItem";
| Seam.Remoting.type.javax$faces$model$SelectItem.__metadata = [
| {field: "value", type: "bean"},
| {field: "label", type: "str"},
| {field: "disabled", type: "bool"},
| {field: "description", type: "str"}];
|
| Seam.Remoting.registerType(Seam.Remoting.type.javax$faces$model$SelectItem);
|
Also I was able to import a non-component classes:
<script type="text/javascript" src="/myApp/seam/remoting/interface.js?test.RangeValue">/* IE */</script>
|
generated the following interface:
Seam.Remoting.type.test$RangeValue = function() {
| this.value = undefined;
| this.minValue = undefined;
| this.maxValue = undefined;
| Seam.Remoting.type.test$PriceRange.prototype.getValue = function() { return this.value; }
| Seam.Remoting.type.test$PriceRange.prototype.getMinValue = function() { return this.minValue; }
| Seam.Remoting.type.test$PriceRange.prototype.getMaxValue = function() { return this.maxValue; }
| Seam.Remoting.type.test$PriceRange.prototype.setValue = function(value) { this.value = value; }
| Seam.Remoting.type.test$PriceRange.prototype.setMinValue = function(minValue) { this.minValue = minValue; }
| Seam.Remoting.type.test$PriceRange.prototype.setMaxValue = function(maxValue) { this.maxValue = maxValue; }
| }
|
| Seam.Remoting.type.test$RangeValue.__name = "test.RangeValue";
| Seam.Remoting.type.test$RangeValue.__metadata = [
| {field: "value", type: "number"},
| {field: "minValue", type: "number"},
| {field: "maxValue", type: "number"}];
|
| Seam.Remoting.registerType(Seam.Remoting.type.test$RangeValue);
|
Everything looks good to me.
Thanks for this great work.
Richard
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963368#3963368
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963368
19 years, 9 months
[JBossCache] - Re: java.lang.NoSuchFieldError: log
by iudoka
"iudoka" wrote : Hey guys, Im new to JBoss Cache, im simply trying to configure and kick start a cache instance and it keeps giving me a java.lang.NoSuchFieldError and I'm not quite sure why.
|
| Here is the full exception:
|
| anonymous wrote : Exception in thread "main" java.lang.NoSuchFieldError: log
| | at org.jboss.cache.aop.PojoCache.parseConfig(PojoCache.java:107)
| | at org.jboss.cache.aop.PojoCache.startService(PojoCache.java:95)
| | at com.tite.test.gui.DatasourceGUIProxy.init(DatasourceGUIProxy.java:256)
| | at com.tite.test.gui.DatasourceGUIProxy.(DatasourceGUIProxy.java:170)
| | at com.tite.test.gui.DatasourceGUIProxy.getInstance(DatasourceGUIProxy.java:275)
| | at com.tite.test.test$2.run(test.java:66)
| | at com.tite.test.gui.MyProgressBar.showDialog(MyProgressBar.java:166)
| | at com.tite.test.test.createAndShowSplashScreen(test.java:122)
| | at com.tite.test.test.main(test.java:107)
|
|
| Here is my code to start the Cache:
|
| "Code" wrote : try
| | {
| | // Create Cache
| | m_cache = new PojoCache();
| | PropertyConfigurator config = new PropertyConfigurator();
| |
| | // configure the cache through injection
| | config.configure(m_cache, "META-INF/cache-service2.xml");
| | m_cache.setClusterName("My-Cluster");
| | // kick start the cache
| | m_cache.startService();
| | }
| | catch(Exception ex)
| | {
| | // Unable to start Cache
| | s_theLogger.log(Level.SEVERE, "Unable to start cache", ex);
| | m_cache = null;
| | }
|
| I'm not sure exactly what it could be, if anyone could give me some pointers i'd appreciate it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963365#3963365
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963365
19 years, 9 months
[JBossCache] - java.lang.NoSuchFieldError: log
by iudoka
Hey guys, Im new to JBoss Cache, im simply trying to configure and kick start a cache instance and it keeps giving me a java.lang.NoSuchFieldError and I'm not quite sure why.
Here is the full exception:
anonymous wrote : Exception in thread "main" java.lang.NoSuchFieldError: log
| at org.jboss.cache.aop.PojoCache.parseConfig(PojoCache.java:107)
| at org.jboss.cache.aop.PojoCache.startService(PojoCache.java:95)
| at com.tite.medicalworks.gui.DatasourceGUIProxy.init(DatasourceGUIProxy.java:256)
| at com.tite.medicalworks.gui.DatasourceGUIProxy.(DatasourceGUIProxy.java:170)
| at com.tite.medicalworks.gui.DatasourceGUIProxy.getInstance(DatasourceGUIProxy.java:275)
| at com.tite.medicalworks.MedicalWorks$2.run(MedicalWorks.java:66)
| at com.tite.medicalworks.gui.MyProgressBar.showDialog(MyProgressBar.java:166)
| at com.tite.medicalworks.MedicalWorks.createAndShowSplashScreen(MedicalWorks.java:122)
| at com.tite.medicalworks.MedicalWorks.main(MedicalWorks.java:107)
Here is my code to start the Cache:
"Code" wrote : try
| {
| // Create Cache
| m_cache = new PojoCache();
| PropertyConfigurator config = new PropertyConfigurator();
|
| // configure the cache through injection
| config.configure(m_cache, "META-INF/cache-service2.xml");
| m_cache.setClusterName("My-Cluster");
| // kick start the cache
| m_cache.startService();
| }
| catch(Exception ex)
| {
| // Unable to start Cache
| s_theLogger.log(Level.SEVERE, "Unable to start cache", ex);
| m_cache = null;
| }
I'm not sure exactly what it could be, if anyone could give me some pointers i'd appreciate it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963364#3963364
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963364
19 years, 9 months