[Exception] java.lang.IllegalArgumentException: Prefix string too short
作者:weixin_40725706 | 2024-03-16 23:52:38
赞
踩
prefix string too short
情景: File.createTempFile(“temp”,suffix);
异常:java.lang.IllegalArgumentException: Prefix string too short
原因:这个方法要求前缀不得少于3个字符
解决方案:增加前缀长度(第一个参数),或换其它方法创建文件
异常详细信息: java.lang.IllegalArgumentException: Prefix string too short at java.io.File.createTempFile(File.java:2001) ~[na:1.8.0_102] at java.io.File.createTempFile(File.java:2070) ~[na:1.8.0_102] at cn.jintongsoft.dev.QAExtractor.getQAFromDocument(QAExtractor.java:20) ~[na:na] at com.alibaba.dubbo.common.bytecode.Wrapper1.invokeMethod(Wrapper1.java) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory1.doInvoke(JavassistProxyFactory.java:46)[dubbo−2.8.4.jar:2.8.4]atcom.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:72)[dubbo−2.8.4.jar:2.8.4]atcom.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:53)[dubbo−2.8.4.jar:2.8.4]atcom.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:64)[dubbo−2.8.4.jar:2.8.4]atcom.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper1.invoke(ProtocolFilterWrapper.java:91) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper1.invoke(ProtocolFilterWrapper.java:91)[dubbo−2.8.4.jar:2.8.4]atcom.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:42)[dubbo−2.8.4.jar:2.8.4]atcom.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper1.invoke(ProtocolFilterWrapper.java:91) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:78) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper1.invoke(ProtocolFilterWrapper.java:91)[dubbo−2.8.4.jar:2.8.4]atcom.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:60)[dubbo−2.8.4.jar:2.8.4]atcom.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper1.invoke(ProtocolFilterWrapper.java:91) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:112) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper1.invoke(ProtocolFilterWrapper.java:91)[dubbo−2.8.4.jar:2.8.4]atcom.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38)[dubbo−2.8.4.jar:2.8.4]atcom.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper1.invoke(ProtocolFilterWrapper.java:91) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:38) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper1.invoke(ProtocolFilterWrapper.java:91)[dubbo−2.8.4.jar:2.8.4]atcom.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol1.reply(DubboProtocol.java:108) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:84) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:170) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:52) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:82) ~[dubbo-2.8.4.jar:2.8.4] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_102] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_102] at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_102]