Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] error Ambiguous binding - args(..) pointcut

HI there,
 
ERROR:
see also: D:\JDBC.java:17
 see also: D:\bea813\weblogic81\samples\server\examples\src\examples\ejb20\basic\beanManaged\dist\ejb20_basic_beanManaged.jar
examples\ejb20\basic\beanManaged\AccountBean.java:127 error Ambiguous binding of type java.lang.String using args(..) at this line.  Use one args(..) per matched join point, see secondary source location for location of extraneous args(..)
(no source information available)
 
When I weave the following code with weblogic 8.1.3 beanmanaged example Account entity EJB, I am getting follwoing above error,
Please let me know what is the problem?
 
Regards,
Jitesh
 
public aspect JDBC {
  public pointcut getConnection() : call(public Connection Driver.connect(..)) || call(public Connection DataSource.getConnection(..));
  public pointcut closeConnection() : call(public void Connection.close());
  public pointcut commit() : call(public void Connection.commit());
 
//--------------------------------------------------------------------------------------------------
 //clubbed all this in query pointcut
 
  public pointcut preparedStatement(String sql) : call(public * Connection.prepareStatement(..)) && args(sql);
  public pointcut preparedCall(String sql) : call(public * Connection.prepareCall(..)) && args(sql);
 
  public pointcut statement(String sql) : call(public * Statement.execute*(..)) && args(sql);
  public pointcut addBatch(String sql) : call(public * Statement.addBatch(String)) && args(sql);
  public pointcut setCommand(String sql) : call(public * RowSet.setCommand(..)) && args(sql);
 
//--------------------------------------------------------------------------------------------------
 
  public pointcut query(String sql) : JDBC.preparedStatement(sql) || JDBC.preparedCall(sql) ||
    JDBC.statement(sql) || JDBC.addBatch(sql) || JDBC.setCommand(sql);
 
Object around(String sql): query(sql) {
     System.out.println("Query"+sql);   
    //execute called method
    res = proceed(sql);
    return res;
}
Confidentiality Statement:

This message is intended only for the individual or entity to which it is addressed. It may contain privileged, confidential information which is exempt from disclosure under applicable laws. If you are not the intended recipient, please note that you are strictly prohibited from disseminating or distributing this information (other than to the intended recipient) or copying this information. If you have received this communication in error, please notify us immediately by return email.



Back to the top