我正在尝试构建我的项目并在JBoss中运行。我能够成功构建,但是当我启动JBoss服务器时,它显示以下错误。我甚至无法理解这背后的原因是什么。
这是整个堆栈跟踪:
13:00:13,625 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) JBAS010403: Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 11.1)
13:00:13,781 INFO [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) The listener "com.sun.faces.config.ConfigureListener" is already configured for this context. The duplicate definition has been ignored.
13:00:13,781 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/provider-pay]] (MSC service thread 1-2) No Spring WebApplicationInitializer types detected on classpath
13:00:13,813 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/provider-pay]] (MSC service thread 1-2) Set web app root system property: 'webapp.root' = [D:\tools\jboss-as-7.1.1.Final\standalone\tmp\vfs\temp852b611c04659912\provider-pay.war-f6e1379c73e54ccb\]
13:00:17,016 INFO [org.hibernate.validator.util.Version] (MSC service thread 1-2) Hibernate Validator 4.2.0.Final
13:00:17,422 INFO [stdout] (MSC service thread 1-2) 02 Jun 2014 13:00:17 INFO DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@696c65: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationPro
cessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationP
rocessor,userServiceImpl,wholesalerServiceImpl,userDAO,wholesalerDAO,binController,wholesalerListController,loginController,org.springframework.context.config.internalBeanConfigurerAspect,org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor#0,DataSource,SessionFactory,or
g.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,txManager,org.springframework
.security.filterChains,org.springframework.security.filterChainProxy,org.springframework.security.web.PortMapperImpl#0,org.springframework.security.web.PortResolverImpl#0,org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0,org.springframework.security.authentication
.ProviderManager#0,org.springframework.security.web.context.HttpSessionSecurityContextRepository#0,org.springframework.security.web.authentication.session.CompositeSessionAuthenticationStrategy#0,org.springframework.security.web.savedrequest.HttpSessionRequestCache#0,org.springframework.security.web
.access.expression.DefaultWebSecurityExpressionHandler#0,org.springframework.security.access.vote.AffirmativeBased#0,org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0,org.springframework.security.web.access.DefaultWebInvocationPrivilegeEvaluator#0,org.springframework.secu
rity.authentication.AnonymousAuthenticationProvider#0,org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0,org.springframework.security.userDetailsServiceFactory,org.springframework.security.web.DefaultSecurityFilterChain#0,org.springframework.security.provisioning.
InMemoryUserDetailsManager#0,org.springframework.security.authentication.dao.DaoAuthenticationProvider#0,org.springframework.security.authentication.DefaultAuthenticationEventPublisher#0,org.springframework.security.authenticationManager,org.springframework.context.annotation.ConfigurationClassPostP
rocessor.importAwareProcessor]; root of factory hierarchy
13:00:17,453 INFO [stdout] (MSC service thread 1-2) 02 Jun 2014 13:00:17 ERROR ContextLoader - Context initialization failed
13:00:17,453 INFO [stdout] (MSC service thread 1-2) org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'binController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire fie
ld: com.prime.tfb.service.binmanagement.BinmanagementService com.prime.tfb.web.controller.BinController.binmanagementservice; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.prime.tfb.service.binmanagement.BinmanagementService] fou
nd for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
13:00:17,453 INFO [stdout] (MSC service thread 1-2) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289)
13:00:17,453 INFO [stdout] (MSC service thread 1-2) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1146)
13:00:17,453 INFO [stdout] (MSC service thread 1-2) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
13:00:17,453 INFO [stdout] (MSC service thread 1-2) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
13:00:17,453 INFO [stdout] (MSC service thread 1-2) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
13:00:17,453 INFO [stdout] (MSC service thread 1-2) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
13:00:17,469 INFO [stdout] (MSC service thread 1-2) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
13:00:17,469 INFO [stdout] (MSC service thread 1-2) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
13:00:17,469 INFO [stdout] (MSC service thread 1-2) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)
13:00:17,469 INFO [stdout] (MSC service thread 1-2) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
13:00:17,469 INFO [stdout] (MSC service thread 1-2) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
13:00:17,469 INFO [stdout] (MSC service thread 1-2) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
13:00:17,469 INFO [stdout] (MSC service thread 1-2) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
13:00:17,469 INFO [stdout] (MSC service thread 1-2) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
13:00:17,469 INFO [stdout] (MSC service thread 1-2) at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392)
13:00:17,469 INFO [stdout] (MSC service thread 1-2) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850)
13:00:17,469 INFO [stdout] (MSC service thread 1-2) at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90)
13:00:17,469 INFO [stdout] (MSC service thread 1-2) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
13:00:17,469 INFO [stdout] (MSC service thread 1-2) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
13:00:17,469 INFO [stdout] (MSC service thread 1-2) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
13:00:17,484 INFO [stdout] (MSC service thread 1-2) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
13:00:17,484 INFO [stdout] (MSC service thread 1-2) at java.lang.Thread.run(Thread.java:722)
13:00:17,484 INFO [stdout] (MSC service thread 1-2) Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.prime.tfb.service.binmanagement.BinmanagementService com.prime.tfb.web.controller.BinController.binmanagementservice; nested exception is org.springf
ramework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.prime.tfb.service.binmanagement.BinmanagementService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.fa
ctory.annotation.Autowired(required=true)}
13:00:17,484 INFO [stdout] (MSC service thread 1-2) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:517)
13:00:17,484 INFO [stdout] (MSC service thread 1-2) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
13:00:17,484 INFO [stdout] (MSC service thread 1-2) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286)
13:00:17,484 INFO [stdout] (MSC service thread 1-2) ... 21 more
13:00:17,484 INFO [stdout] (MSC service thread 1-2) Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.prime.tfb.service.binmanagement.BinmanagementService] found for dependency: expected at least 1 bean which qualifies as autowire candidate
for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
13:00:17,484 INFO [stdout] (MSC service thread 1-2) at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:988)
13:00:17,484 INFO [stdout] (MSC service thread 1-2) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:858)
13:00:17,500 INFO [stdout] (MSC service thread 1-2) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:770)
13:00:17,500 INFO [stdout] (MSC service thread 1-2) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:489)
13:00:17,500 INFO [stdout] (MSC service thread 1-2) ... 23 more
13:00:17,500 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/provider-pay]] (MSC service thread 1-2) Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener: org.springframework.beans.factory.BeanCreat
ionException: Error creating bean with name 'binController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.prime.tfb.service.binmanagement.BinmanagementService com.prime.tfb.web.controller.BinCon
troller.binmanagementservice; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.prime.tfb.service.binmanagement.BinmanagementService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this depen
dency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289) [spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1146) [spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) [spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) [spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296) [spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) [spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293) [spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) [spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628) [spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) [spring-context-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) [spring-context-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) [spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) [spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) [spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_21]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_21]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.prime.tfb.service.binmanagement.BinmanagementService com.prime.tfb.web.controller.BinController.binmanagementservice; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:
No qualifying bean of type [com.prime.tfb.service.binmanagement.BinmanagementService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:517) [spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) [spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286) [spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
... 21 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.prime.tfb.service.binmanagement.BinmanagementService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.sp
ringframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:988) [spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:858) [spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:770) [spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:489) [spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
... 23 more
13:00:17,625 INFO [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-2) Initializing Mojarra 2.1.7-jbossorg-1 (20120227-1401) for context '/provider-pay'
13:00:19,719 WARNING [javax.enterprise.resource.webcontainer.jsf.managedbean] (MSC service thread 1-2) JSF1074: Managed bean named 'loginController' has already been registered. Replacing existing managed bean class type com.prime.tfb.web.controller.LoginController with com.prime.tfb.web.controller
.LoginController.
13:00:21,422 INFO [org.primefaces.webapp.PostConstructApplicationEventListener] (MSC service thread 1-2) Running on PrimeFaces 4.0
13:00:21,453 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Error listenerStart
13:00:21,453 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Context [/provider-pay] startup failed due to previous errors
13:00:21,469 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/provider-pay]] (MSC service thread 1-2) Closing Spring root WebApplicationContext
13:00:21,469 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/provider-pay]] (MSC service thread 1-2) Shutting down log4j
13:00:21,484 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.web.deployment.default-host./provider-pay: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./provider-pay: JBAS018040: Failed to start context
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:95)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_21]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_21]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]
13:00:21,484 INFO [org.jboss.as] (MSC service thread 1-1) JBAS015951: Admin console listening on http://127.0.0.1:9990
13:00:21,484 ERROR [org.jboss.as] (MSC service thread 1-1) JBAS015875: JBoss AS 7.1.1.Final "Brontes" started (with errors) in 27781ms - Started 435 of 514 services (2 services failed or missing dependencies, 76 services are passive or on-demand)
13:00:21,703 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "provider-pay.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.web.deployment.default-host./provider-pay" => "org.jboss.msc.service.StartException in service j
boss.web.deployment.default-host./provider-pay: JBAS018040: Failed to start context"}}
13:00:21,703 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.web.deployment.default-host./provider-pay: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./provider-pay: JBAS018040: Failed to start context
13:00:21,719 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.web.deployment.default-host./provider-pay" => "org.jboss.m
sc.service.StartException in service jboss.web.deployment.default-host./provider-pay: JBAS018040: Failed to start context"}}}}
13:00:23,531 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Stopped deployment provider-pay.war in 1825ms
这是我的com.prime.tfb.service.binmanagement.BinmanagementService.java:
public interface BinmanagementService {
@Transactional(readOnly = false)
public void addBinmanagement(BinManagement binmanagement);
@Transactional(readOnly = false)
public void deleteBinmanagement(BinManagement binmanagement);
@Transactional(readOnly = false)
public void updateBinmanagement(BinManagement binmanagement);
public BinManagement getBinmanagementById(int id);
public List<BinManagement> getBinmanagement();
}
和com.prime.tfb.web.controller.BinController.java:
@ManagedBean
@Controller
@RequestScoped
public class BinController {
private static final long serialVersionUID = 1L;
private static final String SUCCESS = "success";
private static final String ERROR = "error";
private static final Logger logger = Logger.getLogger(BinController.class);
List<BinManagement> BinManagementlist ;
@Autowired
BinmanagementService binmanagementservice;
public BinController()
{
}
public BinmanagementService getbinBinmanagementService(){
return binmanagementservice;
}
public void setBinmanagementService(BinmanagementService binmanagementservice){
this.binmanagementservice = binmanagementservice;
}
/**
*
* Redirects the login request directly to spring security check.
* Leave this method as it is to properly support spring security.
*
* @return
* @throws ServletException
* @throws IOException
*/
public List<BinManagement> getBinmanagementList(User user) throws IOException {
List<BinManagement> list = binmanagementservice.getBinmanagement();
System.out.println("Giving emtpy List..." + list);
FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, "Welcome", user.getUserId());
RequestContext context = RequestContext.getCurrentInstance();
FacesContext.getCurrentInstance().addMessage(null, msg);
ExternalContext ec=FacesContext.getCurrentInstance().getExternalContext();
ec.redirect("admin/bin_management.xhtml");
return list;
}
}
和web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/
XMLSchema-instance" xmlns="http://java.sun.com/xml/
ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/
web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/
xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<display-name>Provider Pay</display-name>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j-config.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/providerpay_spring_config.xml
/WEB-INF/security.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- Enable Spring Security -->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<!-- Allow login pages with JSF which redirects to security check,
therefore we have to add the forward entry here -->
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
</web-app>
和我的BinmanagementServiceImpl.java:
public class BinmanagementServiceImpl implements BinmanagementService {
@Autowired
public BinManagementDAO binmanagementDAO;
@Transactional(readOnly = false)
public void addBinmanagement(BinManagement binmanagement) {
getBinmanagementDAO().addBinmanagement(binmanagement);
// TODO Auto-generated method stub
}
@Transactional(readOnly = false)
public void deleteBinmanagement(BinManagement binmanagement) {
getBinmanagementDAO().deleteBinmanagement(binmanagement);
// TODO Auto-generated method stub
}
@Transactional(readOnly = false)
public void updateBinmanagement(BinManagement binmanagement) {
getBinmanagementDAO().updateBinmanagement(binmanagement);
// TODO Auto-generated method stub
}
public BinManagement getBinmanagementById(int id) {
return getBinmanagementDAO().getBinManagementByID(id);
}
public List<BinManagement> getBinmanagement() {
// TODO Auto-generated method stub
List<BinManagement> bm = new ArrayList<BinManagement>();
bm.add(new BinManagement());
bm.add(new BinManagement());
return bm;
}
public BinManagementDAO getBinmanagementDAO() {
return binmanagementDAO;
}
public void setBinmanagementDAO(BinManagementDAO binmanagementDAO) {
this.binmanagementDAO = binmanagementDAO;
}
}
任何人都可以帮我解决这个问题吗?
答案 0 :(得分:0)
Spring,为了能够自动装配依赖关系,需要了解这些实例。看来你的BinmanagementServiceImpl
并不为Spring所知。在@Component
课程中添加BinmanagementServiceImpl
注释。