我有一个正在运行的grails应用程序.我将
springsecurity-core从1.2.7.3 升级到2.0-RC2
springsecurity-acl从1.1.1升级到2.0-RC1
我添加了
springsecurity-oauth-provider 1.0.5.1
我在启动时遇到异常:
引起:org.springframework.aop.framework.AopConfigException:无法生成类[class org.codehaus.groovy.grails.commons.spring.TypeSpecifyableTransactionProxyFactoryBean]的CGLIB子类:此问题的常见原因包括使用final类或非类 - 可见课程; 嵌套异常是java.lang.IllegalArgumentException:Superclass没有null构造函数,但grails.plugin.springsecurity.acl.AclAutoProxyCreator.createProxy(AclAutoProxyCreator.java:120)没有给出参数... 4更多
引起:java.lang.IllegalArgumentException:Superclass没有null构造函数,但在net.sf.cglib.core.DefaultGeneratorStrategy.generate中net.sf.cglib.transform.TransformingClassGenerator.generateClass(TransformingClassGenerator.java:33)中没有给出参数(DefaultGeneratorStrategy.java:25)at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)... 5更多
(只是ex的最后一部分)
我有以下代码
0. templatePage = (PDPage) PDDocument.load(file).getDocumentCatalog().getAllPages().get(0);
1. ...
2. document.importPage(templatePage); //first page
3. ... //draw stuff
4. document.importPage(templatePage); //next page
5. ...
Run Code Online (Sandbox Code Playgroud)
如果在第3行,我只画了一些东西,那么一切正常.但是,如果我画了很多东西,那么我得到:
Index: 12, Size: 0. Stacktrace follows:
java.lang.IndexOutOfBoundsException: Index: 12, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:635)
at java.util.ArrayList.get(ArrayList.java:411)
at org.apache.pdfbox.io.RandomAccessBuffer.seek(RandomAccessBuffer.java:84)
at org.apache.pdfbox.io.RandomAccessFileInputStream.read(RandomAccessFileInputStream.java:96)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
at org.apache.pdfbox.pdmodel.PDDocument.importPage(PDDocument.java:654)
at xxx.PdfReport.breakPage(PdfReport.java:145)
at xxx.PdfReport.print(PdfReport.java:84)
Run Code Online (Sandbox Code Playgroud)
上面的代码在95%的情况下工作,只有当页面真的满时才会出现问题.
如果在第2行和第4行.我使用
document.addPage(new PDPage());
Run Code Online (Sandbox Code Playgroud)
然后它工作正常.但目标是使用模板pdf.
我想使用相同的分隔符和格式将excel文件的内容复制到剪贴板,而不管用户配置如何.
这是我的宏:
Private Sub CommandButton1_Click()
'save number separators
Dim d, t, u
d = Application.DecimalSeparator
t = Application.ThousandsSeparator
u = Application.UseSystemSeparators
'set number separators
With Application
.DecimalSeparator = "."
.ThousandsSeparator = ","
.UseSystemSeparators = True
End With
'create temporary copy
ActiveSheet.Copy
'set number format
ActiveSheet.Range("H2:I150").NumberFormat = "0.0000000000"
[...]
'copy sheet to clipboard
ActiveSheet.Range("A1:O150").Copy
'disable messages (clipboard)
Application.DisplayAlerts = False
'close temporary copy
ActiveWorkbook.Close SaveChanges:=False
'reenable messages
Application.DisplayAlerts = True
'reset original separators
With Application
.DecimalSeparator = d
.ThousandsSeparator = t …Run Code Online (Sandbox Code Playgroud) 我想在Grails项目中创建自定义日志记录注释.
我的代码:
class MyService{
@AuditLog
def method1() {
println "method1 called"
method2()
}
@AuditLog
def method2() {
println "method2 called"
}
}
Run Code Online (Sandbox Code Playgroud)
拦截器:
class AuditLogInterceptor implements MethodInterceptor {
@Override
Object invoke(MethodInvocation methodInvocation) throws Throwable {
println "${methodInvocation.method}"
return methodInvocation.proceed();
}
}
Run Code Online (Sandbox Code Playgroud)
Spring配置:
aop {
config("proxy-target-class": true) {
pointcut(id: "auditLogInterceptorPointcut", expression: "@annotation(xxx.log.AuditLog)")
advisor('pointcut-ref': "auditLogInterceptorPointcut", 'advice-ref': "auditLogInterceptor")
}
}
auditLogInterceptor(AuditLogInterceptor) {}
Run Code Online (Sandbox Code Playgroud)
结果:
public java.lang.Object xxx.MyService.method1()
method1 called
method2 called
Run Code Online (Sandbox Code Playgroud)
我想看到方法2的注释火.我错过了什么?