更新在WebSphere和Netweaver中运行的应用程序以在JBoss6.2 EAP中运行后,我遇到了麻烦.
我发现使用@PostConstruct(javax.annotation.PostConstruct)注释的init()方法的Spring管理的@Repository(org.springframework.stereotype.Repository)在JBossEAP中部署时没有运行init()方法6.2.0.
该类看起来如下所示:
package com.company.productname.api.dao.impl;
// ... imports removed ....
@Repository
public class UserRoleDao extends AbstractBaseDao {
private static final Log LOG = LogFactory.getLog(UserRoleDao.class);
private boolean testInitInvoked = false;
// .... some code removed ....
/**
* Prepare the caches used to lookup market roles
*/
@PostConstruct
protected void init() {
testInitInvoked = true;
if (LOG.isDebugEnabled())LOG.debug("UserRoleDao.init() method called");
// .. . . . some code removed ......
}
@Override
public Mask getMask(final String aMaskName) {
LOG.debug("getRoleMask entered, testInitInvoked = …Run Code Online (Sandbox Code Playgroud) 我无法在JBoss 7.3.0中运行一些代码(请参阅下面的版本)来调用未在JBoss中运行的Web服务.我收到错误,如下所示.
我已经在各地寻找解决方案,所以任何操纵者都会非常感激.
我使用JBOSS_HOME\bin\wsconsume.bat工具生成了@WebServiceClient java类.我使用的技术是将URL和QName对象传递给@WebServiceClient类的构造函数.我可以看到代码能够从URL读取wsdl(使用http://地址),但正如您在下面的例外中所看到的,它无法看到这些方法.
我已经通过运行一个独立的Java应用程序来验证代码在JBoss之外工作,该应用程序执行相同的操作,它可以连接到webservice,调用方法并读取响应.
我注意到一些有趣的东西,如果我关闭了webservice,然后更改代码,从filesyetem(文件的URL:/而不是http://)本地存储的wsdl的副本中读取wsdl,那么相同的错误是生成,这对我来说似乎很奇怪,几乎就好像JBoss不允许传出连接到web服务.当webservice正在运行(并且代码被还原为使用http URL)时,看起来JBoss能够读取wsdl(日志记录显示已经从wsdl读取了Web方法)但是没有连接到webservice.
版本:
JBoss:EAP 6.2.0.GA(基于AS 7.3.0构建)Java:1.6.0_45
此处显示异常:
13:14:02,451 INFO [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (Thread-4 (HornetQ-client-global-threads-1486295624)) Creating Service {http://www.ibm.com/maximo/wsdl/FR_MXWOWS}FR_MXWOWS from WSDL: file:/Dimensions/NIW_DEV/niw/ext/src/main/resources/wsdl/MockMaximoService.wsdl
13:14:02,541 WARNING [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (Thread-4 (HornetQ-client-global-threads-1486295624)) No method was found for the WSDL operation {http://www.ibm.com/maximo/wsdl/FR_MXWOWS}UpdateFR_MXWO.
13:14:02,541 WARNING [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (Thread-4 (HornetQ-client-global-threads-1486295624)) No method was found for the WSDL operation {http://www.ibm.com/maximo/wsdl/FR_MXWOWS}CreateFR_MXWO.
13:14:02,541 WARNING [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (Thread-4 (HornetQ-client-global-threads-1486295624)) No method was found for the WSDL operation {http://www.ibm.com/maximo/wsdl/FR_MXWOWS}DeleteFR_MXWO.
13:14:02,551 WARNING [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (Thread-4 (HornetQ-client-global-threads-1486295624)) No method was found for the WSDL operation {http://www.ibm.com/maximo/wsdl/FR_MXWOWS}SyncFR_MXWO. …Run Code Online (Sandbox Code Playgroud)