由买买提看人间百态

topics

全部话题 - 话题: classpath
首页 上页 1 2 3 4 5 6 7 下页 末页 (共7页)
t*****s
发帖数: 124
1
来自主题: Java版 - 请问一个最初级问题
如果classpath没有问题,那多半是文件名大小写的事。
c********m
发帖数: 16
2
来自主题: Java版 - 请问一个最初级问题
set path, classpath and an editor. notepad will do but you may want to find a
good IDE once you get into it

path=c:\;C:\j2sdk\lib;C:\j2sdk\bin;C:\MyJavaProject;%SystemRoot%\system32;%Sys
c*****s
发帖数: 214
3
main函数可以servlet上不行?这问题就差不多了。
可能的不同只剩下环境变量或classpath。
服务端那个被ServletException包着的错误八成是个NoClassDefError。
还是先找到服务端错误日志吧。
好奇的问, 你的Axis装在Tomcat上,怎么两端的错误都来自weblogic?
你确定http://as-dev.keas.ksu.edu:9080/axis是Tomcat上的Axis吗?
我觉得你完全可以先把你的Servlet在tomcat上调通再放到weblogic上。既然main函数都
可以运行了,应该很容易用servlet跑。



Axis)
c*****s
发帖数: 214
4
你是说Weblogic上跑客户端程序访问Tomcat上运行的Axis还是把Axis也搬到Weblogic上来
?前者应该不难,因为main程序已经可以运行,同样的代码放保证Classpath正确就行了
。可从你的stack trace上看服务端也是weblogic。
你说的Weblogic上的Application是什么形式?如果还是Servlet,我建议你先关掉weblog
ic把这个Servlet在Tomcat里调通。移植的时候如果还出错,只可能是实施错误。
另外如果想找日志,可以在$BEA_HOME/user_projects//logs和$BEA_HOME/use
r_projects//下看看。

多谢cyclops的帮忙。我的Axis的确装在Tomcat上。我们现在要用WEBLOGIC上的APPLICATI




里就不行?错误里和weblogic.servlet.internal.ServletStubImpl.invokeServlet
m******t
发帖数: 2416
5

I think so, too, because there is an implicit null assignment.
I wouldn't be surprised, though, if some VM chooses to optimizes by waiting
until next line, after all, it doesn't really _have to_ load ClassA on this
line.
It's actually fairly easy to find out, just take ClassA off the classpath, and
look at the exception stack trace. 8-)
m******t
发帖数: 2416
6

waiting
this
classpath, and
Thanks, that's interesting to know.
t***y
发帖数: 22
7
来自主题: Java版 - about java -D option?
I download a package, it is said that when execute the program I must do
following:
java -Djava.library.path=/src/bin/ hello
it is a burden to use -D everytime, any suggestions?
Also, where can I execute my java program? anywhere or a specific place?
I have setup the classpath.
d***o
发帖数: 51
8
来自主题: Java版 - where to execute java program?
If no relative path is given in the classpath, the start dir is not a problem.
Otherwise, for example, if you want to start Tomcat or weblogic, you have to
get into the bin or appserver folder.
A recommendation: In many cases when you start a Java program in a DOS prompt,
you would have to keep the DOS prompt. If you kill the DOS, the Java
application will also be killed. With exe4j, you can wrap the Java program in
an exe file.
http://www.ej-technologies.com
m******t
发帖数: 2416
9
来自主题: Java版 - where to execute java program?

classpath isn't the only problem. Some less careful program might just
open file using, say, new FileStream("foo.txt");
w*******g
发帖数: 9932
10
来自主题: Java版 - Unix: where to execute java program?
as long as the classpath include ".", you can compile java any directory.
m******t
发帖数: 2416
11
来自主题: Java版 - com.sun.tools.javac.Main 问题




I am not sure the concept of classloader applies to compilation at all. The
compiler only recognizes one source path and one classpath.
c*****s
发帖数: 214
12
来自主题: Java版 - com.sun.tools.javac.Main 问题
不是命令行编译,是在程序中直接用Main类编译。
我有的ClassLoader是ClassLoader对象不是classpath字符串。此ClassLoader不是URLCla
ssLoader所以拿不到所有的jar和目录路径。就算可以,也不能保证每层父ClassLoader可
以。

在程序里用com.sun.tools.javac.Main这个类编译一java文件时,用的是静态compile方
些类
样。
m******t
发帖数: 2416
13
Did you make sure the versions you checked are actually the ones
got picked up from the classpath? 8-)
w*******g
发帖数: 9932
14
来自主题: Java版 - Class not found?
did you set the classpath to include the current directory "."?
h***s
发帖数: 45
15
除非你自己做一个网页说明你的类,然后让想用的人都来访问。
而且你要release你写的package,想用的人都要下载你的package。
或是你将你的package放在一个url上,别的用户可以从这里load class。
如果你什么也不作就写了个实现,没有人会知道怎么用你的class的。
至于怎么样让你的package在group范围内可用,就是放在一个共享的classpath上,
或是放在ext中。
m******t
发帖数: 2416
16
来自主题: Java版 - Axis1.2RC3问题


Sorry, I didn't realize it was an Axis class.
Could it be another saaj jar hidden somewhere on one of
the project's classpath?
c*****s
发帖数: 214
17
来自主题: Java版 - Axis1.2RC3问题
问题变成了weblogic问题。出错的程序是在weblogic 7.1环境下运行的。weblogic 中有
几个包(webservices.jar, webserviceclient.jar等)里包含老的javax.xml.soap类。
weblogic 8
中这样的问题可以通过设置WEB-INF/weblogic.xml里的true prefer-web-inf-classes>参数来解决。但7.1不支持这个参数。
我的问题是在weblogic7.1里如何强迫让系统先寻找一个类时先看webapp自己的classpath
, 再找weblogic的。


{http://xml.apache.org/axis/}stackTrace:java.lang.ArrayIndexOutOfBoundsExcept





c*****s
发帖数: 214
18
或者java web start。

的普
sip-communicator.jar;jmf.jar;sound.jar;%CLASSPATH%;%JMFHOME%
-Djava.library.path=./lib
m******t
发帖数: 2416
19
来自主题: Java版 - 大家愿意讨论一下log4j么

There is "path" and "classpath". They are different. 8-)
This might be helpful for you:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/class-loader-howto.html
p***p
发帖数: 559
20
来自主题: Java版 - java深度历险 阅读笔记 zt
我的问题是各种properties和XML配置文件等等,是不是类似class和jar,也
遵循同样的classpath原理。比如log4j就搞不清楚



和Unix




d****s
发帖数: 30
21
来自主题: Java版 - java深度历险 阅读笔记 zt

Not only properties or XML configurations files, any files in Java
systems, have 2 ways to access:
1. using File system, or say, using navtive system's path
2. using ClassLoader functions like findResource() or
getSystemResourceAsStream()
If a system uses the first way to access configuration and
properties files, then what you need is not to put them in
to a class loader's classpath, but just put to a abosulte path.
If a system uses the second way, you should understand
which class loader is u
T*****e
发帖数: 361
22
怎样才知道是不是呢?修改方法?
从configure tomcat进去,在java下,jvm用的是jdk-1.5.0_2的。
java classpath:
D:\yye\gias\components\tomcat-5.5\bin\bootstrap.jar
java options:
-Dcatalina.home=D:\yye\gias\components\tomcat-5.5
-Djava.endorsed.dirs=D:\yye\gias\components\tomcat-5.5\common\endorsed
-Djava.io.tmpdir=D:\yye\gias\components\tomcat-5.5\temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
有什么不对的地方么?
d********r
发帖数: 199
23
来自主题: Java版 - [转载] how to compile Azureus??
如果你只是改动少数几个文件的话,
不需要重新编译,
只需要改那几个source,
然后只需把Azureus2.jar 加到classpath就可以编译了(仅编译你改的那几个文件),
然后重新生成Azureus2.jar
我就是这么做的,没问题。
r*****l
发帖数: 2859
24
Check your classpath
p***p
发帖数: 559
25
My Application will use a C++ share lib, in Eclipse how should I set the LD_
LIBRARY_PATH? in Project Classpath or Run Configuration's Enviornment, should
I give a absolut path or a relative path is enough?
it lookes like in the sh file,
export LD_LIBRARY_PATH=./:$LD_LIBRARY_PATH
g*****g
发帖数: 34805
26
try
java -classpath . yourprogram
g*****g
发帖数: 34805
27
把. 放进系统的 path和classpath里。
p***p
发帖数: 559
28
来自主题: Java版 - JAVA_HOME/lib/tools.jar
Well, it is quite strange. I have set my JAVA_HOME and sometimes if I deploy
web application in Jetty or tomcat, I got a JSP compile error. I have to
manuel add this jar in classpath.
w*r
发帖数: 2421
29
class path....
make sure you have . in your classpath
b******d
发帖数: 794
30
sometimes, the classpath points to program files/java, but you installed the
developer version of java at c:/j2sdk, so change it and see.
G*O
发帖数: 706
31
it worked!
那CLASSPATH设成这样是不是就可以了:
C:\Program Files\Java\jre1.5.0_06\lib\ext\QTJava.zip; .
g*****g
发帖数: 34805
32
how do you launch your code?
try java -classpath . yourMainClass
G*O
发帖数: 706
33
it worked!
那CLASSPATH设成这样是不是就可以了:
C:\Program Files\Java\jre1.5.0_06\lib\ext\QTJava.zip; .
d****I
发帖数: 28
34
来自主题: Java版 - 菜鸟恳请牛人们指点
在众牛人们热烈讨论J2EE的空当,请帮俺看一个古老的问题,指点一下迷津:
我有一个Java stand alone application,在某directory下有若干jar file. 我现在
想做的是不用classpath,在程序启动时自动把那个directory的jar file load 进来。
这个想法能实现么?该如何实现呢?
谢谢指点!
c****r
发帖数: 185
35
来自主题: Java版 - 菜鸟恳请牛人们指点
Write a shell script jarva.sh:
#!/bin/sh
cp=$CLASSPATH
for j in `ls *.jar` do
cp=$cp:$j
done
java -cp $cp $*
g*****g
发帖数: 34805
36
check project property, builder, there is an option in it.
However, common practice is to not pack all third party
libs in your jar but ship them separately and put them in the classpath.
g*****g
发帖数: 34805
37
find out what jar org.beepcore.beep.core.SessionImpl is in
and put -classpath the.jar for your command

lang.
B*********h
发帖数: 800
38
来自主题: Java版 - 一个怪异的java 运行问题
把 ".;"加到classpath里去

末,
m******t
发帖数: 2416
39
来自主题: Java版 - Argh, maven sucks

It gets complicated when your application consists of multiple modules/
projects, some of which share 3rd party dependencies, and some depend on
each other. The ability to keep track of these dependencies becomes very
important in any build process handling this kind of project.
somehow,
You'd still have full control over what gets on your classpath.
I*******e
发帖数: 1879
40
来自主题: Java版 - [合集] TexPen question
☆─────────────────────────────────────☆
ayanami (螃蟹,老子横着爬) 于 (Thu Jan 23 08:00:23 2003) 提到:
D:\TexPen>java -classpath . TexPen
Error occurred during initialization of VM
java.lang.NullPointerException
I have java 2 runtime environment SDK 1.4.0_01 and java2 SDK 1.4.0_01 installed.
What's wrong??
Thanks
☆─────────────────────────────────────☆
goodbug (badbug) 于 (Thu Jan 23 15:44:17 2003) 提到:
Uninstall and reinstall your J2SE

