Rafael Afonso

Ranch Hand
+ Follow
since Jul 16, 2002
Merit badge: grant badges
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Rafael Afonso

Hello:

My Application use a property file, loaded to a Property class (see example). I need download this using JWS. My first attempt was use <resources>/<jar> tag:

But it did not work. When JWS launched my application, I got this message:


Bad MIME type returned from server when accessing resource: http://localhost:8080/teste/configdir/teste.properties - null


Probably JWS try downloaded this file like a binary one.
Someone suggest me to include property file in a jar file and load this in application using ClassLoader.getResourceAsStream(). But I preferred load this like a (text) File.
So my question is how download configuration or other helper files using JWS. Does JWS download only JAR files?

Thanks,
20 years ago
Hello:

Ok. Add jar in class path works. My buildfile is below:

But now I have a new doubt. If I had more than a jar file in my classpath. Would I include these files one by one in "Class-Path" attibute?

Thanks,
20 years ago

Originally posted by Carol Enderlin:
In your runjava target your class Teste isn't in your classpath.


Ok, I include bin directory in classpath and it works. Build.xml was modified:

It works to runjava task. But my problem with runjar continues.

Thanks,
20 years ago
Hello:

I have this class:

org.apache.commons.lang.ObjectUtils package comes from Jakarta Commons Lang. This source is in src directory and Commons Lang jar is in lib directory. My buildfile is in root directory and it is:

build and jar target run OK. But when I run runjava target I get this message:


Buildfile: C:\java\eclipse\workspace\testant\build.xml
init:
build:
runjava:
[java] java.lang.NoClassDefFoundError: Teste
[java] Exception in thread "main"
[java] Java Result: 1
BUILD SUCCESSFUL
Total time: 1 second


And runjar target prints this:


Buildfile: C:\java\eclipse\workspace\testant\build.xml
init:
build:
jar:
runjar:
[java] java.lang.NoClassDefFoundError: org/apache/commons/lang/ObjectUtils
[java] at Teste.main(Unknown Source)
[java] Exception in thread "main"
[java] Java Result: 1
BUILD SUCCESSFUL
Total time: 1 second


But if I remove reference to ObjectUtils method:

runjar target runs correctly, but runjava target shows same message.
I it was problem of classpath configuration, I had problems with build target. So my mistake must be in other place, but I know where.

Thanks,
20 years ago
Hello:

Thanks to all. I have did this using javascript:

I did not know about ant-contrib. I will look at this.

thanks
20 years ago
Hello:

In a ant buildfile, I have a property with strings separated with commas:

Now I want iterate over these tokens to execute some task. It would be like use String.split() Or use <forToken> JSTL tag. Exemple:

But I did nothing about this in Web. Comeone knows how to do this?

Thank,
20 years ago
Hello:

Following this tutorial I tried access a Excel sheet using ODBC-JDBC. But when I try see my sheet using DbVisualizer it is showed a message about connection not open:

So my question is how open the connection. I a using Windows 2000.

Thanks,
Hello:

I have a problem with my eclipse 3.0. When I want do Software Update (Help -> Software Updates -> Find And Install) I got this message: "Error retrieving 'feature,xml'. [error inopening zip file]". The "Install/Update" is showed anyway. If I check "Search for new features to install", prior error message is showed. I don't know what "feature.xml" it referenced, So I renamed all "feature.xml" in Eclipse directory to "--feature.xml" . But my problem persists. Someone know what does it means? I am using eclipse 3.0 in Windows 2k.

Thanks,
Hello:

I've intalled eclipse in my Win98. When I started it, does not open. It is showedd a message saying that it is not possible open it. In log file (in configuration directory) it is written this:


!SESSION Ago 07, 2004 20:15:58.20 ----------------------------------------------
eclipse.buildId=I200406251208
java.version=1.4.2_05
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=pt_BR

!ENTRY org.eclips e.osgi Ago 07, 2004 20:15:58.20
!MESSAGE Application error
!STACK 1
java.lang.RuntimeException: No application id has been found.
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:313)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.eclipse.core.launcher.Main.basicRun(Main.java:183)
at org.eclipse.core.launcher.Main.run(Main.java:644)
at org.eclipse.core.launcher.Main.main(Main.java:628)


Did Someone see it before? What is "application id"? It happens both with SDK elcipse and RCP Eclipse.

Thanks,

Originally posted by Tony Morris:
There is no such concept as "all the classes in a package", in much the same way as there is no such concept as "all the subclasses of a class". This is because it is dynamic information.

A quick read of the spec. will reveal that you can use reflection to get all the loaded classes of a particular package.


In ClassLoader there is a protected method called getPackages(). So It is possible get all packages used by ClassLoader. But classes? Well, we back to my question.

Thanks,
[ August 05, 2004: Message edited by: Rafael Afonso ]
20 years ago
Hello:

If have a Package object, how can I get all its classes.

Thanks,
20 years ago
Hello:

I have two classes: One with main() method (caller class) and other not (called class). both record log messages using java.util.loging. Log configuration is done in caller class. I want that log file have messages from caller and called classes. However in log file it is shown only caller messages.
Below, the source codes.
Caller class:

Called class:

In console I get this:


28/07/2004 15:57:58 testalog.launcher.Acao <init>
INFO: Criando ...
28/07/2004 15:57:58 testalog.launcher.LogLauncher execute
INFO: Iniciando ...
28/07/2004 15:57:58 testalog.launcher.Acao execute
INFO: Execute �sWed Jul 28 15:57:58 GMT-03:00 2004
28/07/2004 15:57:58 testalog.launcher.LogLauncher execute
INFO: Terminando ...
28/07/2004 15:58:13 testalog.launcher.Acao <init>
INFO: Criando ...
28/07/2004 15:58:13 testalog.launcher.LogLauncher execute
INFO: Iniciando ...
28/07/2004 15:58:13 testalog.launcher.Acao execute
INFO: Execute �sWed Jul 28 15:58:13 GMT-03:00 2004
28/07/2004 15:58:13 testalog.launcher.LogLauncher execute
INFO: Terminando ...
...


But in log file It is showed:


28/07/2004 15:57:58 testalog.launcher.LogLauncher execute
INFO: Iniciando ...
28/07/2004 15:57:58 testalog.launcher.LogLauncher execute
INFO: Terminando ...
28/07/2004 15:58:13 testalog.launcher.LogLauncher execute
INFO: Iniciando ...
28/07/2004 15:58:13 testalog.launcher.LogLauncher execute
INFO: Terminando ...


To recapitulate: In console it is showed log messages from caller and called classes, but in log file only caller messages was written. What I need is find a way to record all log messages from called classes in log file.
Suggestions?

Thanks,
[ July 28, 2004: Message edited by: Rafael Afonso ]
20 years ago
Hello:

I need verify a exstence of attribute in JNDI (in Tomcat 3 or 4). I would like do something like this:

But I do not find anything like this in JNDI api. So I must use exception:

Does Someone know better way?

Thanks,
21 years ago
Hello:
That is the question: I don't want use card sound. So, it seems that I would need JNI to create a *.DLL or *.SO. Is there a library in C or Pascal that can do it?
Thanks,
21 years ago
Stephan:
Thanks, but I do not want anything relationed to Java Media or Multimedia. I want a simpler thing. I remember that in Turbo Pascal (or Turbo C) there is a function similar what I want. But I do not remember what its name and I do not find it anywhere in Internet. Does someone know?
Thanks,
21 years ago