Re: [Resin-interest] 2 errors in simple project
I tried to use the eclipse environment to run this little sample with the help of Steffen Busch, but I continue to have the error: com.caucho.amber.AmberRuntimeException: 'adlhessian.Ejbuser' with classloader EnvironmentClassLoader[web-app:http://localhost:8000] is an illegal instance class Riccardo Cohen wrote: hi again I'm really blocked with my developments, can somebody help me with this strange problem ? I can send the source it is very small and the error is systematic. Thanks a lot. Riccardo Cohen wrote: ok thanks for the url info. Now for the amber problem : I cleaned all including work directory, after first run, found a .class for all my ejbs (in classes folder). In work/pre-enhance folder I have the following files : Ejbuser__ResinExt.class Ejbuser__ResinExt.java Ejbuser.class and nothing in work/ejb I dont' know if the files are valid, but the applications does not work, and continue to try to recompile if I request it. I tried to add load-on-startup/ for the servlet that uses that ejb, but it did not change. I also tried to put the whole application in webapps/ROOT in resin folder, but no success. The error is systematic. would you like me to send you the full app folder ? Scott Ferguson wrote: This is much more complicated. Amber does bytecode enhancement at the classloader level, so there are complicated timing issues. Specifically, if something loads the Ejbuser class before Amber has configured it, you'll get the non-enhanced class. There might also be some cases where an error in generating the enhanced class might not get logged properly. Does the log show any kind of error? Also, is there a valid file in WEB-INF/work/pre-enhance? -- Scott -- Très cordialement, Riccardo Cohen --- Articque http://www.articque.com 149 av Général de Gaulle 37230 Fondettes - France tel : 02-47-49-90-49 fax : 02-47-49-91-49 ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] 2 errors in simple project
Hi I'm using resin 3.1.5 and the latest mysql jdbc driver. I try to build a minimal sample from scratch to be sure to understand everything with entity ejbs. I found 2 problems I cannot understand : 1) database configuration This is my conf : database jndi-name=jdbc/adlhessian driver typecom.mysql.jdbc.Driver/type urljdbc:mysql://localhost/adlhessian/url userhessian/user passwordhessian/password /driver prepared-statement-cache-size8/prepared-statement-cache-size max-connections20/max-connections max-idle-time30s/max-idle-time spytrue/spy /database I get the error in finer log : com.caucho.config.ConfigException: 'url' is an unknown attribute of 'com.mysql.jdbc.Driver' and the same for user and password. But it seems to work anyway !! why this error while the docs seems to tell it is correct... 2) ejb configuration I have one single entity ejb : package adlejb; import.. @Entity @Table(name=adluser) public class Ejbuser { @Id @Column(name=adlid) @GeneratedValue int id; @Basic @Column(name=adlfirstname) String firstname; @Basic @Column(name=adlname) String name; .. and the config in persistence.xml is : persistence xmlns=http://java.sun.com/xml/ns/persistence; version=1.0 persistence-unit name=Adlhessian classadlejb.Ejbuser/class exclude-unlisted-classes / /persistence-unit /persistence But I continue to have the error = com.caucho.amber.AmberRuntimeException: 'adlejb.Ejbuser' with classloader EnvironmentClassLoader[web-app:http://localhost:8000] is an illegal instance class What does it mean ? I found no error, and tried to have a look at mailinglist archive with no success. I looked at the samples, but found nothing really different... The crazy about this is that I built this simple app from another simple app configured exactly the same manner, but the other does not make any amber error ! I tried to rename everything several times, but nothing seems to remove this error. I had the same problem sometimes with resin 3.0 and in 2006 Rodrigo Westrupp answered that I should work with resin 3.1. Thanks for any information (files attached) -- Très cordialement, Riccardo Cohen --- Articque http://www.articque.com 149 av Général de Gaulle 37230 Fondettes - France tel : 02-47-49-90-49 fax : 02-47-49-91-49 package adlejb; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name=adluser) public class Ejbuser { @Id @Column(name=adlid) @GeneratedValue int id; @Basic @Column(name=adlfirstname) String firstname; @Basic @Column(name=adlname) String name; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getFirstname() { return firstname; } public void setFirstname(String firstname) { this.firstname = firstname; } public String getName() { return name; } public void setName(String name) { this.name = name; } } persistence xmlns=http://java.sun.com/xml/ns/persistence; version=1.0 persistence-unit name=Adlhessian classadlejb.Ejbuser/class exclude-unlisted-classes / /persistence-unit /persistence web-app xmlns=http://caucho.com/ns/resin; database jndi-name=jdbc/adlhessian driver typecom.mysql.jdbc.Driver/type urljdbc:mysql://localhost/adlhessian/url init-param autoReconnect=true/ init-param noDatetimeStringSync=true/ init-param jdbcCompliantTruncation=false/ userhessian/user passwordhessian/password /driver prepared-statement-cache-size8/prepared-statement-cache-size max-connections20/max-connections max-idle-time30s/max-idle-time spytrue/spy /database ejb-server data-source=jdbc/adlhessian create-database-schema=false/ servlet servlet-name=adlservice servlet-class=adlhessian.Adlservice/ servlet-mapping url-pattern=/adlservice/* servlet-name=adlservice/ /web-app ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] 2 errors in simple project
On Mar 14, 2008, at 9:00 AM, Riccardo Cohen wrote: Hi I'm using resin 3.1.5 and the latest mysql jdbc driver. I try to build a minimal sample from scratch to be sure to understand everything with entity ejbs. I found 2 problems I cannot understand : 1) database configuration This is my conf : database jndi-name=jdbc/adlhessian driver typecom.mysql.jdbc.Driver/type urljdbc:mysql://localhost/adlhessian/url userhessian/user passwordhessian/password /driver prepared-statement-cache-size8/prepared-statement-cache-size max-connections20/max-connections max-idle-time30s/max-idle-time spytrue/spy /database I get the error in finer log : com.caucho.config.ConfigException: 'url' is an unknown attribute of 'com.mysql.jdbc.Driver' and the same for user and password. But it seems to work anyway !! why this error while the docs seems to tell it is correct... The logging has been changed to finest. It's only being logged to avoid totally swallowing the error. Some drivers have a setUrl method, which uses the value of the url directly. So Resin is trying to find and set that method. Since the getConnection also has a URL argument, it's optional. 2) ejb configuration I have one single entity ejb : But I continue to have the error = com.caucho.amber.AmberRuntimeException: 'adlejb.Ejbuser' with classloader EnvironmentClassLoader[web-app:http://localhost:8000] is an illegal instance class This is much more complicated. Amber does bytecode enhancement at the classloader level, so there are complicated timing issues. Specifically, if something loads the Ejbuser class before Amber has configured it, you'll get the non-enhanced class. There might also be some cases where an error in generating the enhanced class might not get logged properly. Does the log show any kind of error? Also, is there a valid file in WEB-INF/work/pre-enhance? -- Scott What does it mean ? I found no error, and tried to have a look at mailinglist archive with no success. I looked at the samples, but found nothing really different... The crazy about this is that I built this simple app from another simple app configured exactly the same manner, but the other does not make any amber error ! I tried to rename everything several times, but nothing seems to remove this error. I had the same problem sometimes with resin 3.0 and in 2006 Rodrigo Westrupp answered that I should work with resin 3.1. Thanks for any information (files attached) -- Très cordialement, Riccardo Cohen --- Articque http://www.articque.com 149 av Général de Gaulle 37230 Fondettes - France tel : 02-47-49-90-49 fax : 02-47-49-91-49 package adlejb; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name=adluser) public class Ejbuser { @Id @Column(name=adlid) @GeneratedValue int id; @Basic @Column(name=adlfirstname) String firstname; @Basic @Column(name=adlname) String name; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getFirstname() { return firstname; } public void setFirstname(String firstname) { this.firstname = firstname; } public String getName() { return name; } public void setName(String name) { this.name = name; } } persistence xmlns=http://java.sun.com/xml/ns/persistence; version=1.0 persistence-unit name=Adlhessian classadlejb.Ejbuser/class exclude-unlisted-classes / /persistence-unit /persistence web-app xmlns=http://caucho.com/ns/resin; database jndi-name=jdbc/adlhessian driver typecom.mysql.jdbc.Driver/type urljdbc:mysql://localhost/adlhessian/url init-param autoReconnect=true/ init-param noDatetimeStringSync=true/ init-param jdbcCompliantTruncation=false/ userhessian/user passwordhessian/password /driver prepared-statement-cache-size8/prepared-statement-cache-size max-connections20/max-connections max-idle-time30s/max-idle-time spytrue/spy /database ejb-server data-source=jdbc/adlhessian create-database- schema=false/ servlet servlet-name=adlservice servlet- class=adlhessian.Adlservice/ servlet-mapping url-pattern=/adlservice/* servlet- name=adlservice/ /web-app ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest