简体   繁体   English

JBoss WS Temp文件保存不正确

[英]JBoss WS Temp file saved incorrectly

My problem from yesterday is say sorted. 昨天的问题是说排序。 Not solved though. 虽然没有解决。

The NPE I had was triggered by a FileNotFoundException that was hidden until I switched to TRACE logging (org.jboss.util.xml.JBossEntityResolver)... 我遇到的NPE是由FileNotFoundException触发的,该事件一直被隐藏,直到我切换到TRACE日志记录(org.jboss.util.xml.JBossEntityResolver)为止。

So here is the thing: 所以这是事情:
1.) I'm trying to connect to the webservice from code that is deployed to under JBoss 1.)我正在尝试从部署到JBoss下的代码连接到Web服务
2.) JBossWs saves the wsdl to the tmp folder like this: 2.)JBossWs将wsdl保存到tmp文件夹,如下所示:

file:/home/xxx/dev/XXXX/jboss-4.2.3.GA/server/yyy/tmp/jbossws/JBossWS_www.company.xx_99_server_soap.php?wsdl=get8489235369016302536.xsd

3.) And then when it tries to read back the WSDL: 3)然后尝试回读WSDL:

TRACE [org.jboss.util.xml.JBossEntityResolver] Failed to obtain URL.InputStream from systemId: file:/home/xxx/dev/xxx-PAN/jboss-4.2.3.GA/server/xxxxxxx/tmp/jbossws/JBossWS_www.comany.xx_99_server_soap.php?wsdl=get8489235369016302536.xsd
java.io.FileNotFoundException: /home/xxx/dev/xxx-PAN/jboss-4.2.3.GA/server/xxxxxxx/tmp/jbossws/JBossWS_www.comany.xx_99_server_soap.php

Obviously it truncates and then not able to read back. 显然,它会被截断,然后无法回读。

I guess I would be able to configure somehow the pattern how it writes it to disk or how it reads it back but I did find the solution (even not from the code of the JBoss class I mentioned). 我想我可以以某种方式配置模式如何将其写入磁盘或将其读回,但是我确实找到了解决方案(即使不是从我提到的JBoss类的代码中)。 Any ideas would be appreciated. 任何想法,将不胜感激。

Edit: 编辑:

I created a simple test application on the Linux server pointing to the same file containing the following code: 我在Linux服务器上创建了一个指向包含以下代码的相同文件的简单测试应用程序:

URL url = new URL("file:/home/abos/xxx/xxxx/jboss-4.2.3.GA/server/xxxxxxx/tmp/jbossws/JBossWS_www.company.xx_99_server_soap.php?wsdl=get8489235369016302536.xsd");
    url.openStream();

Exception in thread "main" java.io.FileNotFoundException: /home/xxx/dev/xxxx/jboss-4.2.3.GA/server/anchorage/tmp/jbossws/JBossWS_www.bdmglobal.xx_99_server_soap.php (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:120)
    at java.io.FileInputStream.<init>(FileInputStream.java:79)
    at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
    at java.net.URL.openStream(URL.java:1010)
    at Main.main(Main.java:11)

So here are my conclusions: 所以这是我的结论:
1.) Actually it is the URL class that truncates the name 1.)实际上是截断名称的URL类
2.) But if it was saved properly it would not be a problem. 2.)但是,如果妥善保存,将不会有问题。

So I'm still looking for a way to configure that. 因此,我仍在寻找一种配置方式。

never saw this problem so my answer may won't help you much.... Have you tried to set the jboss.server.temp.dir property to something like /tmp and run your test case again ? 从来没有见过这个问题,所以我的回答可能对您没有太大帮助。...您是否尝试将jboss.server.temp.dir属性设置为/ tmp之类的值,然后再次运行测试用例? There may be some hardcoded length and trying to shorten the path may solve the problem ... Another trick would be to setup a .sar Jboss service requesting your wsdl and publishing them through JNDI to avoid all problems with path ffrom the client point of view ? 可能会有一些硬编码的长度,尝试缩短路径可能会解决问题...另一个技巧是设置一个.sar Jboss服务,请求您的wsdl并通过JNDI发布它们,以从客户端的角度避免路径f的所有问题? You just have to handle a stream and put it into the JNDI tree ..no path involved 您只需要处理流并将其放入JNDI树中即可。

If your problem occurs when JBoss saves the file so not saving it would solve your problem isn't it ? 如果在JBoss 保存文件时发生问题,那么不保存文件就可以解决问题,不是吗? That 's why I suggest to grab the wsdl as a stream (or text using Reader or InputStream as you prefer) and to put it directly into your JNDI tree.... HTH Jerome 这就是为什么我建议将wsdl作为流(或根据需要使用Reader或InputStream捕获文本)并将其直接放入JNDI树中的原因。...HTH Jerome

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM