This week's book giveaway is in the OCP forum.
We're giving away four copies of OCP Java SE 8 Programmer II Exam Study Guide and have Kathy Sierra, Bert Bates, & Elizabeth Robson on-line!
See this thread for details.
Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!

Jeff Pavlocak

+ Follow
since Apr 26, 2004
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jeff Pavlocak

I got it to work.

I did have a previous version of Java installed in another set of directories. I completely removed those directories and everything works fine now.

Thanks for the help.

13 years ago
I'm having a problem getting the String classes replace method to work.

I'm using the the J2SE 1.5.0 SDK and the API spec states that the String class now has an overloaded replace(CharSequence target, CharSequence replacement) method.

When I use this method, I can't get the program to compile. Here's a sample:

public class TestReplace
public static void main(String[] args)
String s = "aaa";
CharSequence csTarget = "aa";
CharSequence csReplace = "b";
String s2 = s.replace(csTarget, csReplace);

Compiling this yields the following error:

C:\dev\src>javac replace(char,char) in java.lang.String cannot be applied to
String s2 = s.replace(csTarget, csReplace);
1 error

My CLASSPATH is: c:\jdk1.5.0;.

Any ideas??

13 years ago
The log4j-1.2.8.jar is in the %CATALINA_HOME%/webapps/axis/web-inf/lib directory.

Does it need to be somewhere else?

I tried putting it in the %CATALINA_HOME%/common/lib directory, but then Tomcat aborts during the startup scripts.

Is there an xml or properties file that needs adjusted?
13 years ago
I am trying to install Axis 1_1 with Tomcat 5.0.16, but tomcat keeps running into install errors when it tries to install the Axis application. All the other web apps install just fine. I have been using Tomcat 5.0.16 for a couple months now without really experiencing any problems that I couldn't resolve on my own, but this one has me stumped.

I followed the steps outlined in the Axis installation guide.

I copied the axis directory and it's sub-dirs from the axis-1_1 distro to tomcat's webapps directory.

I made sure that xercesImpl.jar, jaxrpc.jar, and saaj.jar were added to the CLASSPATH in the catalina.bat DOS script.

Actual CLASSPATH value:

However, when I startup the webserver I get the following error:

Nov 10, 2004 1:04:19 PM org.apache.catalina.core.StandardHostDeployer install
INFO: Installing web application at context path /axis from URL file:C:\jakarta-

