问题描述
我的Spring管理的tomcat应用程序遇到了一些麻烦。
有一个UserDao,负责某些User数据库操作。
如果我启动雄猫,我会收到以下消息:
I have some trouble with my spring managed tomcat application.There is a UserDao that is responsible for some User database operations.If I start the tomcat I get this message:
Thread [pool-2-thread-1] (Class load: UserDao)
Class<T>.getDeclaredConstructors0(boolean) line: not available [native method]
Class<T>.privateGetDeclaredConstructors(boolean) line: not available
Class<T>.getDeclaredConstructors() line: not available
AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(Class<?>, String) line: 229
DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).determineConstructorsFromBeanPostProcessors(Class, String) line: 962
DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).createBeanInstance(String, RootBeanDefinition, Object[]) line: 935
DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).doCreateBean(String, RootBeanDefinition, Object[]) line: 485
DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).createBean(String, RootBeanDefinition, Object[]) line: 456
AbstractBeanFactory$1.getObject() line: 294
DefaultListableBeanFactory(DefaultSingletonBeanRegistry).getSingleton(String, ObjectFactory) line: 225
DefaultListableBeanFactory(AbstractBeanFactory).doGetBean(String, Class<T>, Object[], boolean) line: 291
DefaultListableBeanFactory(AbstractBeanFactory).getBean(String) line: 193
DefaultListableBeanFactory.preInstantiateSingletons() line: 605
XmlWebApplicationContext(AbstractApplicationContext).finishBeanFactoryInitialization(ConfigurableListableBeanFactory) line: 925
XmlWebApplicationContext(AbstractApplicationContext).refresh() line: 472
ContextLoaderListener(ContextLoader).configureAndRefreshWebApplicationContext(ConfigurableWebApplicationContext, ServletContext) line: 383
ContextLoaderListener(ContextLoader).initWebApplicationContext(ServletContext) line: 283
ContextLoaderListener.contextInitialized(ServletContextEvent) line: 111
StandardContext.listenerStart() line: 4779
StandardContext.startInternal() line: 5273
StandardContext(LifecycleBase).start() line: 150
ContainerBase$StartChild.call() line: 1568
ContainerBase$StartChild.call() line: 1558
FutureTask$Sync.innerRun() line: not available
FutureTask<V>.run() line: not available
ThreadPoolExecutor$Worker.runTask(Runnable) line: not available
ThreadPoolExecutor$Worker.run() line: not available
Thread.run() line: not available
尽管如此,我的Web应用程序的每个部分都可以正常工作。
Nevertheless every part of my webapplication works without problems.
在我的春季上下文中,这是UserDao bean的实现:
That is the UserDao bean decleration in my spring-context:
<bean id="userDao" class="de.bc.qz.dao.UserDao" autowire="byName">
<property name="dataSource" ref="dataSource" />
<property name="LAU">
<value>
select u.* from quiz.user u where name like ?
</value>
</property>
<property name="LUC">
<value>
select u.pc, u.gc, u.sc, u.bc from quiz.user u where name = ?
</value>
</property>
<property name="LUID">
<value>
SELECT u.id
FROM quiz.user u
WHERE u.name = ?;
</value>
</property>
<property name="LBQC">
<value>
SELECT u.name, u.cq
FROM quiz.user u
WHERE u.cq != 0 ORDER BY u.cq DESC LIMIT 0, 100;
</value>
</property>
</bean>
以及我的UserDao类:
and that my UserDao class:
@Service
public class UserDao extends AbstractSpring {
private String mLAU;
private String mLUID;
private String mLBQC;
private String mLUC;
public void setLUC(String pLUC) {
mLUC = pLUC;
}
public void setLAU(String pLAU) {
mLAU = pLAU;
}
public void setLUID(String pLUID) {
mLUID = pLUID;
}
public void setLBQC(String pLBQC) {
mLBQC = pLBQC;
}
@Autowired
public UserDao(DataSource dataSource) {
setDataSource(dataSource);
}
@Autowired
private UserMapper mUserMapper;
public List<User> findAllUser(String pName) {
return createJdbcTemplate().query(mLAU,
new Object[] { "%" + pName + "%" }, mUserMapper);
}
}
我会说构造函数有问题。但为什么?
from the information given in the message I would say there are problems with constructors. But why? And more important where?
推荐答案
在您可能在该类的某个位置设置断点之前,我已经遇到了此错误
I've experienced this error before you probably have a break point set somewhere on that class
在日食中转到:
- 窗口->显示视图->其他
- 在搜索框过滤器中输入: Breakpoints
-
在此断点视图中查找您的UserDao类,然后取消选中
的所有断点
- Window -> Show View -> Other
- In the search box filter type: "Breakpoints"
In this break points view look for your UserDao class and uncheckall breakpoints inside it.
这将使启动期间的那些消息消失
This will make those msgs during startup go away
这篇关于getDeclaredConstructors0(boolean)-在调试模式下,tomcat启动期间行不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!