[jboss-user] [JBoss Portal] - Re: JBoss 5 Integration
Hi, I followed the instructions from the following page http://www.jboss.org/community/wiki/JBossPortalonAS5, but rather than using 5.1.0Beta1, I am using 5.1.0.GA. Both maven compiling steps went fine for me, but unfortunately the compiling of the JBoss_Portal_Branch_2_7_AS5 had i few issues. Here is the output: [javac] Compiling 249 source files to /commons/data/downloads/jboss/portal_as5/portal/wsrp/output/classes | [javac] /commons/data/downloads/jboss/portal_as5/portal/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java:45: warning: [deprecation] org.jboss.xb.binding.XercesXsMarshaller in org.jboss.xb.binding has been deprecated | [javac] import org.jboss.xb.binding.XercesXsMarshaller; | [javac]^ | [javac] /commons/data/downloads/jboss/portal_as5/portal/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/DeploymentTestCase.java:33: package org.jboss.portal.metadata.wsrp.consumer does not exist | [javac] import org.jboss.portal.metadata.wsrp.consumer.ConsumerDeploymentsMetaData; | [javac] ^ | [javac] /commons/data/downloads/jboss/portal_as5/portal/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/DeploymentTestCase.java:34: package org.jboss.portal.metadata.wsrp.consumer does not exist | [javac] import org.jboss.portal.metadata.wsrp.consumer.WSRPProducerMetaData; | [javac] ^ | [javac] /commons/data/downloads/jboss/portal_as5/portal/wsrp/src/main/org/jboss/portal/wsrp/WSRPResourceURL.java:30: warning: [deprecation] org.jboss.portal.common.util.MediaType in org.jboss.portal.common.util has been deprecated | .. I discovered that to resolve this build issue I had to add the jar create from the mvn install for the metadata (metadata-wsrp-trunk-SNAPSHOT.jar). This then leads to the following build problem: [javac] /commons/data/downloads/jboss/portal_as5/portal/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPConsumerDeploymentImpl.java:43: package org.jboss.portal.deployer.wsrp.container does not exist | [javac] public class WSRPConsumerDeploymentImpl implements org.jboss.portal.deployer.wsrp.container.WSRPDeployment | [javac] ^ | [javac] /commons/data/downloads/jboss/portal_as5/portal/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPConsumerDeploymentImpl.java:65: cannot find symbol | [javac] symbol : class ConsumerDeploymentsMetaData | [javac] location: class org.jboss.portal.wsrp.deployment.WSRPConsumerDeploymentImpl | [javac]public void deployConsumer (ConsumerDeploymentsMetaData deployments) | [javac]^ | Adding the jar created from mvn package for the deployer fixes this build issue. This gives me the following structure in jboss server/all/deploy (NOTE, gif and
[jboss-user] [EJB 3.0] - Re: mapping generic entities
HI, Have you tried annotating the abstract classes with @MappedSuperclass, this annotation means the class annotated with it is not an entity, and as such hibernate will not attempt to map it. Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4085865#4085865 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4085865 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Getting a session from entityManager
Hi, Does the EntityManager work normally, for example does em.persist() work ? I have had a problem berfore with em.getDelegate() returning an EntityManagerImpl which could not be cast to a session. In the end i had to call Session sess = (Session)((EntityManagerImpl)em.getDelegate()).getDelegate() or Session sess = (Session)((EntityManagerImpl)em.getDelegate()).getSession() Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4071171#4071171 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4071171 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Database Connection
Hi you're right, a chage is needed in the persistence file: change the following jta-data-sourceOracle/jta-data-source to jta-data-sourcejava:/Oracle/jta-data-source Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4054690#4054690 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4054690 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: cannot simultaneously fetch multiple bags
This exception can also occur when you are performing multiple fetch joins (on bags) in a query Cheers, Andrew View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4052705#4052705 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4052705 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Primary key generator best practices? (Postgres specific
don't forget to add allocationSize = 1 to the @SequenceGenerator annotation, or what is stored migth not match the sequence values. Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4051223#4051223 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4051223 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: JBOSS 4.2.0 MySQL
Hi, I would create a mysql-ds.xml file in /deploy. I have copied the standard example one that comes with JBoss 4.0.4/5 (it should hopefully just work with 4.2.0GA as well): ?xml version=1.0 encoding=UTF-8? !-- $Id: mysql-ds.xml 41016 2006-02-07 14:23:00Z acoliver $ -- !-- Datasource config for MySQL using 3.0.9 available from: http://www.mysql.com/downloads/api-jdbc-stable.html -- | datasources | local-tx-datasource | jndi-nameMySqlDS/jndi-name | connection-urljdbc:mysql://mysql-hostname:3306/jbossdb/connection-url | driver-classcom.mysql.jdbc.Driver/driver-class | user-namex/user-name | passwordy/password | exception-sorter-class-nameorg.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter/exception-sorter-class-name | !-- should only be used on drivers after 3.22.1 with ping support | valid-connection-checker-class-nameorg.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker/valid-connection-checker-class-name | -- | !-- sql to call when connection is created | new-connection-sqlsome arbitrary sql/new-connection-sql | -- | !-- sql to call on an existing pooled connection when it is obtained from pool - MySQLValidConnectionChecker is preferred for newer drivers | check-valid-connection-sqlsome arbitrary sql/check-valid-connection-sql | -- | | !-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -- | metadata |type-mappingmySQL/type-mapping | /metadata | /local-tx-datasource | /datasources | On startup this file will be deployed, and now you can use it with ejb3 e.t.c Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4051226#4051226 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4051226 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: javax.naming.NameNotFoundException: MyEjb3 not bound :(
It could also be helpful if you could post the exact structure of the ear archive and what is contained within it e.g. (application.xml contents) Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4050394#4050394 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4050394 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: javax.naming.NameNotFoundException: MyEjb3 not bound :(
Have you tried binding it to a specific name using the following annotations: | @LocalBinding(jndiBinding = name) | @RemoteBinding(jndiBinding=name) | then you could look up the name as defined in Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4050237#4050237 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4050237 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Datasource with JBoss and Hibernate
Hi, Try renaming the xml file the datasource is defined in to the following, epus3-ds.xml or oracle-ds.xml. This is how datasources are configured in JBoss running on Linux (note the -ds.xml) i assume it is the same for Windows. Cheers Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4049606#4049606 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4049606 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Hibernate and XML persistence implementation
Hi, You will need to use a Hibernate session, with the EntityMode set to DOM4J. You should hopefully be able to extract the data and store it into an xml document, but you will have to set up all the mappings in hbm.xml files (I think) Thanks, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4048638#4048638 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4048638 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: wrong value generated by a sequence generator in jboss-4
Hi, In the @SequenceGenerator annotation add the following attributes: allocationSize=1, initialValue=1 You can leave the initialValue attribute out if you want, as all you should need to get it to work correctly is the allocationSize attribute. Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4047447#4047447 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4047447 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Hibernate3: Cannot simultaneously fetch multiple bags
Hi, The problem comes from the following code: | private CollectionRole roles = new ArrayListRole(); | private CollectionGroup groups = new ArrayListGroup(); | A Collection is treated as a bag. You have have some possibilities to fix it. An easy solution is to use the @CollectionID. Another solution would be to change them to List and then use the @IndexColum, and the final solution is to change the to Set. You must read up on Hibernate Collection mapping first, to see whats suits your data model best. Go to this URL: http://www.hibernate.org/hib_docs/annotations/reference/en/html/entity.html#entity-mapping-association Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4045401#4045401 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4045401 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBossWS] - Re: Need help on wsdl first webservice approach documentatio
Hi, You can use the 1.0.4GA release of JBossWS no with no prblems in 4.0.4.GA Thanks, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4028364#4028364 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4028364 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBossWS] - Re: advice needed
Hi, I am not running the client via the wsrunclient, i am trying to run it as a standalone app (probably not the best idea, considering the trouble i am having). I added the correct jar into the classpath but i now get a org.jboss.ws.WSException: Cannot find configFile: META-INF/standard-jaxws-client-config.xml error when trying to run the client. I even installed jbossws1.0.4GA on 4.0.4GA and i still get the same problem after coping the standard-jaxws-client-config.xml in the META-INF within the jbossws.sar dir in deploy. I am now attempting to call the web service via a HTTP form with the web service URL as the action (using HTTP POST) , the web service returns something but it is only an error saying: | env:Envelope |env:Header/ |env:Body | faultcodeenv:Client/faultcode | faultstring | Unsupported content type: application/x-www-form-urlencoded | /faultstring |/env:Body | /env:Envelope | Any help/adivce would be appreciated. Thanks, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4027533#4027533 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4027533 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBossWS] - advice needed
Hi, Let me first explain that i am a beginner when it come to jboss web services, so i am sorry if this is a stupid problem. I installed jbossws-1.2.0.GA last week to an ejb3-clustered install of jboss4.0.5.GA. I then proceeded to follow the simple step listed here http://wiki.jboss.org/wiki/Wiki.jsp?page=JBWS181HelloWorld I created an EJB3 (Stateless bean) like so: @RemoteBinding(jndiBinding = ws_remote) | @Stateless | @WebService | @SOAPBinding(style = SOAPBinding.Style.RPC) | public class WebServiceTestBean implements IWebServiceTestRemote { | | | @WebMethod | @WebResult(name = res) | public String echo(@WebParam(name = input_string) String pInputString) { | System.out.println(pInputString); | return pInputString + :: web serviced; | } | | | } And the wsdl generation for it worked. So i am now trying to access it with a simple client. I created the client using the wsconsume.sh script (with -k option) provided with jbossws. This creates the following file: /** | * JBossWS Generated Source | * | * Generation Date: Mon Mar 12 14:55:35 CET 2007 | * | * This generated source code represents a derivative work of the input to | * the generator that produced it. Consult the input for the copyright and | * terms of use that apply to this source code. | * | * JAX-WS Version: 2.0 | * | */ | @WebServiceClient(name = WebServiceTestBeanService, targetNamespace = http://beans.test.com/;, wsdlLocation = http://172.16.26.83:8080/test/Echo?wsdl;) | public class WebServiceTestBeanService extends Service { | | private final static URL WEBSERVICETESTBEANSERVICE_WSDL_LOCATION; | | static { | URL url = null; | try { | url = new URL(http://172.16.26.83:8080/test/Echo?wsdl;); | } catch (MalformedURLException e) { | e.printStackTrace(); | } | WEBSERVICETESTBEANSERVICE_WSDL_LOCATION = url; | } | | public WebServiceTestBeanService(URL wsdlLocation, QName serviceName) { | super(wsdlLocation, serviceName); | } | | public WebServiceTestBeanService() { | super(WEBSERVICETESTBEANSERVICE_WSDL_LOCATION, new QName(http://beans.test.com/;, WebServiceTestBeanService)); | } | | | /** | * | * @return | * returns WebServiceTestBean | */ | @WebEndpoint(name = WebServiceTestBeanPort) | public WebServiceTestBean getWebServiceTestBeanPort() { | return (WebServiceTestBean)super.getPort(new QName(http://beans.test.com/;, WebServiceTestBeanPort), WebServiceTestBean.class); | } | | } I then try to create a WebServiceTestBeanService object, and call the getWebServiceTestBeanPort method which should return a proxy to the web service which i can call the test method echo with. I am running into trouble with creating the WebServiceTestBeanService object, as i get a noClassDefFound exception, the stack trace is: Exception in thread main java.lang.NoClassDefFoundError: org/jboss/xb/binding/ObjectModelFactory | at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.init(ServiceDelegateImpl.java:108) | at org.jboss.ws.core.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:61) | at javax.xml.ws.Service.init(Service.java:83) | at com.test.beans.WebServiceTestBeanService.init(WebServiceTestBeanService.java:45) | at com.test.beans.driver.main(driver.java:13) | can anybody tell me what i have done wrong. Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4027192#4027192 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4027192 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: @ManyToOne results in tinyblob
Hi Andreas, from looking at your base entity, i can see that you are mixing the levels of your annotations. In my experience this is a cause of so many problems (and if it causes any exceptions they are not very helpful at all), try moving all you annotations to field level or to method (getter) level. Let me know if this helps. Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4025016#4025016 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4025016 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Getting generated ID by sequence
Hi, Try declaring your sdequence as so: @SequenceGenerator(name = tsperson_sequence, allocationSize=1, sequenceName = SEQ_TSPERSON_ID) You must have the allocationSize=1 (or some other value) or it uses some kind of hi-lo strategy. Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4025152#4025152 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4025152 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: HQL and enum constants
Hi. try this: SELECT DISTINCT m FROM Material m, IN(m.suppliers) s WHERE m.unit Material$MaterialUnit.SQUARE_METRES AND s.id = :id I am not sure if you will need the package name before Material. Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4020649#4020649 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4020649 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Disable schema cration on JBoss embedded
Hi Maik, I also think it is ok to set the hbm2ddl.auto task to none, like so: property name=hibernate.hbm2ddl.auto value=none/ Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4013499#4013499 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4013499 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Updating JBoss 4.0.5.GA to use the latest Hibernate Jars
Hi, Don't forget to replace the files (hibernate-annotations, hibernate3-client) in the client directory Thanks, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4013027#4013027 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4013027 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: ENTITY not mapped
Hi, Try to change the query to the following instead: from person p where p.class='US' order by name, forename Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4009540#4009540 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4009540 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Query
Hi, The are a few ways that the multiple bag exception can be avoided. You mentioned using a Set instead, this would solve the problem but it has the restriction that it can only contain distinct values so you need to consider if they will work for you. Another solution would be to use Lists, but i would personally never do this as i have experienced lots of problems (like them missing out the join table they create in queries) with Bi-Directional indexed relationships (using a list to map a oneToMany) The thrid solution could be to keep using collections, but also annotate with @CollectionId, i have not used this yet, but i reckon it could also run into problems with bi-directional relationships. Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4009555#4009555 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4009555 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Query
Hi Dalibor, The help is no problem, as i ran into quite a lot of these errors when i first started using Hibernate + EJB3 + JBoss. I also went with the Set to solve the Multiple Bag problem, as it seems the easiest so long as it fits the data model. I think @CollectionId is a hibernate specific annotation that is not in the spec, as it was only introduced with the last release. Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4009891#4009891 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4009891 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Query
Hi, In an EJBQL query you can fetch the collection by using a fetch join, such as the following example (taken from Enterprise Java Beans 3.0) SELECT c FROM Customer c LEFT JOIN FETCH c.phones Where Customer is an entity containing a collection (relationship) of phones. Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4008270#4008270 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4008270 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Query
It is possible to keep fetching ahead, but you need to watch out for the classic hibernate Could not fetch multiple bags exception. To do multiple fetching, you will just need to use aliases, for example: SELECT c FROM Customer c LEFT JOIN FETCH c.phones cp JOIN FETCH cp.some other collection Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4008342#4008342 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4008342 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: ERM to Entity relationship problem
Hi, The problem with you first appraoch is the you have an entity ( AuditSearchAssignEntity) with no @Id declared in it. Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4007827#4007827 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4007827 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: How to deploy an EJB3 app in production ?
have you tried setting the hbm2ddl to update, it creates the schema if it does not exist and updates if it (if any updates are needed). Beware that it (in my experience) only adds to the schema and does not remove from the schema. Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4007873#4007873 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4007873 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: How to connect my EJB to firebird database?
Hi, You need to configure a persistence.xml file and then pack it in the META-INF dir of the ejb jar. The persistence.xml will look somethjing like so: ?xml version=1.0 encoding=UTF-8? | persistence | persistence-unit name=myPU | jta-data-sourcejava:/you firebird ds name/jta-data-source | classmanaged class name/class | properties | property name=hibernate.dialect value=org.hibernate.dialect.FirebirdDialect/ | property name=hibernate.hbm2ddl.auto value=create-drop/ | /properties | /persistence-unit | /persistence You can then inject an EntityManager with the @PersistenceContext annotation within a Session bean. Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4007885#4007885 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4007885 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: naming of attributes in queries
Hi, Could you post up some your entity code, and the actual query you are trying to get to work. Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4003711#4003711 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4003711 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Same query doesn't work on jboss-4.0.5.GA
Hi Andreas, I think this is a problem with the newer version (3.2.0.GA) of hibernate that ships with 4.0.5GA. I had a query that worked with Hibernate version 3.2.0CR2 but on upgrading to the final release the query did not work, because i was also getting a null pointer exception (exactly the same as yours). There is a bug for it in the Hibernate JIRA http://opensource.atlassian.com/projects/hibernate/browse/HHH-2159, it is a really simple fix if you want to do it yourself. Here is the link to the thread on the hibernate forum http://forum.hibernate.org/viewtopic.php?t=966031highlight=breaks. Also please vote for the bug as well. Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4000319#4000319 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4000319 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Same query doesn't work on jboss-4.0.5.GA
Hi Andreas, First off you need to open the offending class (org.hibernate.hql.ast.tree.FromClause) and then locate addDuplicateAlias method, and then just put the fromElementByClassAlias.put( alias, element ); call into an if statement like so: | void addDuplicateAlias(String alias, FromElement element) { | if(alias != null) { | fromElementByClassAlias.put( alias, element ); | } | } | This solution has not been verified by the hibernate people, but if you look in the method above addDuplicateAlias(registerFromElement) they always perform the hashmap.put() calls in an if statement checking that the key (classAlias) is not null. This got rid of my problem, hopefully it should do the same for you. After you have modified the source, rebuild with ant, i would use the target jar or dist Let me know how you get on with it. Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4000511#4000511 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4000511 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Same query doesn't work on jboss-4.0.5.GA
seems like you managed it :-) I did not manage to get it to buiild via ant from eclipse. I also got some other error with the junit tasks in the build file, but running ant jar or ant dist work fine Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4000514#4000514 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4000514 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Getting Exception for Derby Data Source
Hi, If you want to use Derby as the default DS you will need to do some more config (i have done this for EJBTimerService and for JMS/MDB) For EJBTimerService, you will need to edit the ejb-timer-service.xml file located in the deploy directory and change the following line depends optional-attribute-name=DataSourcejboss.jca:service=DataSourceBinding,name=DefaultDS/depends btw, you will only need to do this if your Derby datasource is called something else other than DefaultDS, but seems as you get the error i am assuming yourts is not called DefaultDS. For the JMS/MDB i would suggest copying the derby-jdbc2-service.xml from $JBOSS_HOME/doc/examples/jms/ into deploy/jms/ and edit the datsource name as needed. Remove the hsqldb-jdbc2-service.xml and rename hsqldb-jdbc-state-service.xml to derby-jdbc-state-service.xml, and edit the datasource name if needed. Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3998963#3998963 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3998963 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: @OneToMany with String as the many
Hi, try to annotate it with org.hibernate.annotations.CollectionOfElements. Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3994573#3994573 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3994573 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Getting Exception for Derby Data Source
is the Derby jdbc driver in the /lib directory of the server ?? Thanks, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3994658#3994658 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3994658 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: RC9 mappedBy and InheritanceType.JOINED problem
Hi Jason, I don't think the null pointer exception is caused by EJB RC9 but rather by Hibernate 3.2.0.GA that ships along with JBoss 4.0.5GA. To get it to work it will require you to manually patch the fromClause.java (very simple patch, only 1 or 2 lines). I have entered a bug in the Hibernate JIRA (http://opensource.atlassian.com/projects/hibernate/browse/HHH-2159), if you want it fixing, please vote for the issue. Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3993742#3993742 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3993742 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Mapping String attribute in EntityBean to CHAR(size) in
Hi, Could you not just annotate the getter/variable with something like so: @Column(columnDefinition=VARCHAR2(size)) Cheers Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3993767#3993767 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3993767 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: EJB QL/ JPQL and search for inheritance
Hi Joachim, In a EJB3 QL query you can query the Discriminator Value in the where section of the query. For example: WHERE tag.class = discriminator value This is how i have managed to restrict results based on a Discriminator Value before. Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3991614#3991614 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3991614 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: EJB QL/ JPQL and search for inheritance
Joachim, I have never attmepted to do an instanceof with the inheritance type of a single table per hierarchy. Prehaps you should investigate some other strategies, namely table per subclass as i think this will provide you with the functionality you would like, like so: | //create query | Query tmpQuery = mEntityManager.createQuery(FROM Tag t); | | //get query result | ArrayListTag queryResult = (ArrayListTag)tmpQuery.getResultList(); | | //get iterator | Iterator it = testList.iterator(); | | //loop | while (it.hasNext()) { | Tag element = (Tag) it.next(); | | if(element instanceof PlaceMark) { | //DO STUFF :-) | } | } | In your top level parent class you just need to annotate like so: @Inheritance(strategy = InheritanceType.JOINED) and i just have a getter and setter for the id in this parent class, and not in the sub-classes(children). All you should need to do in the children classes is just extend the parent class. To persist, just create and persist a child object and it automatically create and persists the parent objet with the correct attributes. Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3991643#3991643 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3991643 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Getting reference on Persistence Unit
I am assuming that the DAO has some kind of persistence.xml where you specify the persistence unit. Why not deploy both jars within a single .ear archive, and then have the persistence.xml in a lib directory in the base level of the archive, this will allow both jar's to use the same persistence unit. Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3989974#3989974 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3989974 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Getting reference on Persistence Unit
How are you deploying the jar files, in a single ear, or as 2 seperate jar files in the deploy directory ? Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3989940#3989940 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3989940 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Does Hibernate 3.2 support generating Database schema fr
Yes Hibernate can create the DB schema from annotated classes, consider the following class @Entity | @Table(name = Student) | @SequenceGenerator(name = Student_Sequence, initialValue = 1, allocationSize = 1, sequenceName = student_seq) | | public final class Student { | //** class variables * | /** | * The ID of the entity. | */ | private int mId; | | /** | * Name of the student. | */ | private String mName; | | | /** | * Course student is enrolled on | */ | private CollectionCourse mCourses = new ArrayListCourse(); | // | | //*** getters and setters | | /** | * Return the courses the student is enrolled on. | * @return mCourses courses | */ | @ManyToMany(mappedBy = students, fetch = FetchType.EAGER, cascade ={CascadeType.PERSIST, CascadeType.MERGE}) | public CollectionCourse getCourses() { | return mCourses; | } | | /** | * See the course the student is enrolled on | * @param pCoursesEnrolledOn courses | */ | public void setCourses(final CollectionCourse pCourses) { | mCourses = pCourses; | } | | /** | * get the Id. | * @return mId id | */ | @Id | @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = Student_Sequence) | @Column(name = student_id) | public int getId() { | return mId; | } | | /** | * Set the id. | * @param pId id | */ | public void setId(final int pId) { | this.mId = pId; | } | | /** | * Return the name. | * @return mName name | */ | public String getName() { | return mName; | } | | /** | * set the name. | * @param pName name | */ | public void setName(String pName) { | this.mName = pName; | } | // | } will create a table on deploy with the definition CREATE TABLE student | ( | student_id int4 NOT NULL, | name varchar(255), | CONSTRAINT student_pkey PRIMARY KEY (student_id) | ) The above example is pretty simple, but you could just deploy a class annotated with @Entity. On deploy JBoss/Hibernate would convert it into a DB table in the DB specified in a persistence.xml file (must be in META-INF of ejb.jar). Experiment a bit, and possibly buy yourself the Enterprise JavaBeans 3.0 book (Bill Burke, Richard Monson-Haefel), as it gives you some decent examples of how EJB3 works. Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3986761#3986761 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3986761 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Does Hibernate 3.2 support generating Database schema fr
Hi, I do not know if there is an Ant task for this, i just let JBoss do it for me on deployment of my .ear file. Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3986873#3986873 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3986873 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Installation, Configuration Deployment] - Keep getting a java.io.IOException
Hi, I have managed to set up JBoss servers before whitout any problem, but i am currently experiencing a few issues. 2 Servers recently had a fresh Fedora Core 5 install, and now i cannot get JBoss to start without errors (related to UDP multicasting). The current exception i get is: java.lang.Exception: dest=/233.3.3.21:45551 (52 bytes) | at org.jgroups.protocols.UDP._send(UDP.java:356) | at org.jgroups.protocols.UDP.sendToAllMembers(UDP.java:300) | at org.jgroups.protocols.TP.doSend(TP.java:938) | at org.jgroups.protocols.TP.send(TP.java:927) | at org.jgroups.protocols.TP.down(TP.java:716) | at org.jgroups.stack.DownHandler.run(Protocol.java:120) | Caused by: java.io.IOException: Network is unreachable | at java.net.PlainDatagramSocketImpl.send(Native Method) | at java.net.DatagramSocket.send(DatagramSocket.java:612) | at org.jgroups.protocols.UDP._send(UDP.java:330) | ... 5 more | 2006-11-07 14:52:03,091 ERROR [org.jgroups.protocols.UDP] failed sending message | java.lang.Exception: dest=/233.3.3.21:45551 (52 bytes) | at org.jgroups.protocols.UDP._send(UDP.java:356) | at org.jgroups.protocols.UDP.sendToAllMembers(UDP.java:300) | at org.jgroups.protocols.TP.doSend(TP.java:938) | at org.jgroups.protocols.TP.send(TP.java:927) | at org.jgroups.protocols.TP.down(TP.java:716) | at org.jgroups.stack.DownHandler.run(Protocol.java:120) | Caused by: java.io.IOException: Network is unreachable | at java.net.PlainDatagramSocketImpl.send(Native Method) | at java.net.DatagramSocket.send(DatagramSocket.java:612) | at org.jgroups.protocols.UDP._send(UDP.java:330) | ... 5 more I am pretty certain multicasting is enabled as i have the following entry in /sbin/ifconfig UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 I am using JBoss 4.0.4GA along with Java 1.5.0_08 Does anyone have an idea what is causing the problem ?? Thanks in advance, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3983772#3983772 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3983772 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Persistence Problem after upgrading to 4.0.5GA
Try declaring ArticleConsumeSchemaTemplate as a mappedSuperclass (so long as you don't need the template class persisted) Have a look here http://opensource.atlassian.com/projects/hibernate/browse/ANN-390 as it seems to be similar to your problem. Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3981715#3981715 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3981715 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Persistence Problem after upgrading to 4.0.5GA
Or you could try experimenting with the targetEntity in @OneToMany side ?? Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3981720#3981720 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3981720 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Persistence Problem after upgrading to 4.0.5GA
anonymous wrote : I've annotated the class as MappedSuperclass AND Entity I'm thinking that this will possibly cause some strange behaviour, you could also check out the inheritence strategies such as single table, or table per subclass Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3981759#3981759 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3981759 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Persistence Problem after upgrading to 4.0.5GA
I would try moving the annotations to the getter method(s). This is because i experienced the same problem/exception in 4.0.4GA when i was annotating at the variable declaration, moving it to the getter sloved the problem. Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3981664#3981664 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3981664 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Installation, Configuration Deployment] - Re: EJB-installation-problems
stupid question, but have you set $JBOSS_HOME ?? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3981299#3981299 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3981299 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: totally weird error: org.hibernate.hql.ast.tree.FromClau
I also had this problem after upgrading to the latest release of Hibernate (3.2.0GA). I was experiencing the this exception when trying query a single table inheritence structure. The following query did not work | Query tmpQuery = mEntityManager.createQuery(SELECT DISTINCT e.expression FROM TargetEntity + | t INNER JOIN t.expressionTargets e LEFT OUTER JOIN FETCH e.expression.restrictions r + | JOIN FETCH r.expressionTargets f JOIN FETCH f.targetEntity + | WHERE t.id = :pk AND e.expression.class = Rule).setParameter(pk, 1); | but the following one did | Query tmpQuery = mEntityManager.createQuery(SELECT DISTINCT e.expression FROM TargetEntity + | t INNER JOIN t.expressionTargets e LEFT OUTER JOIN FETCH e.expression.restrictions r + | JOIN FETCH r.expressionTargets f JOIN FETCH f.targetEntity + | WHERE t.id = :pk AND e.expression.class = 'rule').setParameter(pk, 1); | I had to quote the discriminator value in the query, if this was not done it caused a NPE. Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3979988#3979988 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3979988 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: jar-file elements in persistence.xml
I think this is a known bug, just reference the individual classes within seperate class tags like so: classcom.test.MyClass1/class | classcom.test.MyClass2/class | classcom.test.MyClass3/class | Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3979773#3979773 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3979773 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: List in EJB3 Entity:
Hi, If you want this list to be persistent, then annotate the List with @org.hibernate.annotations.CollectionOfElements Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3977789#3977789 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3977789 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: @EJB not working?
I also cannot get @EJB injection to work, using JBoss.4.0.4.GA with whatever version of EJB3 that comes bundled with it. I have experimented with in a few ways such as, specifiing a @LocalBinding, @EJB(mappedname=) and so on, but i the injection always results in null :-(. The current setup i have is that i am trying to look up the EJB in an MBean packaged within the same .ear file, could deployment order (ie .sar before .jar) possibly be causing the problem ? i have verified that it is bound in two ways, InitialContext.lookup() works and in the JNDI view it is bound, Any help is appreciated. Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3976532#3976532 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3976532 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: EntityManager not working correctly
Karma, I found that annotating the class (where the data is persisted) with @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) solved the problem for me, but unfortunately it does not seem to work for you. But after reading your post i have revisited the problem and removed the annotations and it still works !!! so i really don't know what the cause of problem was in the first place. I would imagine that the underlying cause of the problem i had will be the same as the problem you are currently experiencing, namely that the em.persist() only triggers an update and does not wait for the transaction to commit, and i also found that trying em.flush() after had no effect at all. To see if that is the case turn on full database logging and you should see the insert, select, and then commit in that order. The current program layout i have that is working is to have a top level method that calls 2 other methods. Method 1 is the presist data method and method 2 is the send message method. See below: | public void action(){ | | int pk = 0; | | try{ | pk = doPersistData(); | }catch(Exception e){ | e.printStackTrace(); | } | | try{ | // send a JMS message | doMessageStuff(pk); | }catch(Exception e){ | e.printStackTrace(); | } | } The thread i also create about this on the hibernate website can be found here: http://forum.hibernate.org/viewtopic.php?t=962664highlight= Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3973501#3973501 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3973501 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: RC9 is out
apill, According to the hibernate website the version of Hibernate Annotations and Hibernate EntityManager should 3.2.0.CR2. http://forum.hibernate.org/viewtopic.php?t=964828start=0postdays=0postorder=aschighlight= Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3972551#3972551 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3972551 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Cannot remove entites used in relationships
Hi, I have set up a very simple entity model to test relationships in EJB3. I have no problems in adding to them, and removing an entity so long as it is not used in a relationship (not refered to as a foriegn key value). The problem occurs when trying to remove the entity when it is used in a relationship be it many to many or many to one/one to many. Another thing to note about the relationships between the entites is that on the owning side a java.util.Set is used and on the non-owning side a java.util.Collection is used. To give an example of a this in a many to many context. I have 3 Entities Student, Course, and Institution and all of these relationships are many to many (please see below). In Student.java the student-course many to many and collection declaration | private CollectionCourse mCourses = new ArrayListCourse(); | | @ManyToMany(mappedBy = students, fetch = FetchType.EAGER, cascade ={CascadeType.PERSIST, CascadeType.MERGE}) | public CollectionCourse getCourses() { | return mCourses; | } | in Course.java student-course many to many and collection declarations/b] | private SetStudent mEnrolledStudents = new HashSetStudent(); | | @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch = FetchType.EAGER) | @JoinTable(name = course_student, | joinColumns = @JoinColumn(name = course_id, referencedColumnName = course_id), | inverseJoinColumns = @JoinColumn(name = student_id, referencedColumnName = student_id)) | public SetStudent getStudents() { | return mEnrolledStudents; | } in Course.java course-institution many to many and collection declaration | private CollectionInstitution mInstitutionsRunningCourse = new ArrayListInstitution(); | | @ManyToMany(mappedBy = courses, cascade = {CascadeType.PERSIST, CascadeType.MERGE}) | public CollectionInstitution getInstitutions() { | return mInstitutionsRunningCourse; | } in Institution.java course-institution many to many | private SetCourse mCoursesOffered = new HashSetCourse(); | | @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch = FetchType.EAGER) | @JoinTable(name = institution_course, | joinColumns = @JoinColumn(name = institution, referencedColumnName = institution_id) , | inverseJoinColumns = @JoinColumn(name = course, referencedColumnName = course_id) ) | public SetCourse getCourses() { | return mCoursesOffered; | } I create a course with 3 students on it (3 entries in the association table) and also link this course to 2 institutions (2 entries in the association table). Then i try to call the EntityManager.remove() method from within the same SLSB. The error i get is this anonymous wrote : Caused by: java.lang.RuntimeException: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=dale.comsoft.de/50, BranchQual=, localId=50] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.persistence.EntityNotFoundException: org.hibernate.ObjectDeletedException: deleted entity passed to persist: [test.Course#]) | at org.jboss.aspects.tx.TxPolicy.handleEndTransactionException(TxPolicy.java:198) | at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:180) | at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87) | at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:181) | at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:79) | at $Proxy347.tryDelete(Unknown Source) | at test.TestRelationships.storeData(TestRelationships.java:63) | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | at
[jboss-user] [EJB 3.0] - Re: ManyToMany problem
I have decided to always annotate the getters of each class variable as this seems to work, and in all the examples i have managed to find this seems to be the done thing View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3971872#3971872 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3971872 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: ManyToMany problem
Hi, I figured out that the problem was with the mappedBy in the non owning side of the ManyToMany relationship. What i still do not completely understand is what it maps to, is mappedBy = students mapping to the java.util.Set variable ? it can't map to the name because it is not students so does it map to the type of it, or possibly to the getter and setters (get/setStudents) ? If anyone can clear this up for me, i would be thankful. Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3965639#3965639 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3965639 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - ManyToMany problem
I am currently trying to implement a really simple many to many relationship using students and courses, but i cannot get it to work. The error always seems to be with the Collection in the none owning side of the relationship. Below are the exceptions i get: anonymous wrote : | 17:01:06,300 INFO [Ejb3Configuration] Processing PersistenceUnitInfo [ | name: test | ...] | 17:01:06,302 INFO [Ejb3Configuration] found EJB3 Entity bean: test.Course | 17:01:06,307 INFO [Ejb3Configuration] found EJB3 Entity bean: test.Student | 17:01:06,307 WARN [Ejb3Configuration] Persistence provider caller does not implements the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null. | 17:01:06,309 INFO [Configuration] Reading mappings from resource: META-INF/orm.xml | 17:01:06,309 INFO [Ejb3Configuration] [PersistenceUnit: test] no META-INF/orm.xml found | 17:01:06,311 INFO [AnnotationBinder] Binding entity from annotated class: test.Course | 17:01:06,312 INFO [EntityBinder] Bind entity test.Course on table course | 17:01:06,312 WARN [AnnotationBinder] Hibernate does not support SequenceGenerator.initialValue() | 17:01:06,322 INFO [AnnotationBinder] Binding entity from annotated class: test.Student | 17:01:06,322 INFO [EntityBinder] Bind entity test.Student on table student | 17:01:06,323 WARN [AnnotationBinder] Hibernate does not support SequenceGenerator.initialValue() | 17:01:06,368 WARN [ServiceController] Problem starting service persistence.units:ear=TestRelationships.ear,jar=TestRelationshipsEJB.jar,unitName=test | org.hibernate.MappingException: Could not determine type for: java.util.Collection, for columns: [org.hibernate.mapping.Column(mCoursesEnrolledOn)] | at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:266) | at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253) | at org.hibernate.mapping.Property.isValid(Property.java:185) | at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:395) | at org.hibernate.mapping.RootClass.validate(RootClass.java:192) | at org.hibernate.cfg.Configuration.validate(Configuration.java:1021) | at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1206) | at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:631) | at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:760) | at org.hibernate.ejb.Ejb3Configuration.createContainerEntityManagerFactory(Ejb3Configuration.java:350) | at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:119) | at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264) | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | at java.lang.reflect.Method.invoke(Method.java:585) | at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:99) | at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289) | at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245) | at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source) | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | at java.lang.reflect.Method.invoke(Method.java:585) | at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) | at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) | at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) | at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) | at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) | at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978) | at $Proxy0.start(Unknown Source) | at org.jboss.system.ServiceController.start(ServiceController.java:417) | at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | at java.lang.reflect.Method.invoke(Method.java:585) | at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) | at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) | at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) | at
[jboss-user] [EJB 3.0] - JBoss not binding @Local SLSB
Hi, I have a very simple set up with an .ear file which contains a .sar and .jar(EJB 3). The problem at the moment is that it will not bind the Local or Remote interfaces of a stateless session bean. My project is currently set up as follows. I have a top level interface (IRelationTest), then the local and remote interfaces of the session bean inherit from this (IRelationTestLocal, IRelationTestRemote, these 2 files also have the @local and @remote annotations in them). My Stateless session bean implements both the local and remote interfaces, and specifies the jndi binding with the @LocalBinding and @RemoteBinding. This app was only to test the relationships between entities so i was going to test it via the JMX console with the help of an MBean. The *MBean.java is just an empty interface and and then i have a class that implements the MBean, in the implementing class a lookup of the local interface of the session beanis made from the IntialContext, this is never never bound. Structure of files: | Top Level .ear | META-INF/ | META-INF/MANIFEST.MF | TestRelationships-ejb.jar | TestRelationshipsMBean.sar | META-INF/application.xml | EJB .jar | META-INF/ | META-INF/MANIFEST.MF | test/ | test/Course.class | test/RelationTest.class | test/IRelationTestLocal.class | test/IRelationTest.class | test/IRelationTestRemote.class | test/Student.class | META-INF/persistence.xml | MBean .sar | META-INF/ | META-INF/MANIFEST.MF | test/ | test/TestRelationships.class | test/TestRelationshipsMBean.class | META-INF/jboss-service.xml | And the exception i get is anonymous wrote : | 13:53:15,291 INFO [EARDeployer] Undeploying J2EE application, destroy step: file:/usr/local/jboss-4.0.4.GA/server/default/deploy/TestRelationships.ear | 13:53:15,292 INFO [EARDeployer] Undeployed J2EE application: file:/usr/local/jboss-4.0.4.GA/server/default/deploy/TestRelationships.ear | 13:53:15,294 INFO [EARDeployer] Init J2EE application: file:/usr/local/jboss-4.0.4.GA/server/default/deploy/TestRelationships.ear | 13:53:15,314 INFO [STDOUT] IN HERE: TestRelationships | 13:53:15,314 ERROR [STDERR] javax.naming.NameNotFoundException: TestLoc not bound | 13:53:15,315 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:529) | 13:53:15,315 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:537) | 13:53:15,315 ERROR [STDERR] at org.jnp.server.NamingServer.getObject(NamingServer.java:543) | 13:53:15,315 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServer.java:296) | 13:53:15,315 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625) | 13:53:15,315 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587) | 13:53:15,315 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialContext.java:351) | 13:53:15,315 ERROR [STDERR] at test.TestRelationships.(TestRelationships.java:26) | 13:53:15,316 ERROR [STDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) | 13:53:15,316 ERROR [STDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) | 13:53:15,316 ERROR [STDERR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) | 13:53:15,316 ERROR [STDERR] at java.lang.reflect.Constructor.newInstance(Constructor.java:494) | 13:53:15,316 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:1233) | 13:53:15,316 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:286) | 13:53:15,316 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:344) | 13:53:15,317 ERROR [STDERR] at org.jboss.system.ServiceCreator.install(ServiceCreator.java:157) | 13:53:15,317 ERROR [STDERR] at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:449) | 13:53:15,317 ERROR [STDERR] at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171) | 13:53:15,317 ERROR [STDERR] at org.jboss.system.ServiceController.install(ServiceController.java:226) | 13:53:15,317 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source) | 13:53:15,317 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | 13:53:15,317 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585) | 13:53:15,317 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) | 13:53:15,317 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) | 13:53:15,318 ERROR [STDERR]
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: EntityManager not working correctly
Yesterday we managed to get it working with pure JDBC without any problems. We then integrated the EntityManager with the JDBC statements, and we think the problem exists with the .persist() method. It seems as if it returns from the method without waiting for the commit to happen at the database level. Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3963722#3963722 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3963722 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: EntityManager not working correctly
Hi, After spending the whole week trying to fix this problem, i am still no closer to the actual solution but i have discovered some more information. This problem is Postgres specific at the moment as i have tested the EntityManager.find() method call in the same context when using Hypersonic and MySQL and the entity is always found. After studying the log file created by Postgres (without having the 2 second delay) it seems to not be able to commit the initiial insert statement generated from the EntityManager.persist() call before it tries to query it with the select statement, thus the .find() returns null. The thing that worries me about this problem is that some times it works with Postgres, and that it always works with the 2 other databases i tested with. I have read up on the EntityManager and discovered that it is not thread safe, could this be causing the problem with Postgres, if so i know i need to use an EntityManagerFactory as this is a thread safe object, but how do i just create on factory that the whole of the application can use (be used in different beans, possible JNDI lookup ??), and even then i do not know if this would solve my problem. Is there anyway of making the EntityManager.persist() method wait until the database has actually commited before it returns ??? I have also tried to introduce flush() calls but they do not solve the problem. Is this a possible bug in the EntityManager or Postgres JDBC code ??? I also have a very simple test application (.ear file) that just persists some bytes to a database and then tries to find them again in a seperate MDB, and then prints out if it cannot find the persisted object. If anybody wants it to test the problem with this application i will make it available to them. If anyone can help, or offer advice it is appreciated. Cheers, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3963135#3963135 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3963135 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Problems with Postgres, Persistence, and large objects
I am still having this problem, but have been investigating it further. What i have found out is that if you call the EntityManager.find() method directly after you have just persisted the object in the same class then it manages to find the Entity in the database. The problem starts to happen when the you call the EntityManager.find() from within another class with the same persistence context (using the same persistence unit), it seems to return null 99.99% of the time. I have no idea if this due to the database being used as it works with a Hypersonic data source but not with postgres. Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3960995#3960995 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3960995 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JCA/JBoss] - Problems with postgresql and bytea columns
Hi, Are current message parsing application works perfectly when using Hypersonic as the datasource, but i am currently experiencing a lot of problems when trying to use PostgreSQL (8.1.4) as the datasource. The currunt description/workflow of the application is as follows. A byte array of around 300 k is received and then an Object is created from it, this is then persisted (via javax.persistance.EntityManager.persist()) and then also flushed. The saved object is then queried and parsed further by the program. This is where the problem occurs because sometimes it cannot find the saved object even though you can view it via the db admin GUI. It is like it is trying to query the object before it is properly saved in the DB and thus returning null from the DB. I am also getting lots of error/warning messages in the log file like the one below. anonymous wrote : 2006-07-24 15:02:21,204 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Warning: 0, SQLState: 0 | 2006-07-24 15:02:21,204 WARN [org.hibernate.util.JDBCExceptionReporter] StartTransactionCommand | 2006-07-24 15:02:21,204 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Warning: 0, SQLState: 0 | 2006-07-24 15:02:21,204 WARN [org.hibernate.util.JDBCExceptionReporter] ProcessUtility | 2006-07-24 15:02:21,204 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Warning: 0, SQLState: 0 | 2006-07-24 15:02:21,204 WARN [org.hibernate.util.JDBCExceptionReporter] CommitTransactionCommand | 2006-07-24 15:02:21,204 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Warning: 0, SQLState: 0 | 2006-07-24 15:02:21,204 WARN [org.hibernate.util.JDBCExceptionReporter] CommitTransaction | 2006-07-24 15:02:21,204 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Warning: 0, SQLState: 0 Has anybody else experienced a similar issue to this when using Postgres as the datasource, and if so how should i go about fixing it? Thanks, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3960436#3960436 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3960436 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss AOP] - sar will not deploy with LoadTimeWeaving (javaagent:pluggabl
Hi, I have load time weaving working on my local machine no problem, i also want to set it up on another team member's computer but when i do so, a .sar file fails to deploy correctly on startup of jboss. The current set of exceptions we are getting on start up are as follows: anonymous wrote : org.jboss.deployment.DeploymentException: Unexpected error during load of: de.comsoft.cadas_ims.Parser.MessageParserImpl, msg=Code attribute in native or abstract methods in class file de/comsoft/cadas_ims/Parser/MessageParserImpl; - nested throwable: (java.lang.ClassNotFoundException: Unexpected error during load of: de.comsoft.cadas_ims.Parser.MessageParserImpl, msg=Code attribute in native or abstract methods in class file de/comsoft/cadas_ims/Parser/MessageParserImpl) | at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:196) | at org.jboss.system.ServiceController.install(ServiceController.java:226) | at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source) | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | at java.lang.reflect.Method.invoke(Method.java:585) | at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) | at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) | at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) | at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) | at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) | at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) | at $Proxy4.install(Unknown Source) | at org.jboss.deployment.SARDeployer.create(SARDeployer.java:249) | at org.jboss.deployment.MainDeployer.create(MainDeployer.java:953) | at org.jboss.deployment.MainDeployer.create(MainDeployer.java:943) | at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:807) | at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771) | at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source) | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | at java.lang.reflect.Method.invoke(Method.java:585) | at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) | at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) | at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133) | at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) | at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) | at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) | at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) | at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) | at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) | at $Proxy6.deploy(Unknown Source) | at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421) | at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634) | at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263) | at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336) | at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289) | at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245) | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | at java.lang.reflect.Method.invoke(Method.java:585) | at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) | at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) | at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) | at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) | at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) | at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978) | at $Proxy0.start(Unknown Source) | at org.jboss.system.ServiceController.start(ServiceController.java:417) | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | at
[jboss-user] [JBoss AOP] - EnableLoadTime weaving in Linux with JBoss 4.0.4GA
Hi, I am trying to enable weaving on my jboss instance. I have been found a few guides on the internet that i have tried to follow, which basically said to set the EnableLoadtimeWeaving element to true in the /deploy/jboss-aop-jdk50.deployer/META-INF/jboss-service.xml and then add the -javaagent:pluggable-instrumentor.jar(after moving to the $JBOSS_HOME/bin driectory) to run.sh. I had to use the pluggable-instrumentor.jar that comes with the JBoss AOP IDE as i could not find it anywhere else. This causes the following many exceptions, like the one below: 15:15:14,130 ERROR [STDERR] [warn] AOP Instrumentor failed to transform org.apache.catalina.core.StandardServer | 15:15:14,131 ERROR [STDERR] org.jboss.aop.instrument.TransformationException: Failed to aspectize class org.apache.catalina.core.StandardServer. Could not find class it references org.apache.catalina.core.NamingContextListener It may not be in your classpath and you may not be getting field and constructor weaving for this class. | 15:15:14,133 ERROR [STDERR] at org.jboss.aop.instrument.Instrumentor.convertReferences(Instrumentor.java:619) | 15:15:14,133 ERROR [STDERR] at org.jboss.aop.instrument.Instrumentor.transform(Instrumentor.java:673) | 15:15:14,133 ERROR [STDERR] at org.jboss.aop.AspectManager.translate(AspectManager.java:970) | 15:15:14,134 ERROR [STDERR] at org.jboss.aop.AspectManager.transform(AspectManager.java:882) | 15:15:14,134 ERROR [STDERR] at org.jboss.aop.standalone.AOPTransformer.aspectTransform(AOPTransformer.java:88) | 15:15:14,134 ERROR [STDERR] at org.jboss.aop.standalone.AOPTransformer.transform(AOPTransformer.java:75) | 15:15:14,135 ERROR [STDERR] at sun.instrument.TransformerManager.transform(TransformerManager.java:122) | 15:15:14,135 ERROR [STDERR] at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155) | 15:15:14,135 ERROR [STDERR] at java.lang.ClassLoader.defineClass1(Native Method) | 15:15:14,136 ERROR [STDERR] at java.lang.ClassLoader.defineClass(ClassLoader.java:620) | 15:15:14,136 ERROR [STDERR] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) | 15:15:14,136 ERROR [STDERR] at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) | 15:15:14,137 ERROR [STDERR] at java.net.URLClassLoader.access$100(URLClassLoader.java:56) | 15:15:14,137 ERROR [STDERR] at java.net.URLClassLoader$1.run(URLClassLoader.java:195) | 15:15:14,137 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method) | 15:15:14,138 ERROR [STDERR] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) | 15:15:14,138 ERROR [STDERR] at org.jboss.mx.loading.RepositoryClassLoader.findClassLocally(RepositoryClassLoader.java:672) | 15:15:14,138 ERROR [STDERR] at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassLoader.java:652) | 15:15:14,139 ERROR [STDERR] at java.lang.ClassLoader.loadClass(ClassLoader.java:306) | 15:15:14,139 ERROR [STDERR] at org.jboss.mx.loading.RepositoryClassLoader.loadClassLocally(RepositoryClassLoader.java:190) | 15:15:14,139 ERROR [STDERR] at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:131) | 15:15:14,140 ERROR [STDERR] at org.jboss.mx.loading.LoadMgr3.nextTask(LoadMgr3.java:399) | 15:15:14,140 ERROR [STDERR] at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:517) | 15:15:14,141 ERROR [STDERR] at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:405) | 15:15:14,141 ERROR [STDERR] at java.lang.ClassLoader.loadClass(ClassLoader.java:251) | 15:15:14,141 ERROR [STDERR] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) | 15:15:14,141 ERROR [STDERR] at java.lang.Class.forName0(Native Method) | 15:15:14,142 ERROR [STDERR] at java.lang.Class.forName(Class.java:164) | 15:15:14,142 ERROR [STDERR] at org.apache.catalina.startup.Catalina.class$(Catalina.java:73) | 15:15:14,142 ERROR [STDERR] at org.apache.catalina.startup.Catalina.createStartDigester(Catalina.java:262) | 15:15:14,143 ERROR [STDERR] at org.apache.catalina.startup.Catalina.load(Catalina.java:440) | 15:15:14,143 ERROR [STDERR] at org.apache.catalina.startup.Catalina.start(Catalina.java:543) | 15:15:14,143 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | 15:15:14,144 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) | 15:15:14,144 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | 15:15:14,144 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585) | 15:15:14,145 ERROR [STDERR] at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
[jboss-user] [JBoss AOP] - Newbie - Help Needed
Hi, I am new to AOP and am currently running into problenm when trying to implement a custom aspect (interceptor) on JBoss 4.0.4GA. I have already managed to write a working Interceptor by actually coding it inside the bean with the @AroundInvoke, but now i want to implement it like demonstrated here http://docs.jboss.org/jbossas/jboss4guide/r3/html/aop.chapt.html with having a .jar (custom Aspect) file, and jboss-aop.xml file in the deploy directoy, and annotation the method in the bean. The problem i am currently having is that it never seems to fire. TestInterrup.java (aspect interace) package com.jboss.aspect; | | import java.lang.annotation.Target; | import java.lang.annotation.ElementType; | | @Target({ElementType.METHOD}) | public @interface TestInterrupt {} TestInterruptAspect.java package com.jboss.aspect; | | //import the relevant aop libs | import org.jboss.aop.joinpoint.Invocation; | | public class TestInterruptAspect { | | public Object testInterrupt(Invocation invocation)throws Throwable{ | | //test print | System.out.println( Interrupt fired successfully ); | | return invocation.invokeNext(); | } | | } jboss-aop.xml ?xml version=1.0 encoding=UTF-8 standalone=yes? | aop | aspect class=com.jboss.aspect.TestInterruptAspect | scope=PER_VM/ | | bind pointcut=execution(* *-@com.jboss.aspect.TestInterrupt(*)) | advice name=testInterrupt | aspect=com.jboss.aspect.TestInterruptAspect/ | /bind | /aop | Can anyone offer me any advice on how to solve the problem of it not firing on method invocation ? Thanks in advance, Andy View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3958501#3958501 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3958501 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user