|
楼主
发表于: 2014-05-26 17:00:54
系统已安装swftools,
在系统中执行命令 [weblogic@test nohuplogs]$ pdf2swf /weblogic/wls1036/第四部分线性代数.pdf /weblogic/wls1036/ekbsTest.swf NOTICE processing PDF page 1 (595x841:0:0) NOTICE File contains links NOTICE processing PDF page 2 (595x841:0:0) NOTICE File contains pbm pictures NOTICE processing PDF page 3 (595x841:0:0) NOTICE processing PDF page 4 (595x841:0:0) NOTICE processing PDF page 5 (595x841:0:0) NOTICE processing PDF page 6 (595x841:0:0) NOTICE processing PDF page 7 (595x841:0:0) NOTICE processing PDF page 8 (595x841:0:0) NOTICE processing PDF page 9 (595x841:0:0) NOTICE processing PDF page 10 (595x841:0:0) NOTICE processing PDF page 11 (595x841:0:0) NOTICE processing PDF page 12 (595x841:0:0) NOTICE processing PDF page 13 (595x841:0:0) NOTICE processing PDF page 14 (595x841:0:0) NOTICE processing PDF page 15 (595x841:0:0) NOTICE processing PDF page 16 (595x841:0:0) NOTICE processing PDF page 17 (595x841:0:0) NOTICE processing PDF page 18 (595x841:0:0) NOTICE processing PDF page 19 (595x841:0:0) NOTICE processing PDF page 20 (595x841:0:0) NOTICE Writing SWF file /weblogic/wls1036/ekbsTest.swf [weblogic@test nohuplogs]$ 并且文件已经生成 ekbsTest.swf 问题,在java里面,调用java api Process p = r.exec( "pdf2swf /weblogic/wls1036/第四部分线性代数.pdf /weblogic/wls1036/1ssss1.swf"); 结果报错说 java.io.IOException: Cannot run program "pdf2swf": java.io.IOException: error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:460) at java.lang.Runtime.exec(Runtime.java:593) at java.lang.Runtime.exec(Runtime.java:431) at java.lang.Runtime.exec(Runtime.java:328) at com.sinosoft.app.ekbs.web.ConvertServlet.doPost(ConvertServlet.java:52) at com.sinosoft.app.ekbs.web.ConvertServlet.doGet(ConvertServlet.java:28) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378) at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109) at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.ui.SessionFixationProtectionFilter.doFilterHttp(SessionFixationProtectionFilter.java:67) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(AnonymousProcessingFilter.java:105) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.ui.rememberme.RememberMeProcessingFilter.doFilterHttp(RememberMeProcessingFilter.java:116) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.ui.basicauth.BasicProcessingFilter.doFilterHttp(BasicProcessingFilter.java:174) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:278) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256) at weblogic.work.ExecuteThread.run(ExecuteThread.java:221) 求大神解释 |
|
#1 得分:40
回复于: 2014-05-26 17:11:15
楼主要学会用搜索啊,这个问题很容易就查到的。
出错的原因在于额外的参数被直接传送到了ls命令而不是送到实际的命令行。解决这一问题的办法是将cmd串弄成一个字符串数组,并且将你想运行的程序传送到命令shell。 String[] command = { "/bin/sh", "-c", "pdf2swf /weblogic/wls1036/第四部分线性代数.pdf /weblogic/wls1036/1ssss1.swf"}; Process ps = Runtime.getRuntime().exec(command ); 链接:http://blog.sina.com.cn/s/blog_5ded2e5b01012jkt.html |
|
|
#2 得分:0
回复于: 2014-05-27 11:36:49
No such file or directory,这个错其实很明显。没这个文件或目录,在linux下中文是不好使的
|
|
|
#3 得分:0
回复于: 2014-06-05 10:25:15
应该给不是中文的问题,我换了英文也不行
|
|
#4 得分:0
回复于: 2014-06-07 21:47:42
感谢楼上的回答,问题已经解决。1楼说的在理,主要还是路径的问题。我调用pwd,打印了当前的路径。打印出来的路径是当前应用所在的服务器的路径。简单点说,应用的物理位置存放在/weblogic/domain下面。这个时候打印出来的数据就是/weblogic/domain。我要转化的文件要相对于当前路径而言。
|
|
#5 得分:0
回复于: 2014-09-12 14:10:57
我也出现了这样的问题 你是怎么解决的?
![]() |
liunx下swf转换 相关问题____http://bbs.csdn.net/topics/390797316
最新推荐文章于 2022-03-17 18:50:35 发布