Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Unix系统中用Flatworm编写文件_Java_File_Shared Libraries_Portability - Fatal编程技术网

Java Unix系统中用Flatworm编写文件

Java Unix系统中用Flatworm编写文件,java,file,shared-libraries,portability,Java,File,Shared Libraries,Portability,我们的Java应用程序遇到了一个奇怪的情况,我们需要编写一个平面wile,我们决定使用Flatworm Java库。 我们编写了一个需要在Unix服务器上调度的企业java应用程序。我们开发了java应用程序,它在windows桌面PC上运行良好。 当我们尝试执行使用Flatworm库的应用程序时,会出现一个无声错误。应用程序挂起并且不会引发任何异常。 因此,我们尝试放置大量日志信息,并了解问题所在 fileCreator = new FileCreator(outputData.getConf

我们的Java应用程序遇到了一个奇怪的情况,我们需要编写一个平面wile,我们决定使用Flatworm Java库。 我们编写了一个需要在Unix服务器上调度的企业java应用程序。我们开发了java应用程序,它在windows桌面PC上运行良好。 当我们尝试执行使用Flatworm库的应用程序时,会出现一个无声错误。应用程序挂起并且不会引发任何异常。 因此,我们尝试放置大量日志信息,并了解问题所在

fileCreator = new FileCreator(outputData.getConfigMailFile(), outputData.getDownloadFolder() + trackFileName);
            fileCreator.open();
            fileCreator.setRecordSeperator("\n");
            for (MailFile mail : listMails) {
                fileCreator.setBean("mail", mail);
                fileCreator.write("mailRow");
            }
当我们调用这两个方法时,错误应该在java循环中

for (MailFile mail : listMails) {
                    fileCreator.setBean("mail", mail);
                    fileCreator.write("mailRow");
                }
我们对这个问题有点迷茫,我们希望至少了解如何捕获这个异常。执行代码的Unix计算机似乎异常停止。 我真的很感谢你的帮助。 多谢各位

2012年7月19日更新

我们在Linux3.2内核Java1.6上进行了尝试,程序运行正常。看起来好像有什么东西阻止了它,我们查看了flatworm的源代码,应用程序挂起在这部分代码中:

if (beanRef != null)
                        {
                            // Extract property name
                            Object bean = null;
                            String property = "";
                            try
                            {
                                int posOfFirstDot = beanRef.indexOf('.');
                                bean = beans.get(beanRef.substring(0, posOfFirstDot));
                                property = beanRef.substring(posOfFirstDot + 1);
                            } catch (ArrayIndexOutOfBoundsException ex)
                            {
                                throw new FlatwormCreatorException("Had trouble parsing : " + beanRef
                                        + " Its format should be <bean_name>.<property_name>");
                            }

                            // Convert to String for output
                            Object value = PropertyUtils.getProperty(bean, property);
                            val = convHelper.convert(type, value, convOptions, beanRef);
                            PropertyUtils.setProperty(bean, property, value);
                        } // end beanRef != null
                        // Handle any conversions that need to occur
                        if (val == null)
                        {
                            val = "";
                        }
                        val = convHelper.transformString(val, recElement.getConversionOptions(), recElement
                                .getFieldLength());

                        if (itRecElements.hasNext())
                            bufOut.write(val + delimit);
                        else
                            bufOut.write(val);
if(beanRef!=null)
{
//提取属性名
objectbean=null;
字符串属性=”;
尝试
{
int posOfFirstDot=beanRef.indexOf('.');
bean=beans.get(beanRef.substring(0,posOfFirstDot));
property=beanRef.substring(posOfFirstDot+1);
}捕获(阵列索引边界外异常)
{
抛出新的FlatwormCreatorException(“解析有问题:”+beanRef
+“其格式应为。”);
}
//转换为字符串以进行输出
对象值=PropertyUtils.getProperty(bean,property);
val=convHelper.convert(类型、值、集合、beanRef);
setProperty(bean、属性、值);
}//结束beanRef!=无效的
//处理任何需要进行的转换
if(val==null)
{
val=”“;
}
val=convHelper.transformString(val,recElement.getConversionOptions(),recElement
.getFieldLength());
if(itRecElements.hasNext())
bufOut.write(val+定界);
其他的
bufOut.write(val);

另一个不起作用的unix是内核2.6和java 1.6

您在不同版本的java和不同版本的unix中试用过吗?我在java 1.6和unix中试用过。无论如何,答案是否定的。我将在linux环境中尝试并评估结果