JSP & User Package

Hi guys, I've a problem using a package built by me in a jsp file...
I've copied the jar file pack.jar in the WEB-INF\lib dir, and when I try to import the file with <%@ page import="pack.db.*" %> it don't give to me any error, but if I write: ServerMySql server = new ServerMySql(url, db_name, user, pass); t give to me this error:
An error occurred at line: 3 in the jsp file: /login.jsp
Generated servlet error:
ServerMySql cannot be resolved (or is not a valid type) for the field login_jsp.server
An error occurred at line: 3 in the jsp file: /login.jsp
Generated servlet error:
ServerMySql cannot be resolved or is not a typeWhat can I do?

You have a class pack.db.ServerMySql (exact spelling)
It is bundled in your file pack.jar, in an appropriate folder within the zip file?
ie if you expand the zip file it produces the structure pack/db/ServerMySql.classYes
Also do you have the MySQL driver in the web-inf/lib directory?I don't think that it could make my application not to work, but I've done it too
You did restart your app server after deploying the jar file into the lib directory?Yes, I've tryed to restart my computer too...

Similar Messages

  • SYSDBA - problem with viewing other users package body texts on sys account

    Hi,
    SQL Dev 1.0.0.15.27 has problem with correct display of other users package body texts on sys account. All bodies have "create or replace" text instead of all pck. bodies text.
    I guest it's problem with SYSDBA role. On system account text is displayed correctly. Quest SQL Navigator 5.x has no problem with this. Any ideas ?
    Regards,
    MM

    Hi Everyone,
    Just so I can close the case on this issue, although I was successful in
    using CSS to resolve the issue, actually, the issue was not really
    resolved. There was (for me) still the problem of rollover images not
    working in IE, and if I were ever to get another good night's sleep, I
    would need to resolve it -- so I did. Recall me saying earlier about the
    sizes being brought in to the javascript code by Dreamweaver? The original
    issue with having the size of the small image in the code caused the code
    to see the larger image as small also! However, when I deleted those size
    attributes' numbers, I failed to delete the words "width" and "height"
    along with the double quotes following each. So, while the other browsers
    ignored these "blank" attributes within these double quotes, IE apparently
    didn't, reading these "blank" values as some very small value, thus
    displaying the image in the absolutely smallest size possible! Wow! When I
    removed these two blank attributes, my problem went away! Live and learn!
    So, to all who were desperately trying to assist me, please accept my
    deepest and most sincere apologies. All the while I was blaming IE, I was
    the guilty one!!! Shame on me, and thanks for the wonderful responses I
    received from the Dreamweaver forum team. I will go and stand in the corner
    for 8 hours with my dunce cap on...
    Joe Dardard

  • Newly created user packages with no admin rights

    Hi all,
    Have already opened a ticket with Novell on this one as i've never seen it before...
    Have upgraded a site to ZFD7 SP1 IR2 using the iso's from the Novell site, so it's a full upgrade install, everything went perfectly on the server, consoleone snapins upgraded fine and all
    however, if I try and create a user package with consoleone from the server, it hangs and never completes and I end up with packages with no rights for any users, so i'm unable to edit, delete or do anything with them
    also tried using a workstation with IR4 snapins which gives the same result, using a spare consoleone with earlier zfd7 snapins I can create packages with no issues
    Anyone run into this before and will we be able to get rid of these objects from the tree?
    And are the IR4 snapins not compatable with IR2?

    gleach1,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • User Package in JSP

    hi All,
    i m developing one application in which i have to create one package
    and import tht in JSP bt i gives
    package XYZ does not exist.
    and if i m using tht package with java application it runs perfectly
    i dnt understand y this is heppning.
    plz help.
    Thanks in advance

    This is Main Error Code
    C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\jsp-examples\org\apache\jsp\Dgft\verify_jsp.java:15: package XYZ does not exist
    import XYZ.*;
    ^
    C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\jsp-examples\org\apache\jsp\Dgft\verify_jsp.java:110: cannot find symbol
    symbol  : class ABC
    location: class org.apache.jsp.Dgft.verify_jsp
    ABC ver=new ABC();
    ^
    An error occurred at line: 32 in the jsp file: /Dgft/verify.jsp
    Generated servlet error:
    C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\jsp-examples\org\apache\jsp\Dgft\verify_jsp.java:110: cannot find symbol
    symbol  : class ABC
    location: class org.apache.jsp.Dgft.verify_jsp
    ABC ver=new ABC();
                         ^

  • Jsp import package error after upgrading to jdk1.4.2_08 and tomcat 5.0

    I am trying to upgrade the jdk and tomcat from 1.3/3.3 to 1.4/5.0.
    My jsp imports worked fine prior to the upgrade, but now I get the following:
    Jun 6, 2005 10:01:17 AM org.apache.jasper.compiler.Compiler generateClass
    SEVERE: Error compiling file: /C:/Tomcat/work/Catalina/localhost/Print//org/apac
    he/jsp\BillingPrompt_jsp.java [javac] Compiling 1 source file
    C:\Tomcat\work\Catalina\localhost\Print\org\apache\jsp\BillingPrompt_jsp.java:11
    : package com.adware.print.database.inquire does not exist
    import com.adware.print.database.inquire.*;
    ^
    1 error
    A fatal error has occured for user: Unable to compile class for JSP
    Generated servlet error:
    C:\Tomcat\work\Catalina\localhost\Print\org\apache\jsp\BillingPrompt_jsp.java:11
    : package com.adware.print.database.inquire does not exist
    import com.adware.print.database.inquire.*;
    The package in the import statement "import com.adware.print.database.inquire.*" actually has no classes in it. The classes are contained in "import com.adware.print.database.inquire.controller.*". If I change the import statement everything works. The problem is that I have 100s of jsps. If there is a work-around outside of changing the import statements, that would be best.
    Can anyone help? Thanks.

    do you know what url is being looked up? the message is complaining that the url is starting with the string "an]", which seems pretty bogus.

  • Unable to compile class for JSP.       package not found

    Hello folks,
    I was trying to build a simple web application using Eclipse IDE, tomcat 5.x server and ant to build and deploy the application.
    I referenced the following tutorial:
    http://www.onjava.com/pub/a/onjava/2003/01/08/tomcat4.html
    I was able to create a war file, deploy it in tomcat. When i invoke a simple jsp it works fine. However if I try to import any source pkg into jsp it throws error. Below is stack trace.
    org.apache.jasper.JasperException: Unable to compile class for JSP
    Generated servlet error:
    C:\tomcat\work\Catalina\localhost\aweb\org\apache\jsp\web\Home_jsp.java:6:
    package com.ak.test does not exist
    import com.ak.test.*;
    ^
    1 error
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
         org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056)
         org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:261)
         org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:994)
         org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelativeForward(TilesRequestProcessor.java:343)
         org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:553)
         org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:211)
         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
         org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Any clue what is the issue?

    Additional Info:
    Location of files
    ==================
    My jsp file is located at:
    C:\eclipse\workspace\aweb\web\Home.jsp
    my class is located in:
    C:\eclipse\workspace\aweb\WEB-INF\classes\com\ak\test
    Webapplication Dir Structure:C:\eclipse\workspace:
    aweb(webapplication name)
    +web
    -----+Home.jsp
    +src
    ------+com.ak.test.MyJava.java
    +WEB-INF
    ------+Classes
    --------+com.ak.test.MyJava.class
    ------+lib
    ----------struts.jar
    ------+web.xml
    ------+struts-config.xml
    -aweb.war(build.xml creates war file as per WAR format)
    Ant task which installs the webapplication in Tomcat:
    <target name="install" description="Installs the Web Application" depends="package">
    <echo message="Installing ${app.name} ..."/>
    <install url="${manager.url}" username="${username}" password="${password}" path="/${app.name}"
    config="file:${basedir}/war/META-INF/context.xml" war="file:${basedir}/${app.name}.war"/>
    </target>
    build.properties file
    app.name=aweb
    manager.url=http://localhost:8080/manager
    tomcat.home=C:/tomcat
    username=user
    password=user
    Contents of the jsp file
    =======================
    <%@ page import="com.ak.test.MyJava" %>
    <html>
    <head>
    <title>Home Page</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    </body>
    </html>

  • Eclipse JSP .war package

    Hi,
    I have developed a JSP app, which uses a couple of external jars. While developing this app, I simply copied the external jars into the shared/lib directory of Tomcat.
    Now I want to package and distribute this app as a .war file, as Eclipse has an easy utility for creating the .war file.
    Is there an way of including the external jar files with my .war package, or do i have to tell each user to copy the external jars into the shared/lib directory of Tomcat???
    Thanks in advance,
    Aidan

    U need MyEclipse plugin for eclipse for J2EE projects which is available at
    http://www.myeclipseide.com/
    You can create a war file aswell using ANT build scripts...I dont have that at the moment

  • Found ORA-20072: insufficient privileges when run user package

    We use workspace manager
    enable version table : FEED_ADMIN.FEED_SET
    login with my username : KTEERAYUT that have dba privilege
    If we run dbms_wm in sqlplus. It work properly.
    KTEERAYUT@BKKXE > BEGIN
    2 dbms_wm.Beginresolve('D_1_1');
    3 dbms_wm.resolveconflicts('D_1_1','FEED_ADMIN.FEED_SET','','PARENT');
    4 COMMIT;
    5 dbms_wm.rollbackresolve('D_1_1');
    6 COMMIT;
    7 END;
    PL/SQL procedure successfully completed.
    Then try create as procedure with FEED_ADMIN owner.
    create procedure feed_admin.test_resolveconflicts_wm(p_workspace_name varchar2)
    as
    begin
    dbms_wm.Beginresolve(p_workspace);
    dbms_wm.resolveconflicts(p_workspace,'FEED_ADMIN.FEED_SET','','PARENT');
    COMMIT;
    dbms_wm.rollbackresolve(p_workspace);
    COMMIT;
    END;
    Then test run with KTEERAYUT
    KTEERAYUT@BKKXE > BEGIN
    2 feed_admin.test_resolveconflicts_wm('D_1_1');
    3 end;
    4 /
    begin
    ERROR at line 1:
    ORA-20072: insufficient privileges on 'FEED_ADMIN.FEED_SET'
    ORA-06512: at "WMSYS.LT", line 8615
    ORA-06512: at "FEED_ADMIN.TEST_RESOLVECONFLICTS_WM", line 5
    ORA-06512: at line 2
    I already grant all on FEED_ADMIN.FEED_SET to KTEERAYUT but it's still error.
    Anyway It work properly if connect and execute with FEED_ADMIN.
    So Can I run the package with another username? Which privilege that it's required?

    Hi Ben,
    Thanks for reply. Version of workspace manager is 10.2.0.4.4 on oracle 10.2.0.4 platform is window server 2003 sp2
    Below is more detail.
    1. Grant workspace manager privs to both user (KTEERAYUT also have dba privs)
    GRANT EXECUTE ON dbms_lock TO feed_admin;
    GRANT ROLE WM_ADMIN_ROLE TO feed_admin;
    GRANT SELECT ON DBA_WORKSPACE_SESSIONS TO feed_admin;
    begin
    dbms_wm.grantSystemPriv (
    'ACCESS_ANY_WORKSPACE, ' ||
    'MERGE_ANY_WORKSPACE, ' ||
    'CREATE_ANY_WORKSPACE, ' ||
    'REMOVE_ANY_WORKSPACE, ' ||
    'ROLLBACK_ANY_WORKSPACE',
    'feed_admin',
    'YES');
    END;
    GRANT EXECUTE ON dbms_lock TO KTEERAYUT;
    GRANT ROLE WM_ADMIN_ROLE TO KTEERAYUT;
    GRANT SELECT ON DBA_WORKSPACE_SESSIONS TO KTEERAYUT;
    begin
    dbms_wm.grantSystemPriv (
    'ACCESS_ANY_WORKSPACE, ' ||
    'MERGE_ANY_WORKSPACE, ' ||
    'CREATE_ANY_WORKSPACE, ' ||
    'REMOVE_ANY_WORKSPACE, ' ||
    'ROLLBACK_ANY_WORKSPACE',
    'apex',
    'YES');
    END;
    2. FEED_ADMIN create table FEED_SET and enable version for FEED_ADMIN.FEED_SET
    CREATE TABLE feed_admin.feed_set
    (feed_set_id NUMBER PRIMARY KEY,
    feed_set_name VARCHAR2(30)
    GRANT ALL ON feed_admin.feed_set TO kteerayut;
    BEGIN
    dbms_wm.enableversioning('feed_set','VIEW_WO_OVERWRITE');
    END;
    SELECT * FROM ALL_WM_VERSIONED_TABLES;
    INSERT INTO feed_admin.feed_set
    VALUES (1,'new feed set');
    COMMIT;
    3. KTEERAYUT create workspace name : WORK
    BEGIN
    dbms_wm.gotoworkspace('LIVE');
         COMMIT;
         dbms_wm.createworkspace('WORK_TEST');
         dbms_wm.gotoworkspace('WORK_TEST');
         COMMIT;
    END;
    SELECT * FROM feed_admin.feed_set;
    FEED_SET_ID FEED_SET_NAME
    1 new feed set
    4. FEED_ADMIN create procedure name : TEST_REFRESH and grant execute privs to KTEERAYUT
    create or replace procedure FEED_ADMIN.Test_refresh is
    BEGIN
    dbms_wm.Beginresolve('WORK');
    dbms_wm.resolveconflicts('WORK','feed_admin.feed_set','','PARENT');
    COMMIT;
    dbms_wm.Commitresolve('WORK');
    COMMIT;
    dbms_wm.refreshworkspace('WORK');
    end Test_refresh;
    GRANT EXECUTE ON Test_refresh TO KTEERAYUT;
    5. Login with KTEERAYUT.
    5.1 test directly command via sql*plus
    BEGIN
    dbms_wm.Beginresolve('WORK');
    dbms_wm.resolveconflicts('WORK','feed_admin.feed_set','','PARENT');
    COMMIT;
    dbms_wm.Commitresolve('WORK');
    COMMIT;
    dbms_wm.refreshworkspace('WORK');
    END;
    PL/SQL procedure successfully completed.
    5.2 but it will fail when call via procedure
    BEGIN
    feed_admin.Test_refresh;
    END;
    ERROR at line 1:
    ORA-20072: insufficient privileges on 'FEED_ADMIN.FEED_SET'
    ORA-06512: at "WMSYS.LT", line 8615
    ORA-06512: at "FEED_ADMIN.TEST_REFRESH", line 4
    ORA-06512: at line 2
    Regards.

  • SGD V4.5  JSP User load balancing

    We are using the JSP load balancing as follows, we are in a round robin DNS environment , looking for user persistance.
    // ** List of SGD servers
    hosts = "https://mydomain.com"
    // List of SGD servers to be used as potential targets (both modes)
    hosts[0] = "https://eastserver1.com"
    hosts[1] = "https://eastserver2.com"
    hosts[2] = "https://westserver1.com"
    hosts[3] = "https://westserver2.com"
    // ** External name of this server (when in Round Robin DNS or Load Balancer Mode only)
    // set to null if not using this mode
    //var LBHOST = null // Not in Load Balancer/Round Robin DNS mode
    var LBHOST = "https://eastserver1.com" // LB mode ==> the host this config file is on.
    We are running into intermittent issue of no login screen coming up when using the high level DNS name, ie mydomain.com, just the sgd splash showing trying/selecting host:eastserver1.com
    Your thoughts are appreciated.

    You could read
    https://blog.uvm.edu/jgm/2013/09/26/app-v-5-server-f5-load-balancers-and-kerberos/
    https://blog.uvm.edu/jgm/2013/09/27/app-v-server-configuration-load-balanced-configuration/
    http://social.technet.microsoft.com/Forums/en-US/2b39e2b8-aba1-4e96-b18f-c5bcb9f12687/load-balancing-two-appv-50-servers-the-publishing-service-is-not-able-to-contact-the-management?forum=mdopappv
    http://www.thinclient.net/blog/?p=344
    In fact I'm not sure if any of these really helps you, but they give some good advice
    Falko
    Twitter
    @kirk_tn   |   Blog
    kirxblog   |   Web
    kirx.org   |   Fireside
    appvbook.com

  • JSP and package deployment problem in Tomcat 5

    Hi,
    I tried very simple exercise that includes JSP and javabean (from package), but I have the following error:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error ()
    that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: -1 in the jsp file: null
    Generated servlet error:
    [javac] Compiling 1 source file
    [javac] C:\jwsdp\work\Catalina\localhost\exercises\org\apache\jsp\ex01\ex01_jsp.java:10:
    package pack01 does not exist
    [javac] import pack01.ex01;
    [javac] ^
    Bellow are all my sources
    1. directory structure
    ========================
    C:\jwsdp\webapps\exercises
    index.html
    C:\jwsdp\webapps\exercises\ex01
    build.bat
    ex01.jsp
    C:\jwsdp\webapps\exercises\ex01\WEB-INF
    web.xml
    C:\jwsdp\webapps\exercises\ex01\WEB-INF\classes
    C:\jwsdp\webapps\exercises\ex01\WEB-INF\classes\pack01
    ex01.class
    ex01.java
    C:\jwsdp\webapps\exercises\ex01\WEB-INF\lib
    pack01.jar
    2. sources
    ==========
    << ex01.jsp >>
    <HTML> <HEAD> <TITLE>Ex01</TITLE> </HEAD>
    <BODY>
    <FORM METHOD="GET" ACTION="ex01.jsp">
    <%@ page import = "pack01.ex01" %>
    <H2>Ex01</H2>
    <jsp:useBean id = "x" class = "ex01" scope="application"/>
    </FORM>
    </BODY> </HTML>
    << ex01.java >>
    package pack01;
    import java.io.*;
    public class ex01 implements Serializable {
    private String value;
    public ex01() {
    value = "EX01";
    public void setValue(String s) {
    value = s;
    public String getValue() {
    return value;
    << build.bat >>
    cd WEB-INF\classes\
    cd
    del ex01.jar
    javac -deprecation -verbose pack01\ex01.java
    jar cvf ..\lib\pack01.jar pack01\ex01.class
    << C:\jwsdp\webapps\exercises.xml >>
    <Context className="org.apache.catalina.core.StandardContext"
         cachingAllowed="true"
         charsetMapperClass="org.apache.catalina.util.CharsetMapper"
         configFile="webapps\exercises.xml"
         cookies="true"
         crossContext="false"
         debug="0"
         displayName="Exercises"
         docBase="C:\jwsdp\webapps\exercises"
         domain="Catalina"
         engineName="Catalina"
         j2EEApplication="none"
         j2EEServer="none"
         lazy="true"
         mapperClass="org.apache.catalina.core.StandardContextMapper"
         path="/exercises"
         privileged="false"
         reloadable="true"
         startupTime="30"
         swallowOutput="true"
         useNaming="true"
         wrapperClass="org.apache.catalina.core.StandardWrapper" >
    </Context>
    What is wrong ?
    I have Windows NT and Tomcat 5 (from jwsdp 1.2).
    Thank you,
    Alex.

    I just tried to reproduce the problem with old version of Tomcat (4.0.2) and ... it works. It is definitely specific for Tomcat 5 (or may be one of the late Tomcat 4 as well). There is another related difference:
    With Tomcat 4 I could create javabean in class subdirectory (default package) and use
    <%@ page import="ex01" %>
    Now with Tomcat 5 I have syntax error in this line.
    This syntax error disappeared when I moved javabean into package pack01.

  • How to set Tomcat's JSP compilation package

    Is it possible to configure what root package name Tomcat uses when creating .java files from JSPs? I've searched Google, this forum, and the Tomcat JSP documentation (http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jasper-howto.html) and cannot find any indication that it is. I found the description of all the JSP compiler servlet options, both in web.xml and on the Jakarta site, but it doesn't list any option for this. I know it's possible with Ant's JSPC task, so it's tempting to think the same can be done with Jasper, but maybe not.

    You're running Jasper by running "jspc.bat" (or "jspc.sh") from Tomcat's bin directory, yes?
    If so, it's
    jspc.bar -p <package> ...
    Usage: jspc <options> [--] <jsp files>
    where jsp files is any number of:
        <file>         A file to be parsed as a jsp page
        -webapp <dir>  A directory containing a web-app, all jsp pages
                       will recursivly be parsed
    where options include:
        -q          Quite mode (same as -v0)
        -v[#]       Verbose mode (optional number is level, default is 2)
        -d <dir>    Output Directory
        -dd <dir>   Literal Output Directory.  (package dirs will not be made)
        -l          Outputs the name of the JSP page upon failure
        -s          Outputs the name of the JSP page upon success
        -p <name>   Name of target package
        -c <name>   Name of target class name
                    (only applies to first JSP page)
        -mapped     Generate separate write() calls for each HTML line in the JSP
        -die[#]     Generate an error return code (#) on fatal errors.
                    If the number is absent or unparsable it defaults to 1.
        -uribase <dir>  The uri directory compilations shoule be relative to
                        (Default is "/")
        -uriroot <dir>  The root directory that uri files should be resolved
                        against, (Default is the directory jspc is invoked from)
        -webinc <file>  Creates partial servlet mapings for the -webapp option
        -webxml <file>  Creates a complete web.xml when using the -webapp option.
        -ieplugin <clsid>  Java Plugin classid for Internet Explorer
        -sax2 <driverclassname>  Driver class name for the SAX 2.0 parser to be used

  • Where should an user package be stored ?

    Suppose I create a package
    package MyPackage;
    public class MyClass {
    How can I compile MyClass so it is placed in the appropriate
    package directory structure and make the new class available
    to the compiler and the interpreter ?
    Thank you,
    Hung Vo.

    Suppose I create a package
    package MyPackage;
    public class MyClass {
    How can I compile MyClass so it is placed in the
    appropriate
    package directory structure and make the new class
    available
    to the compiler and the interpreter ?
    Thank you,
    Hung Vo.(This is for windows. Make appropriate changes for other environments)
    1. Make a directory MyPackage
    2. Copy MyClass.java to MyPackage
    3. compile as javac MyPackage\MyClass.java
    4. In order to make this class available set root directory of MyPackage in classpath. for eg if you created directory with c:\test\MyPackage and copied MyClass.java so that the path is
    c:\test\MyPackage\MyClass.java then
    set CLASSPATH=c:\test;%CLASSPATH%
    javac c:\test\MyPackage\MyClass.java
    Now you are ready to use MyClass.class ( But remember the class must be referred to as MyPackage.MyClass )

  • Textpad user package does not exist ( classpath, autoexec)

    hi,
    I have searched 6 ways of sunday on this little fiasco...
    can you help me sort this out...please..
    I have added to my autoexec.bat
    classpath=c:\jDevl;.;
    my directory structure is
    C:\jDevl\Junk1
    \Date.java
    \Car.java
    \soldcar.java
    //code for Car.java below
    package CarPkg;
    import DatePkg.*; //also tried import junk1.DatePkg, etc...
    public class Car
    {�.
    When I compile Car.java, with textpad, I get the following error:
    C:\jDevl\junk1\Car.java:3: package DatePkg does not exist
    import DatePkg.*;
    here is my Date.java code:
    package DatePkg;
    public class Date
    which compiled fine�.

    oo...
    changed directory structure to:
    c:\jDevl\junk1\CarsPkg\Car.java
    c:\jDevl\junk1\DatePkg\Date.java << compiled ok
    c:\jDevl\junk1\DatePkg\Date.class
    c:\jDevl\junk1\SoldCar.java <<this class extends Car
    I removed my CLASSPATH statement from autoexec.bat
    because it seems to make no diff.
    it was: CLASSPATH=C:\jDevl;.;
    ** i understand the concept that path only picks up .exe files
    & i understand that classpath says where my packages are but...
    it didnt seem to make any difference... i will pass along a heavy book you can throw at me (lol).
    my Date class compiled fine� Date.class exists. in correct dir.
    package DatePkg;
    public class Date
    in my Car.java file, I have tried various versions of
    using the import statement, ALL DatePkg imports have failed.
    C:\jDevl\junk1\CarPkg\Car.java:4: package DatePkg does not exist
    import DatePkg.*;
    package CarPkg;
    //import jDevl.junk1.DatePkg.*;
    //import DatePkg.*;
    import junk1.DatePkg.*;
    public class Car
    cant compile this till I get CarPkg sorted!!
    //import CarPkg.*;
    //import DatePkg.*;
    public class SoldCar extends Car
    1. i guess i should add classpath back in, if so, how far do i reference the classpath? C:\jDevl or C:\jDevl\junk1
    2. am i doing anything else wrong..?
    your assistance appreciated.

  • "invalid name pattern"  when trying to user packaged TYPE

    Hi,
    I have problem with creating ArrayDescriptor instance of packaged DB TYPE.
    There is declared TYPE
       type OBJ_ARRAY_TYPE is table of number(30)
    in a DB package specification,
    when i try to create description through jdbc, it fails on "java.sql.SQLException: invalid name pattern: PKG_NAME.OBJ_ARRAY_TYPE":
       desc = ArrayDescriptor.createDescriptor ("PKG_NAME.OBJ_ARRAY_TYPE", conn);
    When OBJ_ARRAY_TYPE defined globally, outside the package, everything works fine. Is it limitation of JDBC(classes12.jar)/OracleDB9i not to allow using packaged types?
    Thx for any suggestion.

    I have same hiccup with 10g JDBC Driver (ojdbc14.jar) and 9i Database.
    Test Case: Create the package with the type and a procedure that use this type as OUT parameter. Create a java application to invoke this procedure and consume the type.
    Steps:
    Create following package.
    CREATE OR REPLACE PACKAGE test_type AS
      type avarchartabletype IS TABLE OF VARCHAR2(256) INDEX BY binary_integer;
      PROCEDURE getvcttdata(avcttdata OUT avarchartabletype,   irows IN OUT INTEGER);
    END test_type;
    CREATE OR REPLACE PACKAGE BODY test_type AS
      PROCEDURE getvcttdata(avcttdata OUT avarchartabletype,   irows IN OUT INTEGER) AS
      BEGIN
        FOR i IN 1 .. irows
        LOOP
          avcttdata(i) := 'Yo ' || i;
        END LOOP;
      END getvcttdata;
    END test_type;2. Try to execute the above procedure using following Java code:-
    public class TestType {
         public static void main(String[] args) throws Exception {
              java.sql.DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
              java.sql.Connection con = java.sql.DriverManager.getConnection(args[0],
                        args[1], args[2]);
              oracle.jdbc.driver.OracleCallableStatement stmt = (oracle.jdbc.driver.OracleCallableStatement) con
                        .prepareCall("call Test_Type.getVCTTData(?,?)");
               stmt.registerOutParameter(1, oracle.jdbc.driver.OracleTypes.ARRAY,
                        "test_type.avarchartabletype");
              stmt.registerOutParameter(2, oracle.jdbc.driver.OracleTypes.INTEGER);
              stmt.executeUpdate();
              // Get the ARRAY object and print the meta data assosiated with it
              oracle.sql.ARRAY simpleArray = stmt.getARRAY(1);
              System.out.println("SQLTypeName=" + simpleArray.getSQLTypeName());
              System.out.println("BaseType=" + simpleArray.getBaseType());
              System.out.println("length=" + simpleArray.length());
              String[] values = (String[]) simpleArray.getArray();
              for (int i = 0; i < values.length; i++) {
                   System.out.println("row[" + i + "]=" + values[i] + "<BR>");
              stmt.close();
              con.close();
    Result:
    Exception in thread "main" java.sql.SQLException: invalid name pattern: test_type.avarchartabletype
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
         at oracle.jdbc.oracore.OracleTypeADT.initMetadata(OracleTypeADT.java:463)
         at oracle.jdbc.oracore.OracleTypeADT.init(OracleTypeADT.java:362)
         at oracle.sql.ArrayDescriptor.initPickler(ArrayDescriptor.java:1756)
         at oracle.sql.ArrayDescriptor.<init>(ArrayDescriptor.java:272)
         at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:196)
         at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:165)
         at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:150)
         at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:115)
         at oracle.jdbc.driver.NamedTypeAccessor.otypeFromName(NamedTypeAccessor.java:71)
         at oracle.jdbc.driver.TypeAccessor.initMetadata(TypeAccessor.java:79)
         at oracle.jdbc.driver.T4CCallableStatement.allocateAccessor(T4CCallableStatement.java:630)
         at oracle.jdbc.driver.OracleCallableStatement.registerOutParameterInternal(OracleCallableStatement.java:133)
         at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:179)
         at TestType.main(TestType.java:32)
    This works fine when execute as PL/SQL using following snippet.
    declare
      thepage   Test_Type.aVarCharTableType;
      irows     integer       := 10;
      cl        clob;
      begin
      Test_Type.getVCTTData(thepage, irows);
       for i in 1 .. irows
       loop
         cl := thepage (i);
         dbms_output.PUT_LINE(cl);
       end loop;
    end;Message was edited by:
    bonjonbovi

  • Drop user package using Unix script

    Hi,
    When I run this script, I get an error :
    #!/bin/ksh
    echo
    echo '==== DROP AND RE-CREATE ALL TEST PACKAGES ===='
    echo '# After executing this script with 'y' option execute test.sql'
    echo
    echo 'Do you want to drop and re-create test packages ? (y/n)'
    echo '# rtrvCondTest.pkb'
    echo '# ex2_test3.pkb'
    read ans
    if [[ "$ans" = "y" ]]; then
      echo 'Rebuilding all.... '
      sqlplus -s / <<-eof
      set heading off
      set echo off
      set serveroutput on
      DROP PACKAGE rtrvCondTest
      DROP PACKAGE ex2_test3
      START rtrvCondTest.pkb
      START ex2_test3.pkb
      eof
    fi
    exit 0$ ./rebuildAll.ks
    ==== DROP AND RE-CREATE ALL TEST PACKAGES ====
    # After executing this script with y option execute test.sql
    Do you want to drop and re-create test packages ? (y/n)
    # rtrvCondTest.pkb
    # ex2_test3.pkb
    n
    ./rebuildAll.ks[10]: syntax error at line 13 : `<<' unmatched
    How do I get this script to work??
    Any help is appreciated.
    Thanks
    Sharath

    there should be no space left to eof
    Regards
    Laurent Schneider
    OCM-DBA

Maybe you are looking for

  • Can i open a file created in Keynote 6.0 in Keynote 5.0.3?

    Can i open a file created in Keynote 6.0 in Keynote 5.0?

  • How do I recover lost files off my external WD Passport hard drive with Time Machine?

    I have been backing up my Macbook Pro with Time Machine and my Western Digital Passport since May 2010. I accidentally deleted my music in February of 2011, but had backed it up with Time Machine. Now when I try to go back and recover the files in Ti

  • Error launching default browser

    I had downloaded and installed the trial versions of PSE 12 and PRE 12 in late November, 2013. Purchased both December 23, 2013 and downloaded both. Did not realize I could just enter the new product codes, and instead re-installed both. All seems to

  • Copy actions from CS4 to CS5

    Can't find out how to copy my own default actions from CS4 to CS5. I have found something called "imported" actions in CS4 and copied those - which worked - but I have other default actions that I cannot find out to copy from CS4 to CS5.

  • ITune crashes when importing .mov files

    I have a few mov files on the desktop and dragged them to iTune library. iTune shut down without warning. I also tried importing it by selecting File>Import, but this did the same thing. Any suggestions? MacBook   Mac OS X (10.4.6)   Returning to Mac