org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException异常

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/uriel_chiang/article/details/70146876

网上查到所说的是:
poi版本的问题,和某些jar包冲突了
换掉这些(或者删除)就可以了,我的项目是
poi版本为3.9,删除原来3.2的poi jar包,再 将xbean-2.2.0.jar删除就无异常了

阅读更多

扫码向博主提问

uriel_chiang

非学,无以致疑;非问,无以广识
去开通我的Chat快问

异常java.lang.reflect.InvocationTargetException

12-12

使用sax方式解析xml,代码如下:rn[code=Java]rnprivate void init()rn try rn SAXParser parser = (SAXParser)Class.forName("org.apache.xerces.parsers.SAXParser").newInstance();rn parser.setContentHandler(this);rn parser.parse(this.getClass().getResource(".").getPath()+"WS-configure.xml");rn catch (Exception e) rn rn rn[/code]rn异常如下,运行时抛出的:rn[code=Java]rnjava.lang.reflect.InvocationTargetExceptionrn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)rn at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn……rn[/code]

java.lang.reflect.InvocationTargetException异常

12-07

运行程序的时候出现异常rn(Error: java.lang.reflect.InvocationTargetException)rnjava.lang.reflect.InvocationTargetExceptionrn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:585)rn at com.almonde.WSEntryPoint.main(WSEntryPoint.java:51)rnCaused by: java.lang.ExceptionInInitializerErrorrn at com.almonde.client.ui.logger.Logger$LogTreeNode.headerToString(Logger.java:159)rn at com.almonde.client.ui.logger.Logger$LogTreeNode.toString(Logger.java:164)rn at javax.swing.JTree.convertValueToText(JTree.java:1139)rn at javax.swing.tree.DefaultTreeCellRenderer.getTreeCellRendererComponent(DefaultTreeCellRenderer.java:331)rn at com.sun.java.swing.plaf.windows.WindowsTreeUI$WindowsTreeCellRenderer.getTreeCellRendererComponent(WindowsTreeUI.java:172)rn at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimensions(BasicTreeUI.java:2643)rn at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayoutCache.java:475)rn at javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.updatePreferredSize(VariableHeightLayoutCache.java:1342)rn at javax.swing.tree.VariableHeightLayoutCache.rebuild(VariableHeightLayoutCache.java:720)rn at javax.swing.tree.VariableHeightLayoutCache.setModel(VariableHeightLayoutCache.java:91)rn at javax.swing.plaf.basic.BasicTreeUI.setModel(BasicTreeUI.java:390)rn at javax.swing.plaf.basic.BasicTreeUI$Handler.propertyChange(BasicTreeUI.java:3316)rn at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:333)rn at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:270)rn at java.awt.Component.firePropertyChange(Component.java:7159)rn at javax.swing.JTree.setModel(JTree.java:710)rn at com.almonde.client.ui.logger.Logger.resetLog(Logger.java:373)rn at com.almonde.client.ui.logger.Logger.createUI(Logger.java:207)rn at com.almonde.client.ui.logger.Logger.(Logger.java:196)rn at com.almonde.client.ui.logger.Logger.(Logger.java:62)rn at com.almonde.client.ui.warning.UserNotificationManager.queueProblem(UserNotificationManager.java:316)rn at com.almonde.client.ui.warning.UserNotificationManager.queueProblem(UserNotificationManager.java:304)rn at com.almonde.ALMClient.(ALMClient.java:166)rn at com.almonde.ALMClient.main(ALMClient.java:641)rn ... 5 morernCaused by: java.lang.IllegalArgumentException: Illegal pattern character 'l'rn at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:678)rn at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:497)rn at java.text.SimpleDateFormat.(SimpleDateFormat.java:446)rn at com.almonde.client.ui.render.Formatter.setFormatters(Formatter.java:319)rn at com.almonde.client.ui.render.Formatter.initialize(Formatter.java:474)rn at com.almonde.client.ui.render.Formatter.(Formatter.java:97)rn

项目异常:java.lang.RuntimeException: java.lang.reflect.InvocationTargetException

09-25

Dispatcher initialization failedrnjava.lang.RuntimeException: java.lang.reflect.InvocationTargetExceptionrn at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:301)rn at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:438)rn at com.opensymphony.xwork2.inject.ContainerBuilder$5.create(ContainerBuilder.java:207)rn at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)rn at com.opensymphony.xwork2.inject.ContainerBuilder$3.create(ContainerBuilder.java:93)rn at com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:487)rn at com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:484)rn at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:580)rn at com.opensymphony.xwork2.inject.ContainerBuilder.create(ContainerBuilder.java:484)rn at com.opensymphony.xwork2.config.impl.DefaultConfiguration.createBootstrapContainer(DefaultConfiguration.java:288)rn at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:205)rn at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)rn at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:390)rn at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:437)rn at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)rn at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)rn at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)rn at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)rn at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:115)rn at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4072)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4726)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)rn at org.apache.catalina.core.StandardService.start(StandardService.java:525)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:595)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)rnCaused by: java.lang.reflect.InvocationTargetExceptionrn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:299)rn ... 42 morernCaused by: java.lang.ExceptionInInitializerErrorrn at com.opensymphony.xwork2.ognl.OgnlValueStackFactory.setContainer(OgnlValueStackFactory.java:85)rn ... 47 morernCaused by: java.lang.IllegalArgumentException: Javassist library is missing in classpath! Please add missed dependency!rn at ognl.OgnlRuntime.(OgnlRuntime.java:168)rn ... 48 morernCaused by: java.lang.ClassNotFoundException: javassist.ClassPoolrn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)rn at java.lang.Class.forName0(Native Method)rn at java.lang.Class.forName(Unknown Source)rn at ognl.OgnlRuntime.(OgnlRuntime.java:165)rn ... 48 morern

java.lang.reflect.InvocationTargetException 这是什么异常

09-22

java.lang.reflect.InvocationTargetException 这是什么异常?rnrn我在Tomcat4+Axis下编写了一个Web Services:Edi.jws,它调用了一个连接数据库的javabean:Conn_SQL.java,这些文件编译都通过了,但是当我执行客户端Main.java时却出现以上的异常信息,请教高手这个异常是说什么意思啊,我应该怎么改正啊?好折磨我啊。。。rn---------------------------------------------------------rnEdi.jws源码:rnimport java.util.Date;rnrnpublic class Edi rnrn public int Login(String username,String pwd)rn rn Conn_SQL conn_sql = new Conn_SQL();rn if (!username.equals("")&&!pwd.equals(""))rn rn tryrn rn String temp_sql = "Select * from UserInfo where UserName = '" + username + "' and Pwd = '" + pwd + "'";rn conn_sql.sql_Query(temp_sql);rn conn_sql.rs.last();rn if (conn_sql.rs.getRow()>0)rn rn return 0;rn rn elsern rn return 1;rn rn rn catch (Exception e)rn rn System.out.println(e.getMessage());rn return 1;rn rn rn elsern rn return 1;rn rn rnrnrn----------------------------------------------------------rnConn_SQL.java源码:rnimport java.sql.*;rnrnpublic class Conn_SQLrnrn String sDBDriver = "sun.jdbc.odbc.JdbcOdbcDriver";rn String sql_ConnStr = "jdbc:odbc:MyTest";rn Connection connect = null;rn ResultSet rs = null;rnrn public Conn_SQL()rn rn tryrn rn Class.forName(sDBDriver);rn rn catch (java.lang.ClassNotFoundException e)rn rn System.err.println(e.getMessage());rn rn rnrn public ResultSet sql_Query(String sql)rn rn rs = null;rn tryrn rn connect = DriverManager.getConnection(sql_ConnStr);rn Statement stmt = connect.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);rn rs = stmt.executeQuery(sql);rn rn catch (SQLException ex)rn rn System.err.println(ex.getMessage());rn rn return rs;rn rnrn public void sql_Update(String sql)rn rn tryrn rn connect = DriverManager.getConnection(sql_ConnStr);rn Statement stmt = connect.createStatement();rn stmt.executeUpdate(sql);rn rn catch (SQLException ex)rn rn System.err.println(ex.getMessage());rn rn rnrnrn---------------------------------------------------rn客户端Main.java源码:rnpackage localhost.axis.Edi_jws;rnrnpublic class Main rnrn public static void main(String[] args) throws Exception rn rn tryrn rn EdiService service = new EdiServiceLocator();rn Edi edi = service.getEdi();rn System.out.println(edi.login("xiaoye","123"));rn rn catch (Exception e)rn rn System.out.println(e.getMessage());rn rn rnrnrn麻烦各位帮我看看!多谢!:)

异常java.lang.reflect.InvocationTargetException - Class: com.opensymphony.xwork2.i

09-25

