Package/Classpath problem with 1.4

I've two classes. one class has a package structure and other does not. when i try to compile the class (having package structure) which has a reference to other class (which doesn't have package structure), I get error "cannot resolve symbol"
eg.
package com.hamilsci;
public class A {
public A() {
B obj = new B();
class A is in dir /usr/local/java/examples
public class B {
public B() { }
class B is in dir /usr/local/java/helperclasses and doesnot have package structure
When I tried to compile A without the package statement, everything works fine. But when I add package structure to Class A, I cannot compile . The error Message is :cannot resolve symbol
symbol : class B
location: class com.hamilsci.A
B obj = new B();
^
I'm using JDK1.4 and I've tried setting the CLASSPATH.
Any help would be highly appreciated.
-Thanks
-Mike

Here's a tutorial on packages.
http://java.sun.com/docs/books/tutorial/java/interpack/packages.html
If you have a class with "package com.hamilsci" it must be in a directory named hamilsci, hamilsci must be in a directory named com, and com must be in a directory that is in your classpath.

Similar Messages

  • Classpath problems with JMF

    Hi all,
    I'm trying to develop a simple application using JMF; I've problems importing classes from javax.media package. Problem with my application is that when I explicitly specify classpath as a command line argument to javac my application compiles; but if I use CLASSPATH environment variable it doesn't. Here's the output:
    situ@situ-desktop:~/myjava/media$ cat First.java
    import javax.media.*;
    public class First{
    situ@situ-desktop:~/myjava/media$ echo $CLASSPATH
    /home/situ/jmf/JMF-2.1.1e/lib/jmf.jar:/home/situ/jmf/JMF-2.1.1e/lib/sound.jar:.:
    situ@situ-desktop:~/myjava/media$ javac First.java
    First.java:1: package javax.media does not exist
    import javax.media.*;
    ^
    1 error
    situ@situ-desktop:~/myjava/media$ javac -classpath /home/situ/jmf/JMF-2.1.1e/lib/jmf.jar First.java
    situ@situ-desktop:~/myjava/media$
    Thanks.

    According to the documentation, it wants you to set two environmental variables, JMFHOME and CLASSPATH. And it wants the CLASSPATH to be relative to that JMFHOME variable.
    Try this.
    setenv JMFHOME /home/someuser/JMF2.1.1
    setenv CLASSPATH $JMFHOME/lib/jmf.jar:.:${CLASSPATH}

  • Package execution problem with SQLSERVERAGENT

    Hello,
    I'm having a problem with the execution of SSIS packages: I created locally a package with SQL Server Data Tools, then I deployed it on my server in the SSISDB database. Then I created a job to execute periodically this package with SQL Server Agent. The
    package works fine and does everything I want, but I always get a failed notification. In the global view of the execution I can see:
    Result: "failed"
    Package name: "Package.dtsx"
    Task name: "Package"
    Execution access path: "\Package"
    Every other task returns a success and their execution access path is a subfolder of "\Package". I tried everything I found on the web, check the "Runtime 32bits" box, create a "Job Account" user to execute the package via a
    "Job Account Proxy", modify the ProtectionLevel of the package to "DontSaveSensitive", give the "Job Account" user full rights on everything, nothing works.
    Do you have an idea of what my problem is and how to solve it?
    I must precise that all my packages do the same thing: I have a loop on all the csv files in a folder that for each file loads the contents of the file in my database and the delete the file. I observed that the error message do not appear when there is
    no file in the folder when the package executes.
    Thanks in advance.

    Not sure what error message, is the one "est introuvable.
    Cette erreur est retournée par la collection Connections lorsque l'élément de connexion spécifique est introuvable"?
    So, here is in short: the ForEach Loop once in its beginning of operation "senses" the files currently present in the working folder. If a new file arrives after this stage, it will not see it.
    In your case it seems that the ForEach "saw" a file at the beginning, but it was gone at the time the processing wanted it for execution.
    Like many above indicated, the common practice, call
    it elegant or not is to indeed move the files to a different directory (working folder). This is done to avoid collisions with some other activity in that folder.
    Furthermore, you can have all the files deleted using a ForEach against the working folder as say in
    http://beyondrelational.com/modules/2/blogs/88/posts/10178/ssis-delete-files-from-specified-folder-using-file-system-task-in-sql-server.aspx And there is no need to delete the working folder
    itself.
    The job is run in SQL Server's Agent
    need to be set to run using a domain proxy account as it needs write access to the file system.
    Arthur My Blog

  • CLASSPATH problem with Application Server 8.2

    Hello everyone.
    i am new to using the App server 8.2 for deploying a web application. we decided to use it because we were having too many problems with Web Server.
    We successfully deployed the application and it runs. however, when accessing a page with database connectivity, we get the following error:
    =================================================
    com.sun.rave.web.ui.appbase.ApplicationException: javax.servlet.ServletException: java.lang.RuntimeException: java.sql.SQLException: Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : com.sun.sql.datasource.DriverAdapter
         com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.destroy(ViewHandlerImpl.java:601)
         com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:316)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:221)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         sun.reflect.GeneratedMethodAccessor261.invoke(Unknown Source)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:585)
         org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
         java.security.AccessController.doPrivileged(Native Method)
         javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
         org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
         java.security.AccessController.doPrivileged(Native Method)
         com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:194)
    =================================================
    I don't really know what that means but it looks like i need to set some sort of classpath properties. under web server 6.1, the classpath settings were those of the server's JAR file path.
    i used Studio creator's remote deployment tool to deploy to AppSvr8.2.
    i followed the tutorial step by step.
    can someone please help me

    i did what you suggested and now i get a different error: Connection could not be allocated because: com.sun.sql.jdbc.oracle.OracleDriver
    see page below:
    ================================================
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    com.sun.rave.web.ui.appbase.ApplicationException: javax.servlet.ServletException: java.lang.RuntimeException: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: com.sun.sql.jdbc.oracle.OracleDriver
         com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.destroy(ViewHandlerImpl.java:601)
         com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:316)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:221)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:585)
         org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
         java.security.AccessController.doPrivileged(Native Method)
         javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
         org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
         java.security.AccessController.doPrivileged(Native Method)
         com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:194)
    ================================================
    thank you so much for all your help thus far!!

  • Package permissions problem with Snow Leopard

    Under Leopard, changing permissions at the Get Info window for a package file also changes the package contents to the same permission settings. This no longer works in Snow Leopard. For example, I have tried adding another user name with read & write privileges. The package file displays the correct setting, but all the contents of the package have the newly added user as read only. This is causing me problems with a virtual machine I want to share with other users of my computer. I also tested it with iWork (Pages) packages - in Leopard the package contents keep the r&w setting for the new user, but not in Snow Leopard. Note that for package files, there is no option to apply to contents, as is the case for folders, but it should do it automatically.
    I would be grateful if someone could verify this bug. Also, I intend to use chmod -R at the terminal, but I am not sure how to use it to add a specific user with r&w privileges, so any help appreciated.
    Many thanks
    George

    I don't believe it's ever worked you the way you describe in leopard. I just tried it on my leopard machine with an application package and changing permissions to the package itself did nothing to its contents.
    you can change permissions recursively from terminal but it's easier from GUI.
    make a folder and put the package in that folder. *DO NOT* use system created folders for this. go to the permissions panel for the folder and set permissions as you like. then click on the "gears" action button at the bottom of the "get info" popup and select "apply to enclosed items". This will change permissions recursively on everything in that folder.
    NOTE: as I said, never do it with system created folders as they often have hidden ACLs and doing so will propagate those ACLs inside.
    to give a particular user read+write right to the whole package from terminal run the following terminal command
    chmod -R +a "username allow list,addfile,search,add_subdirectory,deletechild,readattr,writeattr,
    readextattr,writeextattr,readsecurity" /path/to/package

  • MDM Business Package : Deployment problem with SDM GUI

    Dear Experts,
    I want to deploy the MDM Business Package on to the j2ee engine.However, when i go to the SDM GUI and select the first SDA(com.sap.mdm.tech.mdm4j.sda) file for deployment, it just hangs and nothing happens after that.I feel something is wrong with the SDM GUI.
    Please let me know any possible solutions/alternatives to this problem.
    Thanks,
    Karambir Singh

    Hi Karambir,
    1) Are you trying to deploy the sda from your local machine or from a network drive? If a network drive, try copying it to your local machine and then deploying it.
    2) If the SDM is connecting to a remote application server, it can sometimes take a long time to get a response.
    3) Can you deploy other deployable archives via the SDM, or is only mdm4j.sda causing a problem?
    Walter

  • Oracle package invalidate problem with the jdbcOracleConnectionCacheImpl ()

    Hi all,
    I am using the OracleConnectionCacheImpl(); to Create the Oracle connection pool (OracleConnectionCacheImpl class)
    In my application i am calling the oracle stored procs.
    (DB environment :Oracle 9i)
    to call those stored proc i used the Prepared statements.
    All the requests are calling the same java bean to invoke the same package.
    when ever the changes occured in the db level,(it means if that package is invalid. i.e when ever the db refreshes occured), all the requests are geting oracle error.
    after the oracle package become valid.. still i am geting the oracle errors.
    it should not happen, because stored proc is in valid state.
    if we restart our adapter or java service then we are geting the proper responses.
    we don't know when the db problems occurs, when it will be solve
    can any one help me to make my application stable
    kindly help me to get underastand the behaviour of our java code and the jdbc behaviour.
    if any one didn't understand the above description i can mail you the code what i am using..
    Thanks in advance
    RajThota

    A regular Oracle database environment comes with several mandatory userids. These include SYS and SYSTEM. SYS 'owns' all details of the database and SYSTEM is the 'super DBA'. These are database userids, not operating system userids.
    I suspect the repository wizard wants to access the SYSTEM userid to be able to create a new schema (equivalent to 'database' for other vendors) within the Oracle environment.
    In older versions of Oracle, the default SYSTEM password was 'MANAGER'. These days, any security conscious DBA will have changed that quickly, but ...

  • Classpath problem with properties file in jar

    Hi,
    I am seeing a classpath error for my setup, as follows...
    A defaultFieldIDs.properties exists with numerous entries:
    projectID=10630
    issueTypeID=80
    closedStatusID=6My Spring applicationContext.xml file contains the following:
    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
              <property name="locations">
                   <list>
                         <value>classpath:sqlScripts.properties</value>
                         <value>classpath:defaultFieldIDs.properties</value>
                    </list>
              </property>
              <property name="ignoreUnresolvablePlaceholders" value="false"/>
         </bean>     
    <util:map id="defaultQueryParameters">
              <entry key="projectID" value="${projectID}"/>
              <entry key="issueTypeID" value="${issueTypeID}"/>
              <entry key="closedStatusID" value="${closedStatusID}"/>
              <entry key="statusFieldName" value="${statusFieldName}"/>
              <entry key="numberOfExpenseLinesFieldID" value="${numberOfExpenseLinesFieldID}"/>
         </util:map>My compiled jar contains the above properties directory in its root directory, and is placed in the lib directory of the application
    However, when I start my application I get the following error:
    Invalid bean definition with name 'defaultQueryParameters' defined in null: Could not resolve placeholder 'projectID'
    What is going wrong here?

    Then presumably that jar file isn't in the classpath for your application. Perhaps just dropping it into the lib directory isn't sufficient.
    You didn't say anything about what kind of application it is. For web applications, all jars in the WEB-INF/lib directory are in the classpath. But you didn't say this was a web application and you didn't say you put it in the WEB-INF/lib directory. So if you don't care to put sufficient information into your posts, I recommend you read up on the rules for whatever type of application you have, in particular the rules for how to set its classpath.

  • Classpath problem with 1.3.1_05

    We are using a CM tool that uses a link based work area. When the links contain the pound sign, the JVM suddenly fails to find classes.
    myjar.jar -> /usr/local/ccmdb/Prod/st_root/cache/source/#07/13407
    CLASSPATH=myjar.jar
    java aclass
    -> this will result in a Class not found exception
    If I change the link to a path where no pound sign occurs in the path, it works.
    Is this a Bug in Java 1.3? Or is there a good reason why this does not work?
    Thanks

    I alos tested with Java 1.4.1_04 and 1.3.1_11
    It worked fine with 1.4 but not with any of the 1.3 releases. so it looks to me like a bug in 1.3....

  • Possible classpath problems with JSP

    I'm trying to run a simple jsp under ocj4 and I'm running into problems. Other jsp's run fine so I'm pretty sure everything's installed right. However, when I try and use the ConnCacheBean I get a "bean type ConnCacheBean not found error". Now the class is there under (on my system) d:\oracle\jsp\lib in osjputil.jsp. I tryed adding this manually to the -cp option of java when I run orion.jar but to no help.
    Where can I set this classpath variable (if this what's going wrong, if not what is) as I can't find anything addressing this in the documentation.
    thanks
    Jonny Wray
    null

    I've had success putting my non-JSP stuff into a simple jar file and placing it in
    j2ee/home/default-web-app/WEB-INF/lib. It seems that the engine picks up anything in that directory.
    Possibly, you will have to create this lib directory yourself.
    See if this helps.
    Cheers,
    Malte Christensen
    null

  • Package compiling problem with a filename

    The pkg contains a select statement with 5 tables in the "from" clause. The statement works fine in a script but when I attempt to compile it as a proc, I get a "PLS-00201: identifier 'TATTLE.BI_LO_CART' must be declared" error. My schema has access to the tattle schema and, as I say, it runs fine as a script. Help?

    If you have been granted permission to the TATTLE schema through a ROLE than you will NOT be able to reference that table in a stored procedure.
    You will need to be directly granted that permission from TATTLE or have TATTLE create a public synonym and grant permission to public.
    I do not fully under stand the reason why but I think it has to do with Security.
    Ed

  • Problems with packages, classpath and BouncyCastle Library

    Hi everybody!
    Shortly, after adding BC's crypto library to my MOBILE (J2ME) project, when I build it returns a NoClassDefFoundError about java.math.BigInteger class.
    Its package is the same of J2SE but is included in this library. Now, this should not be a problem, 'cause java.math.BigInteger is not included in J2ME, and library's release is (I'm sure) for J2ME...I think it's a problem of classpath but I can't find a way to go on with my project!
    Please, if anybody knows where I'm wrong let me know!!!
    ...and sorry for my bad english...;-)
    b4kk3

    I think the update is buggy. Many people (inc. me) are having problems with it. Am not able to play any songs/videos .. terrible !

  • Rather odd problem with package naming...

    Background info:
    I'm working on a web-based application, on a Tomcat server. Classes (and packages) must be in a subfolder of WEB-INF/classes of the app's root. So the packages are in WEB-INF/classes/com/<package>.
    The older packages are in com/gestion (for the package com.gestion ) and the newer ones are in com/incsolution/<various> where <various> can be either chart, util or pgm - following convention more closely.
    OK! We have a class called SqlBean in com.gestion, which starts off like so:package com.gestion;
    import java.sql.*;
    import javax.sql.*;// stock pour pooled connection c'est dans javax.sql
    import javax.naming.*;
    import java.io.*;
    public abstract class SqlBean
        ...rest of code...
    }and is used in several other objects, like TransferQBean.java, which is in the same package:
    package com.gestion;
    import java.sql.*;
    public class TransfertQBean extends SqlBean
       ...rest of code...
    }Now, i've been working (with others) on this project for 2 years now, and up until last week, there was no problem with the way things were called. Come Monday (April 11), the classes won't compile any more - gives me this error:
    classes/com/gestion/TransferQBean.java [5.1] cannot resolve symbol
    symbol : class SqlBean
    location: class com.geastion.TransferQBean
    public class TransferQBean extends SqlBean
    ....................................................................^
    Now if i add classes to com.gestion to get...
    package classes.com.gestion;
    import java.sql.*;
    public class TransfertQBean extends SqlBean
       rest of code...
    }and same for SqlBean...
    package classes.com.gestion;
    import java.sql.*;
    import javax.sql.*;// stock pour pooled connection c'est dans javax.sql
    import javax.naming.*;
    import java.io.*;
    public abstract class SqlBean
       ...rest of code...
    }...it works, but that's not how it's supposed to be. What puzzles me the most is how this came about suddenly.
    Anyone have an idea what might be causing this? AFAIK, it's abnormal...
    JH

    classes/com/gestion/TransferQBean.java [5.1] cannot resolve symbol
    symbol : class SqlBean
    location: class com.geastion.TransferQBean
    public class TransferQBean extends SqlBean
    ....................................................................^The solution to your problem is simply that your classpath is incorrect at compile-time. How you fix that depends on how you compile (from an IDE, from the command-line javac tool, etc). But whatever you do, don't make your solution depend on a system environment CLASSPATH variable.

  • Problem with package and compile

    I am new to Java. I am currently using Java in developing a simple system. However, my system need to import other external classes.
    The main problem is i dont know how to compile this file when they are in separate folder (i am using windows). Let say the main .java is in one folder and other external .java in other folders. I knew this can be done with the use of package. the problem is when i try to compile, there is a problem.
    I used to refer from the below link for many times, but still cannot get it.
    http://java.sun.com/j2se/1.3/docs/tooldocs/win32/javac.html
    can anyone provide me the most simple way of:
    1. import from external classes into my main system
    e.g: import com.jrefinery.report.Element;
    2. how to compile all .java from different directory
    3. after i compile, i need the .class files place in other directory
    advanced thanks to those who able to provide help.
    Sosan

    can anyone provide me the most simple way of:
    1. import from external classes into my main system
    e.g: import com.jrefinery.report.Element;You can use the -classpath option with javac, specifying the path of your external classes.
    javac -classpath C:/classes D:/classes
    2. how to compile all .java from different directoryYou simply indicate the path of the different sources files one after the other, like that :
    However, you really should put all your source files in the same package unsig the package instruction. All files that belong to the same package must reside in the same directory indicated by the package name. Look up some doc about the package instruction.
    javac -classpath C:/classes D:/classes C:/source/myclass.java D:/source/myClass.javaYou should put all the source files in 1 directory an compile using the * wildcard by :
    "javac C:/sources/*.java" for example
    3. after i compile, i need the .class files place in
    other directoryuse -d option with javac to specify the output directory :
    javac -classpath C:/classes D:/classes -d C:/outputdir C:/source/myclass.java D:/source/myClass.javaTo simplify things, put all source files in the same directory and put a copy of each external package you use in this directory. So you won't have to use classpath.
    I also suggest you write a .bat file to do all the operations at once, and stick with it so that each time you change something in the sources you won't have to go through all the steps.
    Beware, because path issues in java can be very tricky.

  • Hai ,problem with packages

    Hai all,
    i got a problem with user defined packages .i have one class under one package "sg.km" n the class name is kmc.class n i want to use that sg.km.kmc in some another class that is also a part of sg.km package .i hope i'll get reponses to my prob asap.
    thanks in advance
    yours
    srinu kumar reddy

    You should not need to import a class that is in the same package.
    You did not post enough information for me to give you a good answer. You should always post an error message along with any command you entered. All you said was, "i got a problem." We don't know if your problem is with compiling, running, jar file, applet, etc.
    You need to have a directory structure that matches your package. The kmc.class file a sg\km directory path. For example, c:\myjava\classes\sg\km\kmc.class. Then you need c:\myjava\classes directory in your Classpath both for compiling and running.

