[JBoss AOP] - Re: IllegalAccessException using reflection on private field
by kabir.khan@jboss.com
Hi there,
your fix looks fine, thank you! If you want to contribute would you mind adding some tests to test this case to the ReflectionTester? Once that is done, I can add your fix to the aop source tree. Otherwise it will take a bit longer since I then need to write the tests :-) I think what you have done will also affect private constructors being called by reflection, since they also get a wrapper method, so if you really want to help it would be great if you could look at that too. Funnily enough the ReflectionAspect was the first thing I worked on when I started contributing to JBoss AOP :-)
To check out aop source
svn co http://anonsvn.jboss.org/repos/jbossas/projects/aop/trunk/ jboss-aop
The reflection test lives under jboss-aop/aop/src/main/org/jboss/aop/reflection/
And it is configured under
jboss-aop/aop/src/resources/test/reflection/jboss-aop.xml
Let me know if you need more info about how to build/run the tests?
BTW things like
m.setAccessible(true);
will not work if run under a security manager, and the aop tests are being run with a security manager enabled.
Take a look at the ReflectionAspect.SecurityAction class, which currently wraps calls to Class.getDeclaredFields() etc. when called with and without a security manager.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048673#4048673
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048673
18 years, 11 months
[Persistence, JBoss/CMP, Hibernate, Database] - problem connecting mysql
by micho
Hi with jboss 4.2 I have problems connecting with mysql when deploying my application (it worked well on another server, but I cant find the difference).
>From the commandline on the same server I can connect to mysql without problems
mysql -u bbcJbossUser -p -h localhost bbcJboss
my mysql-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
| <datasources>
| <local-tx-datasource>
| <jndi-name>MySqlDS</jndi-name>
| <connection-url>jdbc:mysql://localhost:3306/bbcJboss</connection-url>
| <driver-class>com.mysql.jdbc.Driver</driver-class>
| <user-name>bbcJbossUser</user-name>
| <password>GEHEIM</password>
| <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
| <metadata>
| <type-mapping>mySQL</type-mapping>
| </metadata>
| </local-tx-datasource>
| </datasources>
I get the following output on the console:
| ...
| 10:53:37,435 INFO [EntityBinder] Bind entity com.babuco.session.Session on table Session
| 10:53:37,524 INFO [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
| 10:53:37,528 INFO [InjectedDataSourceConnectionProvider] Using provided datasource
| 10:53:37,531 WARN [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
| org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
|
| ** BEGIN NESTED EXCEPTION **
|
| java.net.ConnectException
| MESSAGE: Connection refused
|
| STACKTRACE:
|
| java.net.ConnectException: Connection refused
| at java.net.PlainSocketImpl.socketConnect(Native Method)
| at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
| at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
| at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
| at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
| at java.net.Socket.connect(Socket.java:519)
| at java.net.Socket.connect(Socket.java:469)
| at java.net.Socket.<init>(Socket.java:366)
| at java.net.Socket.<init>(Socket.java:208)
| ...
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048668#4048668
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048668
18 years, 11 months