Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 570521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:24:37+00:00 2026-05-13T13:24:37+00:00

Trying to create a test app that imports another test package. The test apps

  • 0

Trying to create a test app that imports another test package.

The test apps are listed, as is the compile cmd and the err..

The files are all in the same dir. I was able to compile the MyIncorrectnessListener.java, and the MycssErrorHandler.java with no warnings/errs.

I’m trying to figure out what’s the cause of the err >>> sjsu_classes.java:33: ‘.’ expected <<<<<

Any pointers/comments are appreciated…

thanks

the compile cmd/err

[root@toshiba parseapp2]# javac -Xlint -classpath '/opt/htmlunit/lib/
*:/parseapp2/' sjsu_classes.java sjsu_classes.java:33: '.' expected
import MyIncorrectnessListener;
                             ^
sjsu_classes.java:33: ';' expected 
import MyIncorrectnessListener;
                              ^
sjsu_classes.java:34: class, interface, or enum expected 
import MycssErrorHandler;
      ^

3 errors
3 warnings



/*
//      sjsu_classes.java
//
//      function handles getting the data from the sjsu course page, and returns the course page/list
//      for the given Alphabet letter. - handles ane letter at a time..
//      -the page is then returned to the calling routinne
//
//              input:
//                      args[0] - start url
//                      args[1] - term
//                      args[2] - dept
//
//              return:
//                      course page for the term/dept
//
*/
import java.io.IOException;
import java.net.URL;
import java.util.List;
import java.util.Set;

import org.apache.commons.httpclient.NameValuePair;

import com.gargoylesoftware.htmlunit.*;
import com.gargoylesoftware.htmlunit.html.*;
import org.w3c.css.sac.ErrorHandler;
import org.xml.sax.SAXParseException;

//==my test packages
import MyIncorrectnessListener;
import MycssErrorHandler;

public class sjsu_classes {

   //public static void main(String[] args) throws Exception {
   public void main(String[] args) throws Exception {

           // Create and initialize WebClient object
      WebClient webClient = new WebClient(BrowserVersion.FIREFOX_3);

           IncorrectnessListener ilisten = new MyIncorrectnessListener();
           ErrorHandler ierr = new MycssErrorHandler();
           webClient.setIncorrectnessListener(ilisten);
           webClient.setCssErrorHandler(ierr);
      webClient.setThrowExceptionOnScriptError(false);
      webClient.setRefreshHandler(new RefreshHandler() {
        public void handleRefresh(Page page, URL url, int arg) throws IOException {
                           //System.out.println("handleRefresh");
                   }

           });

           // visit the page, get the form, get the btn
           String url_tmp;
           String url;
           String Term;
           String Dept;
           String tmp1;
           String tmp2;

           url_tmp="?FolderPath=PORTAL_ROOT_OBJECT.PA_HC_CLASS_SEARCH&amp;PortalActualURL=https%3a%2f%2fcmshr.sjsu.edu%2fpsc%2fHSJPRDF%2fEMPLOYEE%2fHSJPRD%2fc%2fCOMMUNITY_ACCESS.CLASS_SEARCH.GBL&amp;PortalRegistryName=EMPLOYEE&amp;PortalServletURI=https%3a%2f%2fcmshr.sjsu.edu%2fpsp%2fHSJPRDF%2f&amp;PortalURI=https%3a%2f%2fcmshr.sjsu.edu%2fpsc%2fHSJPRDF%2f&amp;PortalHostNode=HRMS&amp;NoCrumbs=yes";

           System.exit(0);
   }

}

=======================

MyIncorrectnessListener test package
--------------------------------------------
/*
//      MyIncorrectnessListener.java
//
//      function handles getting the data from the sjsu course page, and returns the course page/list
//      for the given Alphabet letter. - handles ane letter at a time..
//      -the page is then returned to the calling routinne
//
//              input:
//                      args[0] - start url
//                      args[1] - term
//                      args[2] - dept
//
//              return:
//                      course page for the term/dept
//
*/
//==handle the warnings thrown from the js functions..

package MyIncorrectnessListener;

import com.gargoylesoftware.htmlunit.*;
import com.gargoylesoftware.htmlunit.html.*;

//public static class MyIncorrectnessListener implements IncorrectnessListener
public class MyIncorrectnessListener implements IncorrectnessListener
{
  @Override
 public void notify(String arg0, Object arg1)
 {
   //System.err.println("Argument : " + arg0.toString() + ", Object :");
 }
}

MycssErrorHandler test package
--------------------------------
/*
//      MycssErrorHandler.java
//
//      function handles getting the data from the sjsu course page, and returns the course page/list
//      for the given Alphabet letter. - handles ane letter at a time..
//      -the page is then returned to the calling routinne
//
//              input:
//                      args[0] - start url
//                      args[1] - term
//                      args[2] - dept
//
//              return:
//                      course page for the term/dept
//
*/
package MycssErrorHandler;

import org.w3c.css.sac.ErrorHandler;
import org.xml.sax.SAXParseException;
import com.gargoylesoftware.htmlunit.*;
import com.gargoylesoftware.htmlunit.html.*;

//==handle the warnings thrown from the js functions..
       //==handle the warnings thrown from the css functions..
//      public static class MycssErrorHandler implements DefaultCssErrorHandler
//      public static class MycssErrorHandler implements ErrorHandler
//      public class MycssErrorHandler implements ErrorHandler
       public abstract class MycssErrorHandler implements ErrorHandler
//      protected class MycssErrorHandler implements ErrorHandler
       {
         //@Override
         public void notify(String arg0, Object arg1)
         {
           //System.err.println("Argument : " + arg0.toString() + ",Object : ");
         }
         //@Override
               public void fatalError(SAXParseException ex)
               {
                       //fatals.add(ex);
               }
       }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:24:37+00:00Added an answer on May 13, 2026 at 1:24 pm

    Your java files have to be in a directory that matches their package names, so you have to place
    MyIncorrectnessListener.java in a directory named MyIncorrectnessListener, MycssErrorHandler.java in a directory named MycssErrorHandler and so on.

    You could place them all in the same directory, but you have to remove the ‘package’ statement in the files.

    The error you’re getting is because you’re only giving a package name in the import statement. You should import something specific, or everything, from a package. Change it to

    import MyIncorrectnessListener.MyIncorrectnessListener;
    

    or

    import MyIncorrectnessListener.*;
    

    Or if you don’t place your files in any packages, you don’t need any import statements.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 319k
  • Answers 319k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Try specifying the datatype in the post call like this:… May 14, 2026 at 12:04 am
  • Editorial Team
    Editorial Team added an answer Alright, I found a solution. I had to use a… May 14, 2026 at 12:04 am
  • Editorial Team
    Editorial Team added an answer You could do it like that: table PageContent ----------------- varchar(10)… May 14, 2026 at 12:04 am

Related Questions

I'm using Ant and mxmlc to compile ActionScript classes and MXML into swfs, while
Coming from this question , I have a wxComboCtrl with a custom popup made
So I've just started playing around with Django and I decided to give it
I'm trying to write code that will load an image from a resource, and
I have an application which needs to be able to write to Any User/Current

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.