Import class...please help

Hi
I am very new to java technology, so my question is very basic.
I make a servlet. I make another file in which i put a class named Queryparser used for some parsing...
When i want to call from the servlet the methods of the parsing class, (am i doing this wrong??) i make import Queryparser; When compiling i get this error: '.' expected.
What am i doing wrong????
Thanks!!!

servlet:
import QueryParser;
import java.io.*;
import java.net.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class newservlet extends HttpServlet {
the class i want to include:
public class QueryParser extends java.lang.Object {
public QueryParser() {
public String Test(String Auth) {
return "just a test";
}

Similar Messages

  • I accidently deleted my icloud a/c and lost some of my important contacts , please help me in getting them back.

    I accidently deleted my icloud a/c and lost some of my important contacts , please help me in getting them back.

    Hey ashvinee,
    Sorry to hear you're having difficulty with your contacts. We have a few articles that could resolve your issue.
    I would start here:
    iCloud: Troubleshooting iCloud Contacts
    http://support.apple.com/kb/ts3998
    Recovering iCloud or MobileMe data from iTunes backups for an iOS device
    http://support.apple.com/kb/TS4108
    This second article applies to you if:
    You want to recover your Contacts, Calendars, and Bookmarks from an iTunes iOS device backup made while using iCloud or MobileMe to update your Contacts, Calendars, and Bookmarks on your iOS device.
    You have created backups in iTunes, and you do not have or are unable to restore from an iCloud Backup. Learn more about how to restore from an iCloud Backup.
    You have lost data from the web, your iOS device, and all other synchronized clients, and you have no other usable backups to recover from.
    Cheers,
    David

  • Error in creating a process using runtime class - please help

    Hi,
    I am experimenting with the following piece of code. I tried to run it in one windows machine and it works fine. But i tried to run it in a different windows machine i get error in creating a process. The error is attached below the code. I don't understand why i couldn't create a process with the 'exec' command in the second machine. Can anyone please help?
    CODE:
    import java.io.*;
    class test{
    public static void main(String[] args){
    try{
    Runtime r = Runtime.getRuntime();
         Process p = null;
         p= r.exec("dir");
         BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
         System.out.println(br.readLine());
    catch(Exception e){e.printStackTrace();}
    ERROR (when run in the dos prompt):
    java.io.IOException: CreateProcess: dir error=2
    at java.lang.Win32Process.create(Native Method)
    at java.lang.Win32Process.<init>(Win32Process.java:63)
    at java.lang.Runtime.execInternal(Native Method)
    at java.lang.Runtime.exec(Runtime.java:550)
    at java.lang.Runtime.exec(Runtime.java:416)
    at java.lang.Runtime.exec(Runtime.java:358)
    at java.lang.Runtime.exec(Runtime.java:322)
    at test.main(test.java:16)
    thanks,
    Divya

    As much as I understand from the readings in the forums, Runtime.exec can only run commands that are in files, not native commands.
    Hmm how do I explain that again?
    Here:
    Assuming a command is an executable program
    Under the Windows operating system, many new programmers stumble upon Runtime.exec() when trying to use it for nonexecutable commands like dir and copy. Subsequently, they run into Runtime.exec()'s third pitfall. Listing 4.4 demonstrates exactly that:
    Listing 4.4 BadExecWinDir.java
    import java.util.*;
    import java.io.*;
    public class BadExecWinDir
    public static void main(String args[])
    try
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec("dir");
    InputStream stdin = proc.getInputStream();
    InputStreamReader isr = new InputStreamReader(stdin);
    BufferedReader br = new BufferedReader(isr);
    String line = null;
    System.out.println("<OUTPUT>");
    while ( (line = br.readLine()) != null)
    System.out.println(line);
    System.out.println("</OUTPUT>");
    int exitVal = proc.waitFor();
    System.out.println("Process exitValue: " + exitVal);
    } catch (Throwable t)
    t.printStackTrace();
    A run of BadExecWinDir produces:
    E:\classes\com\javaworld\jpitfalls\article2>java BadExecWinDir
    java.io.IOException: CreateProcess: dir error=2
    at java.lang.Win32Process.create(Native Method)
    at java.lang.Win32Process.<init>(Unknown Source)
    at java.lang.Runtime.execInternal(Native Method)
    at java.lang.Runtime.exec(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at BadExecWinDir.main(BadExecWinDir.java:12)
    As stated earlier, the error value of 2 means "file not found," which, in this case, means that the executable named dir.exe could not be found. That's because the directory command is part of the Windows command interpreter and not a separate executable. To run the Windows command interpreter, execute either command.com or cmd.exe, depending on the Windows operating system you use. Listing 4.5 runs a copy of the Windows command interpreter and then executes the user-supplied command (e.g., dir).
    Taken from:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • JWindow class please help me

    sir<br>
    i design a splash window by the use of JWindow class
    i use the following constructor
    public class splash extends JWindow
    //get content pane and set by the setContentPane method
    and add the three panels in it.
    One JPanel have a JTextField
    but JTextField is not accept the input or focus
    means i try to write text in it but it not work
    the code as follows
    //Create Jwindow
    import javax.swing.*;
    import java.awt.*;
    public class SplashScreen extends JWindow
    public static void main(String args[])
    new SplashScreen().setVisible(true);
    //define Variables
    Toolkit tk=Toolkit.getDefaultToolkit();
    Container cp=getContentPane();
    SplashScreenPanel1 p1;
    SplashScreenPanel2 p2;
    SplashScreenPanel3 p3;
    SplashScreen()
    Dimension d=tk.getScreenSize();
    p1=new SplashScreenPanel1(d.getWidth(),d.getHeight());
    p2=new SplashScreenPanel2(d.getWidth(),d.getHeight());
    p3=new SplashScreenPanel3(d.getWidth(),d.getHeight());
    this.setSize(d);
    this.setContentPane(cp);
    this.getContentPane().setLayout(null);
    cp.setBackground(new Color(47,168,122));
    p1.setBounds(new Rectangle(0,(int)(d.getHeight()-100),(int)d.getWidth(),100));
    p2.setBounds(new Rectangle(0,0,(int)d.getWidth(),100));
    p3.setBounds(new Rectangle(0,100,(int)(d.getWidth()),400));
    this.getContentPane().add(p1);
    this.getContentPane().add(p2);
    this.getContentPane().add(p3);
    p1.b1.requestFocus();
    }//end of spalshscreen
    create JPanel
    public class spashscreenpanel3 extends JPanel
    JTextField t=new JTextField();
    splashscreenpanel3
    this.setSize(200,100);
    this.setLayout(null);
    t.setBounds(10,20,100,20);
    this.add(t);
    }//end of JPanel
    Please help me i am very thankful to u

    Some helpful information is here:
    http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html
    import javax.swing.*;
    import java.awt.*;
    public class hamad extends JFrame
      public static void main(String args[]) 
        new hamad();
      //define Variables
      SplashScreenPanel1 p1;
      SplashScreenPanel2 p2;
      SplashScreenPanel3 p3;
      JWindow window;
      public hamad()
        createWindow(this);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setSize(300,200);
        setLocation(500,300);
        setVisible(true);
      private void createWindow(JFrame frameReference) {
        window = new JWindow(frameReference);
        Toolkit tk = Toolkit.getDefaultToolkit();
        Dimension d=tk.getScreenSize();
        p1=new SplashScreenPanel1();
        p2=new SplashScreenPanel2();
        p3=new SplashScreenPanel3();
        window.getContentPane().add(p1, "North");
        window.getContentPane().add(p2, "Center");
        window.getContentPane().add(p3, "South");
        window.setSize(d.width/4, d.width/4);
        window.setLocation(100,100);
        window.setVisible(true);
      private class SplashScreenPanel1 extends JPanel
        JTextField field;
        public SplashScreenPanel1()
          setBackground(new Color(200,150,190));
          setPreferredSize(new Dimension(100,50));
          field = new JTextField();
          field.setPreferredSize(new Dimension(100, 20));
          add(field);
      private class SplashScreenPanel2 extends JPanel
        JTextField field;
        public SplashScreenPanel2()
          setBackground(new Color(220,90,180));
          field = new JTextField();
          field.setPreferredSize(new Dimension(75,20));
          add(field);
      //create JPanel
      private class SplashScreenPanel3 extends JPanel
        JTextField t=new JTextField();
        public SplashScreenPanel3()
          setBackground(Color.pink);
          setPreferredSize(new Dimension(100,50));
          setLayout(null);
          t.setBounds(10,20,100,20);
          add(t);
      }//end of JPanel
    }//end of spalshscreen

  • What am i doing wrong with this class please help

    What am i doing wrong with this class? I'm trying to create a JFrame with a JTextArea and a ScrollPane so that text can be inserted into the text area. however evertime i run the program i cannot see the textarea but only the scrollpane. please help.
    import java.io.*;
    import java.util.*;
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class Instructions extends JFrame{
    public JTextArea textArea;
    private String s;
    private JScrollPane scrollPane;
    public Instructions(){
    super();
    textArea = new JTextArea();
    s = "Select a station and then\nadd\n";
    textArea.append(s);
    textArea.setEditable(true);
    scrollPane = new JScrollPane(textArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    this.getContentPane().add(textArea);
    this.getContentPane().add(scrollPane);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    this.setTitle("Instructions");
    this.setSize(400,400);
    this.setVisible(true);
    }//end constructor
    public static void main(String args[]){
    new Instructions();
    }//end class

    I'm just winging this so it might be wrong:
    import java.io.*;
    import java.util.*;
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class Instructions extends JFrame{
    public JTextArea textArea;
    private String s;
    private JScrollPane scrollPane;
    public Instructions(){
    super();
    textArea = new JTextArea();
    s = "Select a station and then\nadd\n";
    textArea.append(s);
    textArea.setEditable(true);
    scrollPane = new JScrollPane(textArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    // Here you already have textArea in scrollPane so no need to put it in
    // content pane, just put scrollPane in ContentPane.
    // think of it as containers within containers
    // when you try to put them both in at ContentPane level it will use
    // it's layout manager to put them in there side by side or something
    // so just leave this out this.getContentPane().add(textArea);
    this.getContentPane().add(scrollPane);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    this.setTitle("Instructions");
    this.setSize(400,400);
    this.setVisible(true);
    }//end constructor
    public static void main(String args[]){
    new Instructions();
    }//end class

  • Import problems please help

    Hello,
    Really thick intern looking for help would be eternally gratefull.I'm an Irish student in France working on a webservices project
    >
    so my current problem is as follows:
    >
    I'm trying to run a simple web service so I've sucessfully downloaded
    tomact and apache axis and they're installed and working well. I've
    deployed a webserice jws?wsdl all well and good but I'cant get the client
    to work this is the code I have so far, problem with the imports please help...
    Using linux mandrake 9.0
    and the free version of JBuilder8 from borlands site
    tomcat4.0.6
    axis-1_1RC2
    ������������������������������������������������������������������
    import org.apache.axis.client.Service;
    import org.apache.axis.utils.Options;
    import javax.xml.rpc.namespace.QName;
    import java.net.*;
    public class HelloWorldClient
    public static void main(String args []) throws Exception
    Service service = new Service();
    Call call = (Call)service.createCall();
    String endpoint = "http://localhost:8080/axis/HelloWorld.jws";
    call.setTargetEndpointAddress(new java.net.URL(endpoint));
    call.setPoerationName(new QName("getHelloWorld"));
    String output = (String)call.invoke(new object[]{});
    System.out.println("Got result : " + output);
    }It's recognising the imports and is giving me the following error message:
    Sorry about the French
    "HelloWorldClient.java" : Erreur No : 302 : classe
    org.apache.axis.client.Service non accessible ; java.io.IOException:
    classe
    introuvable : classe org.apache.axis.client.Service en ligne 3, colonne
    31
    "HelloWorldClient.java" : Erreur No : 302 : classe
    org.apache.axis.utils.Options non accessible ; java.io.IOException: classe
    introuvable : classe org.apache.axis.utils.Options en ligne 4, colonne 30
    "HelloWorldClient.java" : Erreur No : 302 : classe
    javax.xml.rpc.namespace.QName non accessible ; java.io.IOException: classe
    introuvable : classe javax.xml.rpc.namespace.QName en ligne 5, colonne 32
    "HelloWorldClient.java" : Erreur No : 300 : classe Service introuvable
    dans classe HelloWorldClient en ligne 17, colonne 5
    "HelloWorldClient.java" : Erreur No : 300 : classe Service introuvable
    dans classe HelloWorldClient en ligne 17, colonne 27
    "HelloWorldClient.java" : Erreur No : 300 : classe Call introuvable dans
    classe HelloWorldClient en ligne 18, colonne 5
    "HelloWorldClient.java" : Erreur No : 300 : classe Call introuvable dans
    classe HelloWorldClient en ligne 18, colonne 18
    "HelloWorldClient.java" : Erreur No : 300 : classe QName introuvable dans
    classe HelloWorldClient en ligne 22, colonne 31"HelloWorldClient.java" : Erreur No : 300 : classe object introuvable
    dans
    classe HelloWorldClient en ligne 23, colonne 45
    I'm a real novice to computing so I'd be gratefull if you could help me and give me the most simplistic instructions possible
    Thanks for reading this at least!

    You may want to check to see if you have your class path set properly.

  • Error during import. Please HELP!

    Hello All,
    We want to export / import some page groups and are faced with the following situation.
    We were able to get the transport set of the page group from the source and create the dmp file using the command:
    File.cmd -mode export -s portal -p <portal_schema_pwd> -c iasdb -d pqr.dmp
    We also created the transport set in the target system by executing the command:
    File.cmd -mode export -s portal -p <portal_schema_pwd> -c iasdb -d pqr.dmp -pu <portal-user id> -pp <portal password>
    Browsing through to see the transport sets, we could see the status of the created transport set to be "EXTRACT_COMPLETE"
    But when we tried to import it, the status changes to MERGE_FAILED and the log shows: MAPPING NOT FOUND AT PAGE ID:xxxx SITE ID:yyyy.     
    We are not using any web providers. All are DB providers. Our page groups do not share any object. And we are using release 9.0.2 .
    Someone must have come across this error. Please help.
    Abhilash Vantaram

    Dude, you really should only post in one of the forums. No need to put this in Portal-General, Application Server - General AND Portal Import/Export. Just about everyone who answers goes to all of these anyway. See the Portal-General forum - I posted a response there.

  • NewInstance from variable class(Please Help)

    I want to generate an object from xml
    example :
    <com.toto.titi.variable>
         <name>tata</name>
         <age>20</age>
    </com.toto.titi.variable>
    my java code :
    str = "com.toto.titi.variable" ;
    int idx0 = str.lastIndexOf(".");
    String testObj = str.substring(idx0+1);
    Class cls = Class.forName(str);
    o_ = (testObj)cls.newInstance(); //testObj it's variable, i dont now origin class or Interface
    this code is not work
    Please help
    Thanks

    do a search on here for "beanbox"....that shows how to do object persistence and creation using xml.

  • HT1386 Trying to Sync - Unable to load data class - please help

    I just cleared my I-Pod Touch to put new music on it and my computer is prompting the following. "I-Tunes was unable to load data class information from sync sevices." Reconnect of try again later. Another prompt that keeps appearing is  "the application apple mobile device help quit unexpectedly." Please help me...

    Apple Mobile Device Restart. Disable all security software ex. Firewalls and Antivirus. Follow article http://support.apple.com/kb/TS1567  . The above listed article is correct by lllaass. I resolve it by unchecking the different categories in itunes sync pages... Plug in device, click on name on left side of itunes, Click on different sync pages like summary, info, music, movies, etc. You need to uncheck the main check box to sync content. An example would be unchecking "Sync Music" . You will then need to sync once for each category until you locate the source of your corrupt files or folders. Syncing without it checked removes content from device. Follow this step even if there is nothing on the device. Once you identify if it is picture or music etc. you will need to delete corrupt files or move them somewhere else on the computer so itunes can't find it anymore.

  • Importing problem - please help

    Hi!
    I have a problem with importing images:
    when importing to stage a picture (bmp;jpg;etc.) to a new
    flash document
    I only see the frame but not the picture. when importing to
    an existing .fla
    though ( from flash samples) it shows the pic itself in the
    layer.
    please help me!

    make sure the Layer Outlines is not selected. You may be just
    seeing the outline of the layer and
    not the entire contents.
    ~~~~~~~~~~~~~~~~
    --> Adobe Certified Expert
    --> www.mudbubble.com
    --> www.keyframer.com
    ~~~~~~~~~~~~~~~~
    roi gavish wrote:
    > Hi!
    > I have a problem with importing images:
    > when importing to stage a picture (bmp;jpg;etc.) to a
    new flash document
    > I only see the frame but not the picture. when importing
    to an existing .fla
    > though ( from flash samples) it shows the pic itself in
    the layer.
    > please help me!
    >

  • Accessing a thread from a main class, please help!

    Hi, I have a thread, T1, that I need to access from my main class. I cannot use runnable, it's got to be done with extands thread. I can start it alright, but I cannot stop it;
    MAIN CLASS
    public class Uppgift1 {
    public static void main(String args[]) throws InterruptedException {
    // Start Thread 1
         Thread trad1 = new T1( );
         trad1.start( );
         //Wait for 5 seconds
         Thread.sleep(5000);
         //Stop the Thread
         trad1.stopIt();
    public class T1 extends Thread {
         boolean go = true;
    public void run ( ) {
    while(go){
         System.out.println("T1: Trad 1");
    try{
    Thread.sleep(1000);
    } catch( InterruptedException e ) {
    public void stopIt(){
    go = false;
    Why can't I run stopIt from my main class?
    Please help me.

    manswide wrote:
    The reason I have to use Thread is that it's for a school thing; I guess I gotta learn to do it the bad way in order to learn why to love the good way later on.Good plan. Making mistakes is a fantastic learning tool
    How do I declare a reference to my own class?
    T1 t1 = new T1();

  • Calling an instance of a class please help

    Hi all,
    I hope this is the right forum to post this topic.I am doing so cause I am dealing with servlets.In the init() method of a servlet.I want to call an instance of another class UserPresent.java .I will post the code below
    public void init() {
    UserPresent userpresent = new UserPresent();
    userpresent.initDatabase();
    }The compiler keeps complaining saying that .......
    AuthenticateServlet21.java:12: cannot resolve symbol
    symbol : class UserPresent
    location: class package1.structure.AuthenticateServlet21
    UserPresent userpresent = new UserPresent();
    I have included the package package1.structure in both the servlet code and the UserPresent code.
    Kindly let me know what could be the problem.
    Help would be appreciated
    Thanks
    AS

    The compiler can't find the UserPresent class in your servlet.
    You may need to import it ie import package1.structure.UserPresent
    What package is the UserPresent class in? What package is your servlet in? Is your class public?

  • Importing classes to help applets - professionals

    I am creating a applet that calls a additional .class that acts as a gatewat between the applet and a servlet(applet -> class -> servlet)
    Inside the applet how I can make the 'import' statement for a file that is in the same directory of the applet????
    Just typing import myclass; doesnt work

    "expected '.' "
    import Myclass;
    ^
    There must have some kind of java.localdir.myclass
    or something

  • Nikon 610 Raw files can not be imported. Please help (JPEG files work) Version 5.2

    I just purchased Lightroom Version 5.2 and cannot import the *.NEF files.  Very frustrated. Can anyone help?

    You should be able to download the latest version of L5.x from
    Adobe - Lightroom : For Macintosh
    Adobe - Lightroom : For Windows

  • Oc4j startup classes - please help!

    I am trying to create a startup class for my Oc4j container. I have created a new class with all the required code. However when I come to update my server.xml config file like so:
    <startup-classes>
    <startup-class classname="MyStartupClass" failure-is-fatal="true">
    <execution-order>0</execution-order>
    </startup-class>
    </startup-classes>
    The container on initialisation says that the class cannot be found. I have also tried giving the fully qualified package name as the class name i.e. com.blah.blahh.MyStartupClass. However still no success.
    Anyone know why this is happening and how I can get the container to find my startup class?

    make a jar of ur classes and put it in(u can put single class also)
    jdev--\j2ee\home\applib
    put this line in the server.xml file
    <init-library path="../applib" />
    try this...
    Hope this helps
    N@vin

  • 2 or 3 tracks per CD never import properly, please help!

    Hi anyone,
    Well, as the title suggests, there are always a few tracks that don't import properly on almost every CD I try to import. The first track nearly always comes up as 0 seconds, then a few others will only half import. I have i-tunes 6.0, all the CD's are originals, not copies, and I have tried altering all the importing settings. It's really annoying me so if anyone could help it'd be greatly appreciated! Here are some more details that might help:
    CD Diagnostics:
    Microsoft Windows XP Home Edition Service Pack 2 (Build 2600)
    Higraded 10215570 AWRDACPI
    iTunes 6.0.1.3
    CD Driver 2.0.4.3
    CD Driver DLL 2.0.3.2
    UpperFilters: GEARAspiWDM (2.0.4.3),
    Video Driver: NVIDIA GeForce4 MX 4000 (Microsoft Corporation)\GeForce4 MX 4000
    IDE\DiskHDS722580VLSA80_______________________V32OA63A, Bus Type ATA, Bus Address [0,0]
    USBSTOR\DiskApple__iPod____________1.62IDECdRomNU_CDRW/DVD_DBW-521_____________________G302___, Bus Type ATA, Bus Address [0,0]
    If you have multiple drives on the same IDE or SCSI bus, these drives may interfere with each other.
    Some computers need an update to the ATA or IDE bus driver, or Intel chipset. If iTunes has problems recognizing CDs or hanging or crashing while importing or burning CDs, check the support site for the manufacturer of your computer or motherboard.
    Current user is administrator.
    E: NU CDRW/DVD DBW-521, Rev G302
    Audio CD in drive.
    Found 20 songs on CD, playing time 75:05 on Audio CD.
    Track 1, start time 00:02:00
    Track 2, start time 03:53:18
    Track 3, start time 06:25:22
    Track 4, start time 09:00:34
    Track 5, start time 12:37:57
    Track 6, start time 14:01:74
    Track 7, start time 18:39:52
    Track 8, start time 22:11:29
    Track 9, start time 27:17:51
    Track 10, start time 30:32:42
    Track 11, start time 32:43:68
    Track 12, start time 35:24:59
    Track 13, start time 39:53:28
    Track 14, start time 43:50:68
    Track 15, start time 49:10:68
    Track 16, start time 53:49:12
    Track 17, start time 57:45:53
    Track 18, start time 63:54:31
    Track 19, start time 68:43:31
    Track 20, start time 71:56:19
    Audio CD reading failed. Error Code: 1117 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.
    Get drive speed succeeded.
    The drive CDR speeds are: 52.
    The drive CDRW speeds are: 52.
    Many thanks,
    Charlie.

    Musicmatch is another player app. Still one of my favorites for it's Supper Tagging feature.
    But yeah. Try to rip the CD with Musicmatch, Winamp, or Windows Media Player. If these give different results, it'll isolate the problem to iTunes or the drive itself (assuming there aren't other hardware issues I don't know about :)).

Maybe you are looking for