严重: Exception starting filter struts2rnjava.lang.reflect.InvocationTargetException - Class: com.opensymphony.xwork2.inject.ContainerImpl$MethodInjectorrnFile: ContainerImpl.javarnMethod: injectrnLine: 301 - com/opensymphony/xwork2/inject/ContainerImpl.java:301:-1rn at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:450)rn at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)rn at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)rn at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)rn at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)rn at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:115)rn at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4072)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4726)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)rn at org.apache.catalina.core.StandardService.start(StandardService.java:525)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:595)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)rnCaused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetExceptionrn at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:301)rn at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:438)rn at com.opensymphony.xwork2.inject.ContainerBuilder$5.create(ContainerBuilder.java:207)rn at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)rn at com.opensymphony.xwork2.inject.ContainerBuilder$3.create(ContainerBuilder.java:93)rn at com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:487)rn at com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:484)rn at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:580)rn at com.opensymphony.xwork2.inject.ContainerBuilder.create(ContainerBuilder.java:484)rn at com.opensymphony.xwork2.config.impl.DefaultConfiguration.createBootstrapContainer(DefaultConfiguration.java:288)rn at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:205)rn at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)rn at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:390)rn at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:437)rn ... 29 morernCaused by: java.lang.reflect.InvocationTargetExceptionrn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:299)rn ... 42 morernCaused by: java.lang.ExceptionInInitializerErrorrn at com.opensymphony.xwork2.ognl.OgnlValueStackFactory.setContainer(OgnlValueStackFactory.java:85)rn ... 47 morernCaused by: java.lang.IllegalArgumentException: Javassist library is missing in classpath! Please add missed dependency!rn at ognl.OgnlRuntime.(OgnlRuntime.java:168)rn ... 48 morernCaused by: java.lang.ClassNotFoundException: javassist.ClassPoolrn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)rn at java.lang.Class.forName0(Native Method)rn at java.lang.Class.forName(Unknown Source)rn at ognl.OgnlRuntime.(OgnlRuntime.java:165)rn ... 48 more

JPA异常java.lang.reflect.InvocationTargetException。。。。

10-16

[color=#FF0000][/color]大致就是下面谢谢你们帮看看rnrnjava.lang.reflect.InvocationTargetExceptionrn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn java.lang.reflect.Method.invoke(Method.java:597)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:440)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279)rn ......rnroot cause rnrn[color=#FF0000]java.lang.NoClassDefFoundError: antlr/RecognitionException[/color]rn java.lang.Class.getDeclaredMethods0(Native Method)rn java.lang.Class.privateGetDeclaredMethods(Class.java:2427)rn java.lang.Class.getDeclaredMethod(Class.java:1935)rn java.io.ObjectStreamClass.getPrivateMethod(ObjectStreamClass.java:1382)rn java.io.ObjectStreamClass.access$1700(ObjectStreamClass.java:52)rn java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:438)rn java.security.AccessController.doPrivileged(Native Method)rn java.io.ObjectStreamClass.(ObjectStreamClass.java:413)rn java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:310)rn java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:547)rn java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)rn java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)rn java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)rn java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)rn java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)rn java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)rn java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)rn java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)rn java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)rn java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)rn java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)rn java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)rn java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)rn rn org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:102)rnrnrnroot cause rnrn[color=#FF0000]java.lang.ClassNotFoundException: antlr.RecognitionException[/color]rn java.net.URLClassLoader$1.run(URLClassLoader.java:200)rn java.security.AccessController.doPrivileged(Native Method)rn java.net.URLClassLoader.findClass(URLClassLoader.java:188)rn java.lang.ClassLoader.loadClass(ClassLoader.java:307)rn java.lang.ClassLoader.loadClass(ClassLoader.java:252)rn java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)rn java.lang.Class.getDeclaredMethods0(Native Method)rn java.lang.Class.privateGetDeclaredMethods(Class.java:2427)rn rnrn我的dao为 sqlrn String sql="select inves from InvestmentProject inves ,in(inves.subModes) subMode,in(msg.districts) dist where 1=1";rn if((Integer)map.get("target") == 1) rn if (!map.get("keyword").equals("")) rn sql+=" and inves.keyword like '%"+map.get("keyword")+"%' ";rn rn rn else if ((Integer)map.get("target") == 2) rn if (!map.get("keyword").equals("")) rn sql+=" and inves.name like '%"+map.get("name")+"%' ";rn rn rn rn if((Integer)map.get("industry")>0)rn sql+=" and theIndustry.id="+(Integer)map.get("industry")+" ";rn rn rn if(map.get("district_ids")!=null)rn Set set = (Set)map.get("district_ids");rn int j=0;rn String district_ids="";rn for(Integer i:set)rn if(j==0)rn district_ids=i+"";rn elsern district_ids+= ","+i;rn rn j++;rn rn sql+=" and dist.id in("+district_ids+")";rn rn rn if(map.get("modesS")!=null)rn sql+=" and modes.id="+(Integer)map.get("modesS")+" ";rn rn if(map.get("subMode_ids")!=null)rn Set set = (Set)map.get("subMode_ids");rn int z=0;rn String subMode_ids="";rn for(Integer i:set)rn if(z==0)rn subMode_ids=i+"";rn elsern subMode_ids+= ","+i;rn rn z++;rn rn sql+=" and subMode.id in("+ subMode_ids+")";rn rnrn........rnQuery query = entityManager.createQuery(sql);rnList listIn=query.getResultList();rn不在道是怎么回事rn请教前辈名指点我是通过对象查询关联了很多表rn谢谢你们帮帮忙

没有更多推荐了,返回首页