installed.
☆─────────────────────────────────────☆
Foxman
m******t
发帖数: 2416
41
It's not always possible for spring to predict, at startup time, which
database it will encounter at run-time. You could try to override that xml
file on your classpath with lazy-init enabled, but I really don't see it's
worth the trouble. 7 extra beans with 6-7 properties each. Surely your
server has that much memory spare. 8-)
I*******e
发帖数: 1879
42
☆─────────────────────────────────────☆
uniqueengine (uniqueengine) 于 (Sun Jul 29 14:33:28 2007) 提到:
In Eclipse .project and .classpath files, there are some absolute paths for
jar file, which cause trouble when I tried to share project file with others
via CVS.
Anyone know how to switch those absolute paths to relative paths?
Many thanks
☆─────────────────────────────────────☆
orang (大猩猩) 于 (Sun Jul 29 15:07:25 2007) 提到:
在你的项目目录下建一个叫做lib的目录(名字随便)
把jar都放在这个目录里,然后导入
Java Build Path里面Lib
T*****e
发帖数: 361
43
来自主题: Java版 - Classpath questions
I am developing a quite simple Java application, which will be running as a
Windows service via "Java Service Wrapper". I have some questions about the
loading of some jar files.
My application connects to a PostgreSQL database and an SQL Server database,
which means I need to load their drivers. The application also makes use
of EarthWhere API, which in turn uses Hibernate, Sprint, Batik, ... The
list is quite long, and there are more than 100 jars in its "lib" directory.
Right now, I have
j******e
发帖数: 64
44
能够看到tomcat下所有的servlets-examples,在
/usr/local/tomcat/webapps/servlets-examples/ 下面,
于是自己写了一个最简单的HelloWorld.java,编译也可以
通过 javac -classpath /usr/loca/tomcat/servlet-api.jar HelloWorld.java
吧HelloWorld.java和.class都放在了
/usr/local/tomcat/webapps/servlets-examples/WEB-INF/classes
目录下,
其他的examples都能运行,为什么我的不行?
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServlet
G****A
发帖数: 4160
45
想编译一个.java文件,报错.
文件包含:import javax.portlet.GenericPortlet;
编译器好像识别不出来这个包, 网上搜了一下,说是应该把包含javax.portlet的.jar文
件添加到classpath里面,但是不知道是哪个儿文件.
我用的JDK1.6.0_03
谢谢大家指点
r*****l
发帖数: 2859
46
来自主题: Java版 - 命令行编译java程序
那是你classpath没设好。或者用batch,或者ant。
f*******t
发帖数: 132
47
来自主题: Java版 - 遇到一个程序运行错误
Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/
Multipart
貌似没找到multipart类,可是我已经在classpath里面包含了
sdk5的mail.jar/activation.jar了
试了很久也没找到解决办法
m*****j
发帖数: 499
48
来自主题: Java版 - 遇到一个程序运行错误
安装jdk的时候classpath会自己设置好的吧?
或者添加一个 C:\...\jdk\bin?
或者下个最新的6.3的jdk装上试试?
z***h
发帖数: 405
49
In case anybody is interested, here is the solution for this.
try {
Class c = TransportClientPropertiesFactory.class;
Field field = c.getDeclaredField("cache");
field.setAccessible(true);
Map map = (Map) field.get(c);
map.clear();
} catch (Exception e) {
//you should never get here unless jar file is not in the
classpath or a new version of axis jar file doesn't have these class/methods
log.error(
r*****l
发帖数: 2859
50
To answer your question about how to reload classes.
(I personally think, in your case, this is NOT needed
and way OVERKILL), you need to do:
1. Do not put the package in classpath when you start
the application
2. Use the package's path to construct a URI; use this
URI to construct a ClassLoader
3. Use ClassLoader.loadClass() to load the classes in
the package
4. Use reflection to call the methods. Remember the
package is not in the class path so you cannot
use the classes/method
首页 上页 1 2 3 4 5 6 7 下页 末页 (共7页)