Maybe you are looking for

  • Ipod Shuffle wont be recognized on Itunes and wont update/restore

    Its driving me crazy. the Itunes wont recognize it because it says there is another user using the softwear and all of the other acounts are logged out. when I tried restore or update it, it tells me "Ipod service error". so bassicaly im stuck and I

  • What's wrong with this program?

    /* Daphne invests $100 at 10% simple interest. Deirdre invests $100 at 5% interest compounded annually. Write a program that finds how many years it takes for the value of Deirdre's investment to exceed the value of Daphne's investment. Aso show the

  • Motion Project Output Corruption

    Greetings all, I have created a very simple motion menu in Motion comprised of the following layers from the bottom up Background - Contains a black generated background Layer 1 - Actor 1 Layer2 - Actor2 Layer3 - Actor3 Layer4 - Title The actors drop

  • Calculate the perimeter of object in binary image how!!!!!!!

    Hi   I try to use labview to find area and perimeter of object in binary using vision function for the area the labview find it in pixel] but for   perimeter I have problem I read from ni.com vision manual this words http://zone.ni.com/reference/en-X

  • Oracle 9.2.0.5 to 10.2.0.2 error in structure upgrade

    On AIX 5.2 64bit with ECC 5.0 and Oracle 9.2.0.5 Going through guide and notes and have installed software and applied patches and intereim patches.  When doing structure upgrade with dbua, I get an error: ERROR at line 1: ORA-04063: package body "SY