Cannot find the class!! - URGENT!!!

I have an JSP archive and I�m using the Tomcat 4. I did a class named ConnectionBean that connect with a database.
when i start my JSP, the Apache server show me an error page that say it�s impossible to find the class "ConnectionBean". I tryed to put it in the same directory of the JSP file, but happened the same error.
I tryed to put it in the directory "apache tomcat 4\lib\" but i have the same error.
I tryed to put it on the directory "jre\lib\ext\ of my JVM, but i have the same error!
Please, somebody can help me to do my JSP find this class?
Thanks for all

after you compile your class you should put the .class in the WEB-INF/classes/ directory
lets suppose that you wrote in the top of your class
package com.mydbconnection
this means that your class should be in
WEB-INF/classes/com/mydbconnection/MyClass.class
in your JSP have been like this
<jsp:useBean id="DBConn" scope="page" class="com.mydbconnection.MyClass" />
hope this help enough :)

Similar Messages

  • Cannot find the class file

    Hi All,
    Can any one help me regarding the issue?
    Error:
    package com.support.misc.feedback
    I am getting the following error for the above line. But I have created the Hierarchy in folder structure. But still it is throwing the error.
    1. Cannot find the class file for com.sapportals.htmlb.page.DynPage
    2. This compilation unit indirectly references the missing type com.sapportals.htmlb.page.DynPage (typically some required class file is referencing a type outside the class path)     FeedbackBean.java
    Thanks in Advance.
    Message was edited by: Gowsika Kannan

    Hi Gowsika,
    the class needed is located in htmlb.jar which can be found under <irj-root>/WEB-INF/portal/portalapps/com.sap.portal.htmlb/lib
    You need to integrate this jar in your .classpath
    Hope this helps,
    Robert
    PS: Please do not post the same question 3 times

  • Cannot find the class file for com.sap.portal.services.api.connectorgateway

    Hi,
    I was trying the "How to BI JAVA SDK in a Portal iView and get the following error.
    The project was not built since its classpath is incomplete. Cannot find the class file for com.sap.portal.services.api.connectorgateway.IConnectorGatewayService. Fix the classpath and try rebuilding this project.
    I have the following in my portalapp.xml file
    <property name="SharingReference" value="com.sap.portal.ivs.connectorservice"/>
    and i have also added the jar file "com.sap.portal.ivs.connectorservice_api" in the set of lib's
    Has some faced a similar issue? or can someone suggest how I could possibly resolve this.
    Thanks,
    Smitha

    Hi Smitha:
       My webdynpro dc was build failed for "This compilation unit indirectly references the missing type com.sap.engine.services.webservices.espbase.client.dynamic.content.GenericObject (typically some required class file is referencing a type outside the classpath)".
    How should i do?  Thank you!

  • Cannot find the class to create it although it is there!

              Hi all,
              MyJsp.jsp file cannot find the "yy" class which I want to create in it. this file is located under weblogic\lib\cls.jar and I also tried to locate it under a directory which I define in weblogic.class.path.
              MyJsp.jsp is located under directly public_html.
              C:\weblogic\myserver\classfiles\jsp_servlet\_myjsp.java:78: Class jsp_servlet.yy not found in type declaration.
              probably occurred due to an error in /MyJsp.jsp line 13:
              <%yy myclass=(yy) request.getAttribute("z");%>
              <%String[] res=myclass.getResult();%>
              Mon Nov 13 02:36:20 PST 2000:<E> <ServletContext-General> Compilation of C:\weblogic\myserver\classfiles\jsp_servlet\_myjsp.java failed: C:\weblogic\myserver\classfiles\jsp_servlet\_myjsp.java:78:
              Class jsp_servlet.yy not found in type declaration.
              yy myclass=(yy) request.getAttribute("z"); //[ /MyJsp.jsp; Line: 13]
              ^
              C:\weblogic\myserver\classfiles\jsp_servlet\_myjsp.java:78:
              Class jsp_servlet.yy not found in type declaration.
              yy myclass=(yy) request.getAttribute("z"); //[ /MyJsp.jsp; Line: 13]
              ^
              2 errors
              Where should I locate that yy.class so that MyJsp.jsp's _myjsp.java does not look for it under its package name , just simply finds and creates it? :)
              Best regards
              jg
              

              Hi, there
              Wherever you put the class, you only set the classpath to the corresponding directory before you run your WL server. In your JSP file, set the import class tag, e.g:
              If your class directory is:
              weblogic\myserver\yy\yy.class
              you should add the directory to your classpath, and put the following tag in your jsp file:
              <%@ page language="java" import="yy" %>
              (Above assume your class has no prefix package name, or you should put full qualified class name)
              Cheers
              Oliver
              "jg" <[email protected]> wrote:
              >
              >Hi all,
              >
              >MyJsp.jsp file cannot find the "yy" class which I want to create in it. this file is located under weblogic\lib\cls.jar and I also tried to locate it under a directory which I define in weblogic.class.path.
              >MyJsp.jsp is located under directly public_html.
              >
              >C:\weblogic\myserver\classfiles\jsp_servlet\_myjsp.java:78: Class jsp_servlet.yy not found in type declaration.
              >probably occurred due to an error in /MyJsp.jsp line 13:
              ><%yy myclass=(yy) request.getAttribute("z");%>
              ><%String[] res=myclass.getResult();%>
              >
              >Mon Nov 13 02:36:20 PST 2000:<E> <ServletContext-General> Compilation of C:\weblogic\myserver\classfiles\jsp_servlet\_myjsp.java failed: C:\weblogic\myserver\classfiles\jsp_servlet\_myjsp.java:78:
              > Class jsp_servlet.yy not found in type declaration.
              > yy myclass=(yy) request.getAttribute("z"); //[ /MyJsp.jsp; Line: 13]
              > ^
              >C:\weblogic\myserver\classfiles\jsp_servlet\_myjsp.java:78:
              >Class jsp_servlet.yy not found in type declaration.
              > yy myclass=(yy) request.getAttribute("z"); //[ /MyJsp.jsp; Line: 13]
              > ^
              >2 errors
              >
              >Where should I locate that yy.class so that MyJsp.jsp's _myjsp.java does not look for it under its package name , just simply finds and creates it? :)
              >
              >Best regards
              >
              >jg
              

  • Cannot find the class file for javax.microedition.io.ContentConnection

    I've downloaded and configured eclipse j2me plugin and am having no difficulty
    creating Midlets according to the eclipse documentation
    http://eclipseme.org/docs/createProject.html
    (Also I have sun java wireless toolkit 2.5.2)
    (I have imported wtk252 in window/preferences/j2me/dev mgmt
    and added the search directory where wtk252 resides.)
    However, after importing a ready-developed project into the same workspace
    one of the pieces of code continuously gives a class not found error for
    javax.microedition.io.ContentConnection
    It's clear that one project understands how to resolve paths in
    javax.microedition
    and the other one doesn't, but I'm not sure how to configure the build path
    using
    QuickFix
    ie I don't know physically what the name of the jar file with
    javax.microedition.io.ContentConnection in it is called.

    Er, thanks, (I think!)
    Wouldn't it be easier for folks if you told them to look for packages using the CLDC Generic Connection Framework which is already inside javax.microedition.io?
    By the time they've got GCF (which is used quite a lot,) they've got javax.microedition.io and they've therefore solved the problem!
    I'd imagine that you could spend ages looking for "JSR 37 / 139" and get nowhere.

  • "Cannot find the main Class. Program will exit."

    Hi, I created a program, and I am trying to distribute it to other people in my office. I tried using both NetBeans 6.8/6.9 and eclipse. I exported to a single jar file. When I run this single .jar file, it runs perfectly. I sent it to one of my coworkers, and the message "Cannot find the main Class. Program will exit." popped up. I then had IT update his Java to 6.20 and it worked. The problem is that this program must be distributed to over 100 people, and I cannot have them each update their Java individually, nor will IT update everyone's on their own. They all have Java 4.XX I believe. Is there any way around this error that only happens on older versions of java? I have checked my manifest file and what not, as I said it runs on computers with Java 6.

    AndrewThompson64 wrote:
    Do you mean Java 1.4? It is best to be sure, so point some of the target machines at this page(1) to check.Yes, Sorry I meant 1.4.XX, I think they have 1.4.2_19.
    >
    >
    a) Ensure the code does not use functionality introduced in later versions, e.g. assertions, generics, for-each loops.. Using the [cross-compilation options of javac|http://java.sun.com/javase/6/docs/technotes/tools/windows/javac.html#crosscomp-options] will warn of those.
    b) Ensure the code does not use any classes, attributes or methods that were not available in the earlier version, then use the cross-compilation options of javac when compiling. Actually the second will alert of the first, so long as the -bootclasspath parameter is used with an appropriate rt.jar.I believe that everything is ok, unless some of the swing functions cannot be used in 1.4. Besides the swing functions (which I am not sure about) everything should be able to be used in 1.4
    Thank You

  • Oracle Access Manager Configuration : Cannot find the Person Object Class

    Hi,
    I am trying to install OAM , I am getting the following error when i am configuring the Identity server for the first time.
    1) I have installed OID. I am using one OID for both config and user data.
    2) I have installed Identity server and have modified the OID schema automically during installation.
    3) I have installed web pass.
    I have gone to the url: http://trn-ps-oid.oracle.com:7777/identity/oblix
    Here i gone to Identity System Console to configure Identity server.
    Following are the config data i have given
    Configuration DN : dc=mydomain,dc=com
    Search Base : dc=mydomain,dc=com
    Host : mypc.mydomain.com
    Port Number : 389
    Root DN : cn=orcladmin
    Root Password : *******
    Directory Server Security Mode : Open
    Is the Configuration data stored in this directory also : Yes
    Person Object Class : inetorgperson
    Auto configure objectclass : yes
    Group Object Class : groupOfUniqueNames
    Auto configure objectclass : yes
    After this I have clicked on the restart server button.
    It comes back to the page asking to enter Person Object class details.
    I Get the Error : Cannot find the Person Object Class.
    I have checked the object class in OID it is there, I have verified the connection details are also correct.
    Any Ideas what might be wrong.
    Earlier during setup i had to modify the OID schema, how do i check if this has been done.
    Any Ideas

    <?xml version="1.0" encoding="utf-8"?>
    <ValNameList
    xmlns="http://www.oblix.com"
    ListName="setup.xml">
    <NameValPair
    ParamName="mainOIS"
    Value="true"></NameValPair>
    <NameValPair
    ParamName="currentStep"
    Value="LDAP_CONFIG_CHANGES"></NameValPair>
    <NameValPair
    ParamName="status"
    Value="incomplete"></NameValPair>
    <NameValPair
    ParamName="whichDB"
    Value="OID"></NameValPair>
    <NameValPair
    ParamName="dataDirCopied"
    Value="TRUE"></NameValPair>
    <NameValPair
    ParamName="machineNo"
    Value="localhost"></NameValPair>
    <NameValPair
    ParamName="portNo"
    Value="389"></NameValPair>
    <NameValPair
    ParamName="rootDN"
    Value="cn=orcladmin,cn=Users,dc=mydomain,dc=com"></NameValPair>
    <NameValPair
    ParamName="ldapRootPasswd"
    Value="**************"></NameValPair>
    <NameValPair
    ParamName="securityMode"
    Value="Open"></NameValPair>
    <NameValPair
    ParamName="oblixUserDataSame"
    Value="Yes"></NameValPair>
    <NameValPair
    ParamName="searchBase"
    Value="dc=mydomain,dc=com"></NameValPair>
    <NameValPair
    ParamName="configDN"
    Value="dc=mydomain,dc=com"></NameValPair>
    <NameValPair
    ParamName="obClassPerson"
    Value="inetorgperson"></NameValPair>
    <NameValPair
    ParamName="defaultConfigForPersonOC"
    Value="true"></NameValPair>
    <NameValPair
    ParamName="obClassGroup"
    Value="groupOfUniqueNames"></NameValPair>
    <NameValPair
    ParamName="defaultConfigForGroupOC"
    Value="true"></NameValPair>
    <NameValPair
    ParamName="obOldClassPerson"
    Value="inetorgperson"></NameValPair>
    <NameValPair
    ParamName="obOldClassGroup"
    Value="groupOfUniqueNames"></NameValPair>
    </ValNameList>

  • URGENT! I cannot find the beginning of my recording

    I recorded an interview under voice and I had to stop the recording at 55 minutes and then start it again about 20 minutes later. I saved it and put my laptop on sleep after the first half. Now I cannot find the very beginning of my interview. All I can see is the second half of my interview which was 31 minutes and the second part of the first half of my interview. Did GB delete it? How do I find the very beginning of my recording?

    How do I prevent from recording on top of the first part of my interview? Can I add a new track within the same folder as the first part of my interview and continue to record the interview where I left off and not record over the first track?
    That is, what I am doing - I always create a second track for the next take. Then I can give the tracks different names.
    Perhaps you had the cycle region enabled? Thenn the recording will begin at the beginneing of the region. Usually the recording should start at the current position of the crosshair.

  • Error message on my development workstation: The system cannot find the file specified.

    Post Author: cseverin
    CA Forum: Crystal Reports
    Hi,
    I am currently developing an ASP.NET website using Visual Studio.NET 2005. I am using the .NET 2.0 framework, VB.NET as my programming language and I connect successfully to a SQL Server 2005 database.  I can select, insert, update and delete data from the database elsewhere in my project, so I know basic connectivity isn't an issue.  The problem seems to be with Crystal Reports. 
    I created a folder called 'Reports' in my project and added a Crystal Report file (OpenFiles.rpt) to it.  I designed the report and initally used a hard-coded SQL query as its datasource so I could quickly get the database fields onto the report and preview them.  All worked fine. 
    To make the report accessible to the rest of the website, I created an .xsd dataset file containing the three tables (and their corresponding tableadapters) that the report requires and then redeveloped the report using the dataset as the datasource for the report.  After doing this, the preview no longer worked.
    Next, I added a page to the website and dragged a Crystal Report Viewer Control onto it.  In the code behind the page I wrote:
    Option Strict On
    Imports System.Data
    Imports CrystalDecisions.CrystalReports.Engine
    Imports CrystalDecisions.Shared
    Partial Class Reports
         Inherits System.Web.UI.Page
         Private objOpenFilesreport As OpenFilesReport
         Private rptOpenFiles As ReportDocument
         Private strLastErrorMessage As String = Nothing
         Private errLastException As Exception = Nothing
         Dim strFileKey As String
         Dim strJurisdictionCode As String
         Dim strStaffId As String
         Dim strReportId As String
         Private Sub ConfigureCrystalReports()
              Dim reportPath As String = Server.MapPath("OpenFiles.rpt")
              Dim rptopenfiles As New ReportDocument
              rptOpenFiles.Load(reportPath)  <== I checked this during execution and the value correctly points to the OpenFiles.rpt file in the Reports     folder of my project
              Dim ConnectionInfo As ConnectionInfo = New ConnectionInfo()
              ConnectionInfo.DatabaseName = my database
              ConnectionInfo.UserID = login id of user
              ConnectionInfo.Password = user's password
              SetDBLogonForReport(ConnectionInfo, rptopenfiles)
              CrystalReportViewer1.ReportSource = rptopenfiles
         End Sub
         Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
             ConfigureCrystalReports()
         End Sub
         Private Sub SetDBLogonForReport(ByVal ConnectionInfo As ConnectionInfo, ByVal myReportDocument As ReportDocument)
              Dim myTables As Tables = myReportDocument.Database.Tables
              For Each myTable As CrystalDecisions.CrystalReports.Engine.Table In myTables
                   Dim myTableLogonInfo As TableLogOnInfo = myTable.LogOnInfo
                   myTableLogonInfo.ConnectionInfo = ConnectionInfo
                   myTable.ApplyLogOnInfo(myTableLogonInfo)
              Next
         End Sub
    End Class
    I added a hyperlink to one of the existing pages on the website to navigate to this page with the report viewer on it.  When I run the website in Visual Studio and click on the hyperlink I get the following:
    Server Error in '/MyTest' Application.
    The system cannot find the file specified.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: The system cannot find the file specified.Source Error:
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:
    &#91;COMException (0x80004005): The system cannot find the file specified.
    &#93;
       CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0
       CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +126
       CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +442
    &#91;Exception: Load report failed.&#93;
       CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +513
       CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +1378
       CrystalDecisions.CrystalReports.Engine.ReportDocument.EnsureLoadReport() +149
       CrystalDecisions.CrystalReports.Engine.ReportDocument.get_DataDefinition() +85
       CrystalDecisions.CrystalReports.Engine.ReportDocument.get_ParameterFields() +158
       CrystalDecisions.Web.CrystalReportSource.BindControlParameter(Parameter parameter) +130
       CrystalDecisions.Web.CrystalReportSource.DataBindParameters() +191
       CrystalDecisions.Web.CrystalReportSource.EnsureParameters(Boolean forceDataBind) +90
       CrystalDecisions.Web.CrystalReportSource.LoadCompleteEventHandler(Object sender, EventArgs e) +47
       System.Web.UI.Page.OnLoadComplete(EventArgs e) +96
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4086
    Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832 
    Any ideas, anyone?
    Also, assuming I can get past this error, I will need to figure out how to fill the tables in the .xsd dataset file.  I have written a class for the dataset that includes functions that populate the tables in the dataset from the database by executing SQL queries.  But how do I call these functions at the time the report is run?
    This is my first Crystal report written in .NET and I've been struggling with it for days now.  Any help would be most appreciated!
    Thanks very much!
    Chris Severin

    hello, the error message is obviously coming from one of the installed mcafee extensions. please directly contact mcafee technical support - they can likely give you more detailed guidance and are the only ones who can fix bugs or make necessary adjustments in the addon.

  • Java.lang.Error: java.util.zip.ZipException: The system cannot find the fil

    I got maven 221 installed
    i got jdk 1.6 and 1.5 installed (have tested both)
    I have a strange error. All my co-workers can build but I cant. The only thing I can find is that I dont have installed BEA Weblogic but I dont want to have that installed. It should be able to run anyway.
    Could someone tell me what is wrong? If you need pom.xml I got that one as well.
    process-classes:
    [copy] Copying 4 files to C:\hudson\jobs\albpm_ip-identity-asserter_-_Build\workspace\target\mbean-content
    [mkdir] Created dir: C:\hudson\jobs\albpm_ip-identity-asserter_-_Build\workspace\target\mbean-jar
    [java] Creating an MJF from the contents of directory C:\hudson\jobs\albpm_ip-identity-asserter_-_Build\workspace\target\mbean-content...
    [java] Compiling the files...
    [java] Creating the list.
    [java] Doing the compile.
    [java] WLMaker-SubProcess: : Exception in thread "main" java.lang.Error: java.util.zip.ZipException: The system cannot find the file specified
    [java] WLMaker-SubProcess: :      at weblogic.management.commo.BeanGenDriver.getManagementTempDir(BeanGenDriver.java:93)
    [java] WLMaker-SubProcess: :      at weblogic.management.commo.BeanGenDriver.main(BeanGenDriver.java:117)
    [java] WLMaker-SubProcess: : Caused by: java.util.zip.ZipException: The system cannot find the file specified
    [java] WLMaker-SubProcess: :      at java.util.zip.ZipFile.open(Native Method)
    [java] WLMaker-SubProcess: :      at java.util.zip.ZipFile.<init>(ZipFile.java:203)
    [java] WLMaker-SubProcess: :      at java.util.jar.JarFile.<init>(JarFile.java:132)
    [java] WLMaker-SubProcess: :      at java.util.jar.JarFile.<init>(JarFile.java:97)
    [java] WLMaker-SubProcess: :      at weblogic.management.commo.BeanGenDriver.getManagementTempDir(BeanGenDriver.java:90)
    [java] WLMaker-SubProcess: :      ... 1 more
    [java] WLMaker-SubProcess: : Stopped draining WLMaker-SubProcess:
    [java] WLMaker-SubProcess: : Stopped draining WLMaker-SubProcess:
    [java] BeanGen code generation failed
    [HUDSON] Archiving C:\hudson\jobs\albpm_ip-identity-asserter_-Build\workspace\pom.xml to C:\hudson\jobs\albpmip-identity-asserter_-Build\modules\dk.skat.ip.integration.albpm$ip-identity-asserter\builds\2010-11-2213-41-28\archive\dk.skat.ip.integration.albpm\ip-identity-asserter\1.2\pom.xml
    [INFO] ------------------------------------------------------------------------

    from my experience, using weblogic jars can be a pain if the full install is not on the local box.
    Note that you dont have to 'install' it. Just copy the directory.
    Reason is that the jar files have manifests with relative classpaths.
    For an example of horror take a look at the weblogic.jar MANIFEST's classpath entry.
    -Fred

  • The system cannot find the path specified - Problems

    I am having an issue that I am hoping someone can help figure out for me.
    I am currently learning Java, and am working with the Beginning Programming with Java for Dummies book second edition. I have downloaded and am running the Java 6 program and am using the JCreator 3.5Pro that was recommended to run the Practice files for the Dummies book.
    I have the practice files here:
    C/Program Files/Xinox Software/JCreatorV3/My Projects
    While trying to compile one of the practice files, I get this error message:
    --------------------Configuration: MyNewProject - JDK version 1.6.0_21 <Default> - <Default>--------------------
    javac: file not found: src_mynewproject.txt (The system cannot find the path specified)
    Process completed.
    **When I try to execute, I get this error message:**
    --------------------Configuration: MyNewProject - JDK version 1.6.0_21 <Default> - <Default>--------------------
    java.lang.NoClassDefFoundError: EchoLine
    Caused by: java.lang.ClassNotFoundException: EchoLine
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    Could not find the main class: EchoLine. Program will exit.
    Exception in thread "main"
    Process completed.
    When I set up the new file, and the new class, I confirmed the file path.
    I know most people will ask if I am absolutely certain I put in the code in properly, and yes I did. It was a matter of copying word for word, and punctuation. I did it 100% correctly. About 12 times. I have NO idea what this means, but I would REALLY REALLY appreciate any help on this.
    Please keep in mind, I am slightly clueless, and really need to have any help dumbed down a bit. Lol.
    As a side note, this isn't my first project, and I haven't had this problem before now.
    thanks in advance. =)

    So I wanted to clarify what I've done a bit more since I decided to redownload the dummies programs for the program and try again.
    I will try to list my steps in order of what I did and see if I've gone wrong somewhere along the line.
    I downloaded my project files from here: http://ca.dummies.com/store/product/Beginning-Programming-with-Java-For-Dummies-2nd-Edition.productCd-0764588745,navId-322469,descCd-DOWNLOAD.html
    I unzipped them this time here: C:\Program Files\Java\jdk1.6.0_21\MyProjects\
    I opened JCreator 3.5 and starting fresh, with all previous projects deleted and clicked on "Open Workspace". I chose "MyWorkspace.jcw". Right clicked MyWorkspace and chose "Add new Project" and then chose "Empty Project". As per the books instruction for the first project, I named it "MyFirstProject". My file path was: C:\Program Files\Java\jdk1.6.0_21\MyProjects\MyFirstProject. Which is where I upzipped the files. I added it to current workspace and clicked finish.
    I then added a new class. As per the books instructions, I right clicked "MyFirstProject" and selected Add New Class. For the name, I used MyFirstJavaClass, which is what the book told me to do. My locations are the exact same as above. and I clicked on Generate new Method, as it told me to. Which it doesn't in the next few lessons, so I know this has nothing to do with it. For that and a few other reasons. Lol.
    I clicked on Finish.
    All I had to do was replace a single line of code. Not type it all in this time.
    Here is what shows up on the screen:
    class MyFirstJavaClass {
         * Method main
         * @param args
         public static void main(String[] args) {
              // TODO: Add your code here
    I need to change the : // TODO: Add your code here
    with the line:
    System.out.println.("Chocolate, royalties, sleep");
    When I do this, and compile project, I get this:
    --------------------Configuration: MyFirstProject - JDK version 1.6.0_21 <Default> - <Default>--------------------
    javac: file not found: src_myfirstproject.txt (The system cannot find the path specified)
    Process completed.
    AGAIN! But it worked a few days ago.
    And when I execute, I get this:
    --------------------Configuration: MyFirstProject - JDK version 1.6.0_21 <Default> - <Default>--------------------
    java.lang.NoClassDefFoundError: MyFirstJavaClass
    Caused by: java.lang.ClassNotFoundException: MyFirstJavaClass
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    Could not find the main class: MyFirstJavaClass. Program will exit.
    Exception in thread "main"
    Process completed.
    I really hope the extra info helps someone help me!
    thank you!
    Edited by: MissPamela on Jul 19, 2010 3:23 PM

  • Jdev 10.1.2  JBO-33001: Cannot find the configuration file bc4j.xcfg in cla

    Hi all,
    i have a ear application containing a web app and a bc4j module deployed on the embedded oc4j instance inside JDeveloper 10.1.2 (build 1929). Inside the model i have a topic durable subscriber that, when a message is sent, invoke, by reflection, a java class to perform the job. Inside the java class i need an Application Module so i write
    ApplicationModule am = Configuration.createRootApplicationModule(fullClassName, configuration);
    but i get the error in the subject.
    Here is a piece of the stack trace
    oracle.jbo.JboException: JBO-33001: Cannot find the configuration file /it/despa
    r/orderplatform/model/services/common/bc4j.xcfg in the classpath
    at oracle.jbo.client.Configuration.loadFromClassPath(Configuration.java:
    358)
    at oracle.jbo.common.ampool.PoolMgr.createPool(PoolMgr.java:281)
    at oracle.jbo.common.ampool.PoolMgr.findPool(PoolMgr.java:482)
    at oracle.jbo.common.ampool.ContextPoolManager.findPool(ContextPoolManag
    er.java:165)
    at oracle.jbo.client.Configuration.createRootApplicationModule(Configura
    tion.java:1457)
    at oracle.jbo.client.Configuration.createRootApplicationModule(Configura
    tion.java:1435)
    at it.despar.orderplatform.task.GenericTask.getApplicationModule(Generic
    Task.java:40)
    at it.despar.orderplatform.task.trasmission.ValidateTrasmissionTask.<ini
    t>(ValidateTrasmissionTask.java:38)
    at it.despar.orderplatform.jms.utils.TaskInvoker.invoke(TaskInvoker.java
    :27)
    at it.despar.orderplatform.jms.listener.TextListener.onMessage(TextListe
    ner.java:60)
    at com.seebeyond.jms.client.STCMessageConsumer.onMessage(STCMessageConsu
    mer.java:529)
    at com.seebeyond.jms.client.STCSession.onMessage(STCSession.java:259)
    at com.seebeyond.jms.sockets.ConsumerSocket.deliverMessage(ConsumerSocke
    t.java:346)
    at com.seebeyond.jms.sockets.ThreadPerConnectionMgr$ConnThread.run(Threa
    dPerConnectionMgr.java:230)
    If i invoke the java class (the task) by command line inside jdev all works fine.
    I've read all the stuff about this exception but they do not apply to mi problem (I run the adf runtime installer, i try with an oc4j extended and standalone....)
    Please help us. Thanks
    Any ideas?
    Suggestion?

    This program is an example of basically what ADFBC will be trying to do to open/parse the bc4j.xcfg file. Can you incorporate the same lines into your test program to see if it also behaves the same in your JMS-initiated Java class ?
    Of course, you'll need to substitute "sample/common/bc4j.xcfg" with your relevant path name.
    package sample;
    import java.io.IOException;
    import oracle.xml.parser.v2.DOMParser;
    import oracle.xml.parser.v2.XMLDocument;
    import oracle.xml.parser.v2.XMLParseException;
    import org.xml.sax.SAXException;
    public class Class1 {
      public static void main(String[] args) throws XMLParseException,
                                                      SAXException, IOException {
        DOMParser d = new DOMParser();
       d.parse(Thread.currentThread().getContextClassLoader().getResource("sample/common/bc4j.xcfg"));
        XMLDocument doc = d.getDocument();
        doc.print(System.out);
    }

  • Cannot find the configuration file in classpath

    Cannot find the configuration file /oracle/apps/prc/po/....applicationModule/common/bc4j.xcfg in the classpath.
    Hi!
    I'm trying to run the following code:
    String appModule = "oracle.apps.prc.po.manageDocument.uiModel.viewDocument.applicationModule.ViewPurchasingDocumentApplicationModule";
    String cfg = "ViewPurchasingDocumentApplicationModuleLocal";
    ApplicationModule applicationModule = (ApplicationModule)Configuration.createRootApplicationModule(appModule, cfg);
    I get this error message:
    Exception in thread "main" oracle.jbo.ConfigException: JBO-33001: Cannot find the configuration file /oracle/apps/prc/po/manageDocument/uiModel/viewDocument/applicationModule/common/bc4j.xcfg in the classpath
         at oracle.jbo.client.Configuration.loadFromClassPath(Configuration.java:430)
         at oracle.jbo.common.ampool.PoolMgr.createPool(PoolMgr.java:293)
         at oracle.jbo.common.ampool.PoolMgr.findPool(PoolMgr.java:557)
         at oracle.jbo.client.Configuration.createRootApplicationModule(Configuration.java:1334)
         at oracle.jbo.client.Configuration.createRootApplicationModule(Configuration.java:1312)
         at oracle.apps.prc.po.manageDocument.model.viewPdf.generateXml.getXMLData(generateXml.java:26)
         at oracle.apps.prc.po.manageDocument.model.viewPdf.generateXml.main(generateXml.java:39)
    I have checked and the config file does exist in the correct directory, and I can see it in my Application Module - Configurations. Any idea why this is happening? Am I supposed to configure something specifically for this or add it in my classpath? If so, how am I supposed to do it?
    Thanks
    Mansi
    Edited by: Mansi G on Oct 6, 2008 11:56 AM

    Where is the code you posted? Running in a separate project, I assume? Does that project have a dependency on the project containing the app module specified?
    And just to check (although by default, JDev should do this for you)--the app module project has been compiled since adding the configuration, right? You need to check to make sure the config exists not only under Project/src, but under Project/classes.
    Edited by: Avrom Roy-Faderman on Oct 6, 2008 2:02 PM
    Oh, and BTW--I assume this is not a typical ADF application, right? In a standard ADF application, you would very rarely need to instantiate an application module in code like this; you could just let the data binding facility do it for you. The technique like the one you're using is most appropriate for purely programmatic, no-UI cases. (e.g., once I tried to implement an SMTP server backed by business components. That was an appropriate case for ditching databindings and doing the sort of thing you're doing, because it had no view layer (because it had no UI to render).

  • "The system cannot find the file specified" - error reading properties file

    I have packaged a class file and a .properties file in the same folder as a ejb-jar file and in the class file i try reading the properties file and it throws me the error - "The system cannot find the file specified". But when I put the complete path, it has no problem finding the file.
    I know that this must be the problem with classpath, but can anybody tell me why it is not finding the properties file even if they are in the same folder. How do I make class files find .properties file which are in a folder.
    Any help will be greatly appreciated.

    Hi,
    I am not sure if your question is realted to the Oracle Application Server - anyway, if you are packaging a class file and a properties file in a JAR File, you need to read the contents in a different manner...something like this... :
    URL url = new URL("jar:file:/home/duke/duke.jar!/");
    JarURLConnection jarConnection = (JarURLConnection)url.openConnection();
    You might want to have a look at this link for more information :
    http://java.sun.com/docs/books/tutorial/index.html
    You may also get better responses if you post your question in one of the Java Forums.
    Regards,
    Sandeep

  • "System cannot find the path specified" error message !HELP !

    Hi
    In doing a program to read a string from the buffer, I am getting an error message that says "cannot find the file specified"
    The file was created in a previous program and I verified it does
    exist at the specified location on my hard disk.
    Below is the "ReadAString" program and "WriteAString" program where the String was created.
    Thanks
    Joe
    import java.io.*;
    import java.nio.ByteBuffer;
    import java.nio.channels.FileChannel;
    public class ReadAString
    public static void main(String[] args)
    File myFile = new File("C:Documents and Settings/Gateway User/jbproject/ssd_ch10p407/src/ssd_ch10p407/charData.txt");
    FileInputStream myInputFileInAStream = null;
    try
    myInputFileInAStream = new FileInputStream(myFile);
    catch (FileNotFoundException e)
    e.printStackTrace();
    System.exit(1);
    FileChannel myInputChannel = myInputFileInAStream.getChannel();
    ByteBuffer myByteBuffer = ByteBuffer.allocate(48);
    System.out.println("\nNew buffer: \tposition = " +
    myByteBuffer.position() + "\tLimit = " +
    myByteBuffer.limit() + " \tcapacity = " +
    myByteBuffer.capacity());
    try
    //size() will return the length of the file
    System.out.println("\nFile contains " + myInputChannel.size() + " bytes");
    //The FileChannel object keeps track of the file's current position
    System.out.println(
    "The file's current position before the read into the buffer is: " +
    myInputChannel.position());
    while (myInputChannel.read(myByteBuffer) != -1)
    System.out.println("\nBuffer after read: \tposition = " +
    myByteBuffer.position() + "\tLimit = " +
    myByteBuffer.limit() + " \tcapacity = " +
    myByteBuffer.capacity());
    System.out.println(
    "The file's current position after it read into the buffer is: " +
    myInputChannel.position());
    System.out.println("\nString read: " +
    ( (ByteBuffer) (myByteBuffer.flip())).asCharBuffer().
    toString());
    System.out.println("Buffer after flip: \tposition = " +
    myByteBuffer.position() + "\tLimit = " +
    myByteBuffer.limit() + " \tcapacity = " +
    myByteBuffer.capacity());
    // set the limit to capacity and the position to 0
    myByteBuffer.clear(); //clear the buffer for the next read
    } //end of while loop
    System.out.println("\nEOF reached.");
    myInputFileInAStream.close(); //close the file and the channel
    catch (IOException e) {
    e.printStackTrace(System.err);
    System.exit(1);
    System.exit(0);
    import java.io.*;
    import java.nio.*;
    import java.nio.channels.FileChannel;
    //This program takes a text phrase (in Unicode characters;(2 bytes each character)
    //and puts it into a buffer via a CharBuffer,
    //then loads the buffer contents into a file channel
    //then outputs to a file.
    //When you have successfully run the program, go to Start | Search |
    //type in "charData.txt" and examine the contents of the file. OR
    //go to the notepad and open
    // C:
    //Documents and Settings
    //GateWay User
    //jbproject
    //ssd_ch10p407
    //src
    //ssd_ch10p407
    //you should see charData so right click on it and choose "open with " "Notepad"
    // and verify the contents are "Garbage in Garbage out"
    // each time you run the program, "Garbage in Garbage out " should be concatenated.
    public class WriteAString
    public static void main(String[] args)
    String phrase = new String("Garbage in Garbage out\n");
    String dirname = "C:/Documents and Settings/Gateway User/jbproject/ssd_ch10p407/src/ssd_ch10p407";
    String filename = "charData.txt";
    File dir = new File(dirname);
    //now checkout the directory
    if (!dir.exists()) {
    if (!dir.mkdir()) { //.....create it
    System.out.println("Cannot create directory: " + dirname);
    System.exit(1);
    else if (!dir.isDirectory()) {
    System.err.println(dirname + " is not a directory");
    System.exit(1);
    //create the fielstream
    File myFile = new File(dir, filename);
    FileOutputStream myOutputFileInAStream = null; //place to store the stream reference
    try
    myOutputFileInAStream = new FileOutputStream(myFile, true);
    System.out.println("File stream created successfully");
    catch (FileNotFoundException e)
    e.printStackTrace(System.err);
    ByteBuffer myByteBuffer = ByteBuffer.allocate(1024); //ByteBuffer object created
    CharBuffer myCharBuffer = myByteBuffer.asCharBuffer(); // create view buffer
    //transfer the phrase to myByteBuffer via mycharBuffer
    myCharBuffer.put(phrase);
    //update myByteBuffer limit (position times 2 because each Unicode
    // character takes 2 bytes) to store in the ByteBuffer
    myByteBuffer.limit(2 * myCharBuffer.position());
    System.out.println("myCharBuffer position is " + myCharBuffer.position());
    //create the file output stream channel object
    FileChannel myOutputChannel = myOutputFileInAStream.getChannel();
    System.out.println("new buffer: position = " +
    myByteBuffer.position() +
    "\tLimit = " + myByteBuffer.limit() +
    " \tcapacity = " + myByteBuffer.capacity());
    //each time the program is run, the phrase is again loaded into the buffer.
    // Run the program several times and open charData.txt to verify that the
    //data went into the file.
    //Load the data into the buffer
    for (int i = 0; i < phrase.length(); i++)
    myByteBuffer.putChar(phrase.charAt(i));
    System.out.println("Buffer after loading : position = " +
    myByteBuffer.position() + "\tLimit = " +
    myByteBuffer.limit() + " \tcapacity = " +
    myByteBuffer.capacity());
    myByteBuffer.flip(); //flip the buffer ready for file write
    System.out.println("Buffer after flip: position = " +
    myByteBuffer.position() + "\tLimit = " +
    myByteBuffer.limit() + " \tcapacity = " +
    myByteBuffer.capacity());
    //write this file
    try
    myOutputChannel.write(myByteBuffer); //write the buffer to the file channel
    System.out.println("The file contains " + myOutputChannel.size() + " bytes" +
    " Do you see this number double every time you run the program?");
    //you should see 48 characters writen to the file each time (phrase has 24 characters)
    myOutputFileInAStream.close(); //close the output stream and channel
    System.out.println("Buffer contents written to file");
    catch(IOException e)
    e.printStackTrace(System.err);
    System.exit(0);
    //After running the program once my output was:
    //File stream created successfully
    //myCharBuffer position is 23
    //new buffer: position = 0     Limit = 46      capacity = 1024
    //Buffer after loading : position = 46     Limit = 46      capacity = 1024
    //Buffer after flip: position = 0     Limit = 46      capacity = 1024
    //The file contains 46 bytes //Do you see this number double every time you run the program?
    //Buffer contents written to file

    Right - File is smart. Otherwise, you'd have to build
    platform-specific paths by hand, using file.seperator,
    to keep your code multi-platform. Ew.
    Grant
    IC..
    Aldaris84 bows his head in honour of the man/woman that created the clearly intelligate File class
    :)

Maybe you are looking for