Error with running a jar, but not when i run it in eclispe?

I built this program which works without any errors in eclispe, it is within a package called com.dceg.rules..
but when i packaged it into a jar, i get this error...
java.lang.ClassNotFoundException: com.dceg.rules (file:\C:\Source\dom\Validator Package\Validator.jar!\com\dceg\rules
) does not appear to be a valid package
What can be wrong?
Here is the manifest file
Manifest-Version: 1.0
Class-Path: jargs.jar log4j-1.2.13.jar dnsjava-2.0.2.jar com/dceg/rule
s/
Created-By: 1.5.0_06 (Sun Microsystems Inc.)
Main-Class: com.dceg.rules.Validator
Here is where the errors comes up from..
public void getClasses(String pckgname) throws ClassNotFoundException {
// This will hold a list of directories matching the pckgname. There may be more than one if a package is split over multiple jars/paths
ArrayList<File> directories = new ArrayList<File>();
try {
ClassLoader cld = Thread.currentThread().getContextClassLoader();
if (cld == null) {
logger.error(new ClassNotFoundException("Can't get class loader."));
String path = pckgname.replace('.', '/');
// Ask for all resources for the path
Enumeration<URL> resources = cld.getResources(path);
//System.out.println("r: "+resources.nextElement());
while (resources.hasMoreElements()) {
directories.add(new File(URLDecoder.decode(resources.nextElement().getPath(), "UTF-8")));
} catch (NullPointerException x) {
logger.error(new ClassNotFoundException(pckgname + " does not appear to be a valid package (Null pointer exception)"));
} catch (UnsupportedEncodingException encex) {
logger.error(new ClassNotFoundException(pckgname + " does not appear to be a valid package (Unsupported encoding)"));
} catch (IOException ioex) {
logger.error(new ClassNotFoundException("IOException was thrown when trying to get all resources for " + pckgname));
// For every directory identified capture all the .class files
for (File directory : directories) {
if (directory.exists()) {
// Get the list of the files contained in the package
String[] files = directory.list();
for (String file : files) {
// we are only interested in .class files
if (file.endsWith(".class")) {
// removes the .class extension
classes.put( file.substring(0, file.length() - 6) , (pckgname + '.' + file.substring(0, file.length() - 6)) );
} else {
**********throw new ClassNotFoundException(pckgname + " (" + directory.getPath() + ") does not appear to be a valid package");******* <-- error here
Message was edited by:
hamham3001

Heres the code again.. looks better now
public void getClasses(String pckgname) throws ClassNotFoundException {
        // This will hold a list of directories matching the pckgname. There may be more than one if a package is split over multiple jars/paths
          ArrayList<File> directories = new ArrayList<File>();
        try {
            ClassLoader cld = Thread.currentThread().getContextClassLoader();
            if (cld == null) {
                 logger.error(new ClassNotFoundException("Can't get class loader."));
            String path = pckgname.replace('.', '/');
            // Ask for all resources for the path
            Enumeration<URL> resources = cld.getResources(path);
            //System.out.println("r: "+resources.nextElement());
            while (resources.hasMoreElements()) {
                directories.add(new File(URLDecoder.decode(resources.nextElement().getPath(), "UTF-8")));
        } catch (NullPointerException x) {
             logger.error(new ClassNotFoundException(pckgname + " does not appear to be a valid package (Null pointer exception)"));
        } catch (UnsupportedEncodingException encex) {
             logger.error(new ClassNotFoundException(pckgname + " does not appear to be a valid package (Unsupported encoding)"));
        } catch (IOException ioex) {
             logger.error(new ClassNotFoundException("IOException was thrown when trying to get all resources for " + pckgname));
        // For every directory identified capture all the .class files
        for (File directory : directories) {
            if (directory.exists()) {
                // Get the list of the files contained in the package
                String[] files = directory.list();
                for (String file : files) {
                    // we are only interested in .class files
                    if (file.endsWith(".class")) {
                        // removes the .class extension
                        classes.put( file.substring(0, file.length() - 6) , (pckgname + '.' + file.substring(0, file.length() - 6)) );
            } else {
                throw new ClassNotFoundException(pckgname + " (" + directory.getPath() + ") does not appear to be a valid package");
    }

Similar Messages

  • Captivate 3 shows skin in preview but not when I run after published?

    Captivate 3 shows skin in preview but not when I run after published.  It shows it is included, what's up?

    Is the Skin externalised?  If so, perhaps Flash Global Security is interfering:
    http://www.infosemantics.com.au/adobe-captivate-troubleshooting/how-to-set-up-flash-global -security
    You could also try NOT externalising the skin.

  • RPC Error in ISE but not when I run manually in console

    I'm having a very strange issue. I developed a function that invokes SCCM Machine policy refresh on a remote computer:
    Function Refresh-SCCMMachinePolicy {
    param($computer = $null)
    $ms = new-object system.management.managementscope
    $ms.path = “\\$computer\root\CCM”
    $mc = New-Object System.Management.ManagementClass($ms , ‘sms_client’,$null)
    $mc.invokeMethod(‘TriggerSchedule’,'{00000000-0000-0000-0000-000000000021}’)
    Write-Host "Machine policy refreshed on $computer" -foregroundcolor yellow
    I set the $computer to a machine name and run these line by line from the console and it works but if I try to run the following in ISE it gives me an RPC error...:
    Import-Module 'smodule.psm1'
    Import-Module 'ConfigurationManager.psd1'
    $computers = get-cmcollectionmembership -CollectionName 'Test'
    foreach ($computer in $computers)
    Refresh-SCCMMachinePolicy -computer $computer
    Remove-Module 'smodule'
    Remove-Module 'ConfigurationManager'
    I get this error:
    The following exception occurred while retrieving member "invokeMethod": "The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)"
    At smodule.psm1:74 char:5
    +     $mc.invokeMethod(‘TriggerSchedule’,'{00000000-0000-0000-0000-000000000021}’)
    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], ExtendedTypeSystemException
        + FullyQualifiedErrorId : CatchFromBaseGetMember
    The function above is loaded from smodule.psm1 file.
    I also have tried saving the ISE script above as a PS1 file and running it from the console but I get the same error. Both machines have executionPolicy set to bypass.
    I have tried many different Firewall configurations to no avail as well. Not sure it would be a firewall issue anyway as it works from the console... Am I missing something?
    Thanks!
    Tony

    Oddly enough, now after I fixed the quotes, it gives me the error in the console too...
    I know it was working before because I was watching the SCCM logs on the client and when I would run it, the appropriate logs would start updating...
    Update: opened a console window with Admin credentials and it worked...
    Yep, you'll need to run elevated.
    Don't retire TechNet! -
    (Don't give up yet - 12,950+ strong and growing)

  • Internet freezes with Safari, Firefox & Chrome, but not when using MS IE

    When using my macbook wirelessly and am in the Mac OS, my internet freezes after 5 minutes, doesn't matter if I am using Safari, Firefox or Chrome. If I shut down and boot up Windows XP and use IE, it does not freeze up. I use my iMac with the same router wirelessly and never have any issues with Sarari... Can anyone suggest what I should try? I have removed and reloaded Safari, Firefox and just tried Chrome, with the issue still happening...
    Thanks,

    The web sites visited are pretty much the same on either the iMac or MacBook. These are well known sites for the most part. I always keep updates current with any of the software I use including Adobe...

  • Jar runs from Dos prompt, but not when double clicked.

    Hello everyone,
    My executable jar file will run fine when called from the Dos prompt like so: java -jar myJarFile.jar
    But not when I double click it. I've associated *.jar files with java.exe as suggested here on the forums but all that happens when I double click the jar file is that I get an instance of the Dos prompt that flashes up on the screen and closes immediately. Any help or suggestions would be appreciated, thank you.
    This short tutorial I found earlier may be of help to somebody.
    http://www.cs.princeton.edu/introcs/85application/jar/jar.html

    Yes Carmello, I had associated jar files via folder options in windows explorer with java.exe, now when I have the jars associated with javaw.exe as in the following:
    ACTION:
    javaw.exe -jar "%1"
    APPLICATION USED TO PERFORM ACTION:
    javaw.exe "%1"
    I get an error dialog with the title string "Java Virtual Machine Launcher" and the error message itself is "Could not find the main class. Program will exit." when I double click on the jar file. As I said in my first post the application [GUI based with around ten different forms] runs fine when called from the Dos prompt. Any idea as to what is wrong? Thanks for replying by the way.

  • My iPhone 3G charges with a charger, but not when connected via USB to my computer and iTunes doesn't recognize it.

    Hello, my iPhone charges when I charge it with the wall plug but not when connected to a computer via USB and my iTunes doesn't recognize my iPhone either. iTunes recognizes my iPod and iPad just fine. I have been to Apple iPhone support page and I have restarted my iPhone, the computer, tried different USB ports, etc. I have also tried my iPhone on different macs even with different versions of iTunes and no luck. This all started when I was cleaning out some lint from the usb connector, could I have damaged some part of the docking connection? But why does it charge with a wall plug then?

    I fixed the problem. When I was trying to clean the connector of the iPhone I must have bent some pins. I have straightened them to the best of my ability and now it syncs. If your iPhone charges, but doesn't sync, most likely you have a similar problem, because the iPhone doesn't need all of its pins to charge, but it does need all of them to sync.

  • I have several ipod nanos. i can sync one, but since i connected the ipad 2 I am getting an error on two of them, it says cannot sync, error 13019. the loaded songs show on the computer (on the ipods), but not when the ipod is plugged off the usb

    i have several ipod nanos. i can sync one, but since i connected the ipad 2 I am getting an error on two of them, it says cannot sync, error 13019. the loaded songs show on the computer (on the ipods), but not when the ipod is plugged off the usb. Any answers? please

    You can sync your iPod with multiple computers, but what can be synced is very limited.  See this article for more details.
    http://support.apple.com/kb/ht1202
    B-rock

  • I am unable to burn any info-photo ect on to a disk. I have a 27" I mac mid 2010 version. I put in a disk, hit burn, it runs for about 3 mins and ejects the disk sayiny there was an error with the drive and will not restart.

    am unable to burn any info-photo ect on to a disk. I have a 27" I mac mid 2010 version. I put in a disk, hit burn, it runs for about 3 mins and ejects the disk sayiny there was an error with the drive and will not restart.

    The optical drive has probably failed. It's a fairly common thing with these slim SuperDrives. Does it read any discs you put into it? You can try resetting the SMC and pram but I'll be surprised if it helps.
    To reset the SMC
    Shut down the computer.
    Unplug the computer's power cord.
    Wait fifteen seconds.
    Attach the computer's power cord.
    Wait five seconds, then press the power button to turn on
    Resetting PRAM and NVRAM
    Shut down the computer.
    Locate the following keys on the keyboard: Command, Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    Turn on the computer.
    Press and hold the Command-Option-P-R keys. You must press this key combination before the gray screen appears.
    Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    Release the keys.

  • HP D110 AIO printer. Prints jam when printing with wireless, but not when hooked to USB cable! HELP!

    I have a HP D110. It jams the paper when I print with wireless, but not when I use USB cable. Any ideas?

    From what you describe you are having issues printing from MS Office. Have you had trouble printing from other resources on your computer (e.g. from the internet or another program)? The first thing I am going to suggest is that we start by uninstalling and reinstalling the printer from the resources available online. 
    First if you use a USB cord, make sure to remove it (this is important). Do not plug it back in until the software directs you to. Then go through the Devices and Printers, Programs and Features and Device Manager folders and insure that all copies, files, and programs related to the printer are removed. Then as directed, restart the computer. 
    In the START menu type "%temp%" and press ENTER. Here I want you to press Ctrl+A and hit DELETE. Some of the files will not allow you to delete them, skip those files and delete the majority that allows it. 
    http://h20000.www2.hp.com/bizsupport/TechSupport/DriverDownload.jsp?prodNameId=3562006&lang=en&cc=us...
    Install that and let me know the result! 
    Have a great day!

  • Ipod nano plays with headphones but not when plugged in to player

    I have a nano 16gb 4th or 5th generation.  It has worked fine up until about a week ago.  It works if I plug in the headphones, but not when it is plugged into the car stereo or an iHome.  Any thoughts?

    If:
    -you and your husband have the same generation iPod nano
    -they both have the same latest software
    -you tried the car stereo with the same iPod charging cord.
    (with 32 pins connector I just wanted to make sure it is not the headphone plug)
    this means that the problem is indeed with your iPod nano.
    Since you also said that before last week everything worked fine, something must've gone wrong after that.
    This could be software-related or hardware-related. Did you try to connect it to your computer? Does the computer recognise it? Can you still charge it?
    If the computer does recognise the iPod it might be a good idea to 'repair' your iPod via iTunes.
    Or try the Five R's: http://www.apple.com/support/ipod/five_rs/nano5gen/# (more or less the same for 4th and 5th gen)
    If your computer does not recognise it, it probably needs to be repaired. But since it is 4th or 5th generation I guess the warranty is void already, and you'll have to decide how much this is worth to you or if you wouldn't want to buy a new one.

  • My photos are not printing right with adobe manages color but works when i use printer manages color. never had any issues untill a week ago.

    my photos are not printing right with adobe manages color but works when i use printer manages color. never had any issues untill a week ago.

    We use CS6, yes we calibrate using x-rite. I have always had adobe manage colors when printing. This problem just occurred, all my settings are the same as they have been for years. The only thing we did lately is do an update to CS6. We thought it might be our printer but when we use the printer manages color it works fine, The problem with adobe manages color is it is not blending the light highlights like on top of the cheeks with the colors around the cheeks  and its putting a faint red between the two it just does not have a smooth transition. I printed a photo that I had printed 4 months ago with no issue, and this time it had the issue that I am dealing with now. Somehow the photo shop manages color is not getting the right info to my printer.  
    I set paper type
    set quality
    no color adjustment
    set my profile
    Teri

  • I have an iphone 4s and the speaker has stpped working when I play music with i tunes or you fox. It works when they ring me but not when i want to listen to music :( do you know how I fix this?

    I have an iphone 4s and the speaker has stpped working when I play music with i tunes or you fox. It works when they ring me but not when i want to listen to music :( do you know how I fix this?

    Go to settings/music/volume limit tap on that.  Make sure it is set to OFF and when you tap it that the slider is at max

  • BPEL SCA: XML-20129: (Error) Namespace prefix 'ui' used but not declared.

    SOASuite 11g
    Oracle Weblogic Server 10.3.3
    Oracle Solaris on SPARC (64-bit) 10
    Database: Oracle Server - Enterprise Edition 10.2.0.5
    When I start the SOA domain server, I find the following in the log file:
    <Feb 25, 2011 10:41:23 AM CET> <Error> <org.apache.commons.digester.Digester> <BEA-000000> <Parse Error at line 9 column 79: <Line 9,
    Column 79>: XML-20129: (Error) Namespace prefix 'ui' used but not declared.
    org.xml.sax.SAXParseException: <Line 9, Column 79>: XML-20129: (Error) Namespace prefix 'ui' used but not declared.
    at oracle.xml.parser.v2.XMLError.flushErrorHandler(XMLError.java:422)
    at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:287)
    at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:342)
    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:226)
    at org.apache.commons.digester.Digester.parse(Digester.java:1785)
    at oracle.fabric.composite.Parser.parseComposite(Parser.java:132)
    at oracle.integration.platform.kernel.WLSFabricKernelInitializer.deployComposite(WLSFabricKernelInitializer.java:493)
    at oracle.integration.platform.kernel.WLSFabricKernelInitializer.prepareCompositeDeployments(WLSFabricKernelInitializer.java:
    239)
    at oracle.integration.platform.kernel.WLSFabricKernelInitializer.init(WLSFabricKernelInitializer.java:127)
    at javax.servlet.GenericServlet.init(GenericServlet.java:241)
    at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
    at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
    at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:539)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1976)
    at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1950)
    at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1869)
    at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3126)
    at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1512)
    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:486)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
    at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
    at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
    at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:1267)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
    at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:409)
    at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:58)
    at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:361)
    at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
    at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)
    at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
    at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
    at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
    at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
    at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:180)
    at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:96)
    at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    >
    My composite.xml is:
    <composite name="JIPSYHandleRTOTaskEBF" revision="1.0" mode="active" state="on"
    xmlns="http://xmlns.oracle.com/sca/1.0"
    xmlns:ui="http://xmlns.oracle.com/soa/designer/"^M
    xmlns:xs="http://www.w3.org/2001/XMLSchema">^M
    <import location="GetTimeoutPeriod.wsdl" namespace="http://xmlns.oracle.com/pcbpel/adapter/db/GetTimeoutPeriod/"/>
    <service ui:wsdlLocation="JIPSYHandleRTOTaskEBF.wsdl" name="client">
    </composite>
    But when it has been deployed, I see that this has been changed into:
    <composite name="JIPSYHandleRTOTaskEBF" revision="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <import location="GetTimeoutPeriod.wsdl" namespace="http://xmlns.oracle.com/pcbpel/adapter/db/GetTimeoutPeriod/"/>
    <service ui:wsdlLocation="JIPSYHandleRTOTaskEBF.wsdl" name="client">
    </composite>
    (I exported this from MDS).
    Apparently, some namespaces are stripped.
    This appears to happen during the deploy (using ant), because the version in the generated jar file is already missing the namespaces.
    The BPEL processes appear to work fine though.
    Why is this happening and how can I prevent these errors?

    I've fiddled around with the file composite.xml and found the following workaround:
    If I change the start of the file to:
    <?xml version="1.0" encoding="UTF-8"?>
    <composite name="JIPSYUpdateWorkflowReqABCSImpl"
    xmlns="http://xmlns.oracle.com/sca/1.0"
    xmlns:ui="http://xmlns.oracle.com/soa/designer/"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    revision="1.0"
    mode="active"
    state="on">
    it remains unchanged and the errors during deployment are gone.

  • IPod nano works with USB 1.1 but not USB 2.0

    Anyone using an iPod nano that works with USB 1.1 but not with USB 2.0? I am using Windows XP and when installing the iPod software from CD it recognizes the iPod and am able to transfer songs using iTunes but when installing SP1 or SP2 to enable USB 2.0 transfers, Windows XP only recognizes the iPod nano as a USB Mass Storage Device. This is the same with iPod Updater.

    I have a similar problem with the following configuration:
    - Dell Dimension 4100 Desktop with 2 integrated USB 1.1 ports, Windows 2000 SP 4
    - PCI 6-Ports USB 2.0 Card ("Mentor" resp. www.bona.com.tw), Model USB20-PCI/6P
    What works well?
    - All my USB add-ons (1.1 and 2.0) on the internal 1.1 ports as well as on the USB2.0 PCI card
    - iPod Nano 4GB on internal 1.1 ports (external drive in windows 2000 as well as iPod in iTunes)
    - iPod Nano works as well as on the USB 2.0 card ONLY WHEN my old 4-port USB1.1 hub is connected between Nano and USB card
    What doesn't works?
    My iPod Nano directly connected to the USB 2.0 card. Symptoms when connecting:
    - Windows is very slow, process "scvhost.exe" or "system.exe" using 99% of CPU for some minutes
    - iPod is recognised as external drive, but when I click on it, it is empty and copying files to it results in "I/O error"
    - iTunes doesn't recognise the iPod (of course, if even windows itself cannot read from it...)
    I removed all USB drivers, reinstalled iTunes, iPod (by the way, I still don't understand what "iPod update" is good for, except for updating the iPod's firmware), deactivate the internal USB1.1 ports, no result.
    Help!!!!!!!!!!!!!!!!

  • How to apply an InDesign Paragraph Rule above, but not when first in column

    How do I apply a paragraph rule "above" but not when first in a column. In other words, the rule above will only run if it isn't the first paragraph in the column (even if it appears in a multi-column text frame).
    Before you jump the gun: Rule below will not solve that, for various reasons.
    Thanks much in advance.

    Aha! Apparently totally!
    Here a similar way to yours with an anchored block. Copy it and launch this simple regex. Easy with no headache! 

Maybe you are looking for