Nov 10, 2004 1:04:20 PM org.apache.catalina.core.StandardHostDeployer install
INFO: Error installing
No suitable Log constructor [Ljava.lang.Class;@3257b8 for org.apache.commons.logging.impl.Log4JLogger
(Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category)
(Caused by org.apache.commons.logging.LogConfigurationException:
No suitable Log constructor [Ljava.lang.Class;@3257b8 for org.apache.commons.logging.impl.Log4JLogger
(Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category))
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(
at org.apache.commons.logging.LogFactory.getLog(
at org.apache.catalina.session.ManagerBase.<init>(
at org.apache.catalina.session.StandardManager.<init>(
at org.apache.catalina.startup.ContextConfig.managerConfig(
at org.apache.catalina.startup.ContextConfig.start(
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(
at org.apache.catalina.core.StandardContext.start(
at org.apache.catalina.core.ContainerBase.addChildInternal(
at org.apache.catalina.core.ContainerBase.addChild(
at org.apache.catalina.core.StandardHost.addChild(
at org.apache.catalina.core.StandardHostDeployer.install(
at org.apache.catalina.core.StandardHost.install(
at org.apache.catalina.startup.HostConfig.deployDirectories(
at org.apache.catalina.startup.HostConfig.deployApps(
at org.apache.catalina.startup.HostConfig.start(
at org.apache.catalina.startup.HostConfig.lifecycleEvent(
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(

--- The dump continues on after this. Let me know if you need it all ---

The installation instructions are for Tomcat 4.x. Doesn't Axis 1_1 work with Tomcat 5.x? Are their additional jar files needed? Do I need to change a tomcat config file?

Please help.


13 years ago
I have been given the task of writing a client program to interact with a web service. I was able to download some sample code from the company that hosts the web service. The sample code uses a JSP to call on a servlet that interacts with the web service.

I've written JSP pages before, but I have never written client programs to interact with web services using SOAP. I've gone to a number of SOAP recources on the web, and I have been able to get their tutorials to work just fine. But, none of the "hello world" tutorials operate quite like the sample code I have.

I keep getting a Parsing Exception from Tomcat when the servlet tries to create a SOAPConnection. Any ideas as to what might be going wrong?

This is getting really frustrating now. Any help would be greatly appreciated.



I am using tomcat-jwsdp-1.4
My classpath is :

The exact error I get is:


javax.servlet.ServletException: javax/mail/internet/ParseException

root cause

java.lang.NoClassDefFoundError: javax/mail/internet/ParseException
java.lang.Class.getDeclaredConstructors0(Native Method)
javax.xml.soap.FactoryFinder.newInstance(Unknown Source)
javax.xml.soap.FactoryFinder.find(Unknown Source)
javax.xml.soap.MessageFactory.newInstance(Unknown Source)

The code that is giving me the problem is below:

private String getGetUPCInfo(String UPCCode, String key) {

String upcInfoXml = null;

try {

SOAPConnectionFactory soapConFac =

// The next line is the one kicking off the parsing exception
SOAPConnection soapCon = soapConFac.createConnection();
MessageFactory msgFac = MessageFactory.newInstance();
SOAPMessage soapMsg = msgFac.createMessage();
SOAPPart soapPart = soapMsg.getSOAPPart();
SOAPEnvelope soapEnv = soapPart.getEnvelope();
SOAPHeader soapHead = soapEnv.getHeader();
SOAPBody soapBody = soapEnv.getBody();
13 years ago
Try the following:

SELECT table_a.studentid, MAX(studentnumber), sname
FROM table_a, table_b
WHERE table_a.studentid = table_b.studentid
GROUP BY studentid, sname;
Can you print out the value of tempNode before you enter the do loop? This way you can see if it really is a null and not a problem with the logic in your loop.
13 years ago
Can you post the code for your loop? Also your opening and closing connections code.

Your code looked good to me, so I copied your code from the top thread and compiled it. The code compiled fine and ran fine.

Double check that your code matches exactly what is in the thread and you should be good. Or better yet, do what I did and copy it from the thread and paste it into your text editor.

Remember Java is case sensitive.

Also, you don't need to compile the file before the file. The compiler will take care of that for you.

Good luck,

Jeff Pavlocak
13 years ago
Hey Joe,

There may be a decent online tutorial for this, but in case you're interested, in the book "Head First Java" by Kathy Sierra and Bert Bates, they have a real good explanation of packages.

good luck,

13 years ago
Packages help you to add structure and organization to your applications. Whenever you create applications you usually don't have all your code in one file. You'll write a class that uses other classes(objects) among other things to accomplish a task.

Packages enable you to organize your classes so that you can package similar objects together. By putting the "package somePackageName;" at the top of your class source file, you are stating that the class belongs to the somePackageName package.

If you also put the same "package somePackageName;" at the top of another class source file, you are also including that class in the same package as the other one.

Later, in another java program, you can import the somePackageName package and be able to use both of the objects(classes) in your program.

Packages can also include other things like interfaces, which is another discussion.

Hope this helps.

Jeff Pavlocak
13 years ago
Are you using the DOS command line or some GUI tool to compile your code?

If it's a GUI tool which one, and is it the same tool at home as at work?

13 years ago
The package statement allows you to group several classes and interfaces together into a "package". You can then reference the classes you created in that package in other java programs by importing the package.


package com.myNewPackage;

import com.javaranch.*;

public class myNewClass
PostServlet ps = new PostServlet();

// more code...
13 years ago
Check out the EJB Certification (SCBCD) forum, "error in compilation" post updated April 26th 2004.
I believe the link below will take you there, but if not use the above. The answer is in there.
Hope this helps.
Please excuse my previous post where I stipulated one line instead of two. The was my first post and the editor had wrapped the lines. I didn't realize that they would be intact as one line once posted.