草庐IT

declarative-services

全部标签

java - ClassNotFoundException : org. hibernate.service.jndi.JndiException

我得到以下堆栈跟踪...java.lang.ClassNotFoundException:org.hibernate.service.jndi.JndiExceptionjava.net.URLClassLoader$1.run(UnknownSource)java.net.URLClassLoader$1.run(UnknownSource)java.security.AccessController.doPrivileged(NativeMethod)java.net.URLClassLoader.findClass(UnknownSource)org.springframewor

java - "The matching wildcard is strict, but no declaration can be found for element ' http '"错误

我正在尝试配置NTLM身份验证,但收到错误:cvc-complex-type.2.4.c:Thematchingwildcardisstrict,butnodeclarationcanbefoundforelement'http'.我阅读了很多类似错误的主题,但我找不到解决问题的方法。导致错误的我的security.xml文件是:0falseCOMPANYsomenycuserAReallyLoooongRandomPassword因为从版本3.XSpringSecurity开始不再包含NTLM扩展,我从http://aloiscochard.blogspot.com/2010/03/

java - JSF 2 使用 @ManagedProperty 注入(inject) Spring bean/service 而没有 xml

我想使用jsf注释和一些spring将springbean/服务注入(inject)jsf托管bean的注释。(在jsfbean上我只想使用jsf注释)我不想使用像@named/@inject这样的注解。我试图在网上找到解决方案,但没有任何运气。例子@ManagedBean@ViewScopedpublicclassMyBean{@ManagedProperty(value="#{mySpringBean}")privateMySpringBeanmySpringBean;publicvoidsetMySpringBean(MySpringBeanmySpringBean){this.

java - Spring Service 默认范围

Spring4@Service的默认范围是什么?设计一个Service实现是否有意义,通过类属性存储有关当前登录用户的信息(根据当前HTTPsession)em>(也可以使用final修饰符)? 最佳答案 WhichisthedefaultscopeofaSpring4@Service?默认作用域是单例ItisreasonabletodesignaServiceimplementationinordertostoresomeinfo,relatedtothecurrentloggeduser(accordingtothecurren

web-services - Spring、Jackson 和自定义(例如 CustomDeserializer)

对Spring还有些陌生,遇到了一个problem这使得有必要为jackson实现我的自定义解串器。该过程在一个小的tutorial中进行了描述。,但是,我被Spring困住了。我不明白,在哪里ObjectMappermapper=newObjectMapper();在SpringMVC中,json是通过Controller类的方法反序列化时执行的。所以我不知道该怎么做才能用自定义反序列化器替换默认反序列化器。欢迎提出任何建议。 最佳答案 你没有说你在Spring中是如何使用Jackson的,所以我假设你是通过使用它的。和@Requ

java - Spring Boot 1.4 测试 : Configuration error: found multiple declarations of @BootstrapWith

按照此处的官方文档:http://docs.spring.io/spring-boot/docs/1.4.0.M2/reference/htmlsingle/#Testing我想像这样测试我的一种RESTAPI方法:@RunWith(SpringRunner.class)@WebMvcTest(LoginController.class)@SpringBootTest(classes=Application.class)publicclassAuthorizationServiceTest{@AutowiredprivateTestRestTemplaterestTemplate;@T

Java Web Service 框架/库,哪个更好,为什么?

目前我正在评估Java中的Web服务框架的数量。我需要Web服务框架来帮助我公开在JBoss上运行的现有应用程序的一些功能,该应用程序主要使用Spring和POJO(无EJB)开发。我需要的是一个具有以下属性的框架:它应该提供自动生成样板代码的工具,并通过消除重复性任务来节省时间,例如从Java(java2wsdl)生成WSDL的工具、生成端点的工具等。应用程序应该很容易部署在现有的J2EE平台(JBoss)上,这意味着它应该包含尽可能少的配置文件(如axis2框架中的axis2.xml)。此外,最好能够在现有应用程序的.war存档中部署Web服务。(似乎Axis2需要一个单独的Web

Java Spring : Error message "no declaration can be found for element ' util:constant'

我正在尝试将util-constant用于ioc,但收到以下错误消息:cvc-complex-type.2.4.c:Thematchingwildcardisstrict,butnodeclarationcanbefoundforelement'util:constant'.Allofthespring3.1.1distjarsareinmyclasspathandIwasabletosuccessfullyrunmyprogrampriortomakingthechangesthatincludedtheuseoftheutil:constanttag.Here'smyiocxmlf

Spring JSF 集成 : how to inject a Spring component/service in JSF managed bean?

我知道托管bean像Controller一样工作,因为您唯一的任务是将View层与模型“链接”。要将bean用作托管bean,我必须声明@ManagedBean注释,这样做我可以直接与bean通信JSF。如果我想在这个managedBean中注入(inject)一些组件(来自Spring),我有两种可能的方法:选择ManagedBean中的属性(如“BasicDAOdao”)并声明@ManagedProperty(#{"basicDAO"})属性(property)之上。这样做,我正在注入(inject)bean"basicDAO"来自ManagedBean中的Spring。在Mana

Spring注解@Repository和@Service

使用@Repository有什么好处?和@Service?不要告诉我有关组件扫描等的事情,如果有的话,我很期待一些额外的好处或功能。如果我不使用它会怎样?我会错过什么? 最佳答案 有几个原因:使用更具体的注释更容易定位切入点。不要低估它的用处!@Repository注释带有一些附加功能:它会导致异常为wrappedupasDataAccessExceptions.@Service注释maygainadditionalsemanticsinthefuture但这还没有发生…… 关于Spri