JBOSS7部署EAR出现 java.lang.VerifyError

fashchina 2016-07-20 09:20:56
EAR中,有EJB和WAR工程,war中的servlet调用EJB提示下面错误:
GatewayService threw exception: java.lang.VerifyError: (class: xxx/xxx/xxx, method: init signature: ()V) Incompatible object argument for function call
在EAR的LIB目录下,存在包含xxx/xxx/xxx的jar,并且初步进行check,没有发现存在相同名称的类。xxx/xxx/xx部分代码如下:
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.xerces.parsers.AbstractDOMParser;
import org.apache.xerces.parsers.DOMParser;
import org.apache.xml.serialize.BaseMarkupSerializer;
import org.apache.xml.serialize.OutputFormat;
import org.apache.xml.serialize.XMLSerializer;
import org.hibernate.lob.SerializableBlob;
import org.w3c.dom.DOMImplementation;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
import org.xml.sax.InputSource;
import slot.base64.Base64Encoder;
import slot.common.Log;
import slot.exception.GeneralException;
import slot.util.DateUtil;
public class MessageObject
implements MsgConstant, Serializable
{
private DOMParser parser = new DOMParser();
private Document document;
private DocumentBuilder builder = null;
private Element root;
private Node header = null;
private Node extAttrs = null;
private Node request = null;
private Node response = null;
private Node body = null;
private boolean bindingRequest = false;
static Class class$0;
public MessageObject()
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
try {
this.builder = factory.newDocumentBuilder();
DOMImplementation impl = this.builder.getDOMImplementation();
this.document = impl.createDocument(null, "Message", null);

this.root = this.document.getDocumentElement();

this.header = setChildValueByName(this.root, "", "Header");
this.body = setChildValueByName(this.root, "", "Body");

this.extAttrs = setChildValueByName(this.header, "", "ext_attributes");

this.request = setChildValueByName(this.body, "", "request");

this.response = setChildValueByName(this.body, "", "response");

impl = null;
this.builder = null;
}
catch (Exception e) {
e.printStackTrace();
}
}
public MessageObject(byte[] bytesinput)
throws Exception
{
ByteArrayInputStream bais = new ByteArrayInputStream(bytesinput);
InputSource ins = new InputSource(bais);
ins.setEncoding("UTF-8");
this.parser.parse(ins);
bais.close();
ins = null;
init();
}
在调用 MessageObject(byte[] bytesinput)构造函数出现上面的错误,无解。。。

初步判断是类加载器问题,根据网上资料加了
jboss-app.xml和jboss-web.xml(前者放在ear压缩包中的META-INF目录下,后者是放到WAR包中META-INF目录下)
...全文
497 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
fashchina 2016-09-09
  • 打赏
  • 举报
回复
这个问题,看来我是找不到我想要的答案了
tianfang 2016-09-09
  • 打赏
  • 举报
回复
还有,不同项目/jar的编译的jdk版本,也可能导致这样的问题
tianfang 2016-09-09
  • 打赏
  • 举报
回复
还有,不同项目/jar的编译的jdk版本,也可能导致这样的问题
tianfang 2016-07-24
  • 打赏
  • 举报
回复
GatewayService threw exception: java.lang.VerifyError: (class: xxx/xxx/xxx, method: init signature: ()V) Incompatible object argument for function call 是参数类型不匹配 ,看看调用ejb的代码怎么写的
fashchina 2016-07-22
  • 打赏
  • 举报
回复
咋就没人遇到呢

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