y****e 发帖数: 1012 | 1 tomcat7 2888 1 2 20:26 ? 00:00:19 /usr/lib/jvm/jdk1.7.0_03/bin
/java -Djava.util.logging.config.file=/var/lib/tomcat7/conf/logging.
properties -Djava.library.path=/ssd_back/workspace/CDPlacement/
DCPlacementCore/lib -Djava.awt.headless=true -Xmx128m -XX:+
UseConcMarkSweepGC -Djava.util.logging.manager=org.apache.juli.
ClassLoaderLogManager -Djava.endorsed.dirs=/usr/share/tomcat7/endorsed -
classpath /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat
-juli.jar -Dcata... 阅读全帖 |
|
y****e 发帖数: 1012 | 2 接手了一个别人的项目,目前功能部分已经调通了,现在前端部署遇到了一些问题。前
端才用zk,zk里面嵌入一些java code。
整个page,data打包成DCL.war,我把它拷贝到/var/lib/tomcat7/webapps/下面,chmod
to 755, chown to tomcat7:tomcat7.运行localhost:8080/DCL/解压,页面正常显示~
但是运行提交页面的时候出现java.io.FileNotFoundException: cache.csv (Permissi
on denied)
这个cache.csv.是从我的某个jar写出来的,我改了相应目录的权限好像还是不行,我在
‘/etc/tomcat7/policy.d/03catalina.policy’加入了写权限:
grant codeBase "file:${catalina.base}/webapps/DCL.war" {
permission java.security.AllPermission;
permission java.io.FilePermission "fil... 阅读全帖 |
|
y****e 发帖数: 1012 | 3 tomcat7 is started when first boot up. Is it root or my account or tomcat7
user. My account has admin priviledge that allows writes. I change owner of
the DCL.war to tomcat7. Is this right?
Many thanks. |
|
y****e 发帖数: 1012 | 4 I checked /etc/init.d/tomcat7. --user was followed by TOMCAT7_USER, TOMCAT7_
USER=tomcat7. What else I need to check? I can provide more information if
needed. |
|
r*****l 发帖数: 2859 | 5 That means user "tomcat7" is running tomcat. After it's running, you can run
this command to confirm:
ps -ef|grep tomcat
As goodbug said, just give tomcat7 the right permission to the file/dir.
TOMCAT7_ |
|
y****e 发帖数: 1012 | 6 I changed everything tomcat7 possibly can touch to 777. Looks like it's not
working. |
|
|
b***i 发帖数: 3043 | 8 我在JBoss Developer Studio里面用JBoss AS项目可以加入servlet。
但是,在Eclipse/JBoss Developer Studio两个IDE中都无法成功在tomcat 7.0项目中
运行servlet。我创建了openshift的tomcat7.0项目,然后就看到无法识别javax.
servlet这个错误,我就设置了server,下载了apache tomcat,并在项目中java build
path加入Library,选择
tomcat。然后可以编译,在server上运行,看到snoop.jsp,可以创建自己的jsp。这一
步是不是就有问题?有别的办法吗?
然后我新建servlet,修改web.xml,commit and push,发现错误,
First.java:[4,20] error: package javax.servlet does not exist
//First.java
import java.io.IOException;
import javax.servlet.ServletException;
Library:
... 阅读全帖 |
|
|
a**e 发帖数: 5794 | 10 没用过tomcat7,你试试run as administrator
读一下readme,把它install as NT service |
|
g*****g 发帖数: 34805 | 11 Usually this is about the user that starts the tomcat. That user needs
to have write priviledge to that directory.
chmod
示~
Permissi
我在 |
|
e*****t 发帖数: 1005 | 12 先chmod 777,看看能不能解决问题
chmod
示~
Permissi
我在 |
|
r*****l 发帖数: 2859 | 13 Tomcat should use “jsvc” to start itself as a service. "jsvc" has a
command line parameter "--user". Most probably that user is set to tomcat.
Check the init file, in /etc/init.d if you use RHEL.
of |
|
g*****g 发帖数: 34805 | 14 You should show the full exception stack, maybe there's something
else. You should give the user the priviledge to the folder you want
to write, the war file doesn't count.
Sometimes you get permission denied in writing because the
folder doesn't exist.
TOMCAT7_ |
|
y****e 发帖数: 1012 | 15 ava.io.FileNotFoundException: cache.csv (Permission denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.(FileOutputStream.java:212)
at java.io.FileWriter.(FileWriter.java:107)
at edu.uiuc.cs.datacenterplacement.location.DataCache.addValue(
DataCache.java:98)
at edu.uiuc.cs.datacenterplacement.location.CoordinatesManager.
searchLocationPostalCode(CoordinatesManager.java:73)
at sun.reflect.GeneratedMethodAc... 阅读全帖 |
|
T****U 发帖数: 3344 | 16 edu.uiuc.cs.datacenterplacement.location.DataCache.addValue(
DataCache.java:98)
maybe the project was developed on windows platform and save the file to an
external location. check the above source and see if you can find the proble
m. |
|
y****e 发帖数: 1012 | 17 cache.csv was created in class DataCache.
public class DataCache {
private static final String FILENAME = "cache.csv";
private static final double TOLERANCE = 0.1;
private static List memCacheCoord = new ArrayList<
Coordinate>()
;
private static List memCacheConte = new ArrayList();
.....
public static void addValue(double lat, double lng, Object data) {
try {
DecimalFormat format = new De... 阅读全帖 |
|
g*****g 发帖数: 34805 | 18 You need to find out where this path is. Use
File.getAbsolutePath() to determine that. My guess is this
pointing to a shared tomcat directory that's not writtable, not
the app home directory.
Or you may append a temp directory before the hardcoded filename.
System.getProperty("java.io.tmpdir"));
); |
|
T****U 发帖数: 3344 | 19 check if you can create a file "cache.csv" at where the application is deplo
yed. chmod it to 777, and then try running your program again.
); |
|
y****e 发帖数: 1012 | 20 Looks like there is still problems when packing the war files. When I made
changes, the changes didn't reflected on the war files. Wierd. I will check
it out. |
|
|
y****e 发帖数: 1012 | 22 I fixed it using some quick and dirty tricks. I hard-code from 'cache.csv' t
o '/tmp/cache.csv'. Now it works fine.
But I still have problems generating the war file, I just replace the jar fi
le inside the deployed directory. Is there any book on how to manage large s
cale java code? Debuging using Eclipse and packing using maven is really tri
cky to me.
Thanks all |
|
m****r 发帖数: 6639 | 23 what i found to be the easiest way for me is to generate a stub war maven
project, and use the eclipse plug in to generate the project file for
eclipse.
t
fi
s
tri |
|
s******e 发帖数: 493 | 24 It is tricky to package, debug, and deploy a large scale (many times, they
are modulized) web app in eclipse.
My experience is:
1. find one complete maven book
2. google some maven project samples.
3. pay attention to plugins.
t
fi
s
tri |
|
|