CLASSPATH / Project organisation

Hi,
I'm fairly new to Java, but I'd like to think I'm a reasonably experienced programmer. I think I've missed something fundamental with the organisation of Java projects though.
I have a lot of toy Java projects, mostly as learning tools, some of them use open source bits, but it seems the more I decide to play with, the more hideous my
development environment gets.
As I understand it, the jar files that you import need to be accessible via the CLASSPATH. Does that mean it's usual to have all your jars / projects in one spot ?, or the CLASSPATH gets out of control ?
I attempted to have scripts that set up each classpath, but even that is messy if you decide to add more components.
Then there's the issue of packages, a couple that I've attempted to use seem to have paths embedded into them, I'm sure I've got that wrong somehow but ..
therein lies the 'Wrong name' error.
Oh, I should mention I'm currently on a Windows platform (I know, don't tell me), but if push comes to shove then Suse Linux is an option. But, I don't think my problem is related to OS selection ..
Thanks folks.
Laura.

As I understand it, the jar files that you import
need to be accessible via the CLASSPATH. Does that
mean it's usual to have all your jars / projects in
one spot ?, or the CLASSPATH gets out of control ?It's better to have it that way. I mean, keeping the custom JARs for the project in one location and adding them to classpath as required.
I attempted to have scripts that set up each
classpath, but even that is messy if you decide to
add more components.You might take a look at Ant. It's easier to manage building the projects with an Ant script.
http://ant.apache.org/
Oh, I should mention I'm currently on a Windows
platform (I know, don't tell me), but if push comes
to shove then Suse Linux is an option. But, I don't
think my problem is related to OS selection .. Sure enough, it isn't OS related. :)

Similar Messages

  • Project Organisations

    I am setting up project organisation hierarchies in release 11. Basicaly i have expenditure organisations which correspond with sets of books (operating unit = legal entity = SOB.)It is multi-national so I need one SOB per country.
    In terms of project owning organisations this hierarchy corresponds to divisions that go accross sets of books (recruitment services in SOB 1 / 2 / 3 etc - consultancy services SOB 1 / 2 / 3).
    Can I report accross SOB's
    Surian

    Hi
    Thanks for the response. I did take a look at Cipher streams but they do not solve my problem, because the integration layer between departments is not equipped to handle all that and cannot be changed by us. They just take the inputstream and convert it into a String...so when they pass this String on the same unpredictability comes up. Tested this on the development server

  • Classpath read only

    hi ,
    I import configuration and tried to create project for existing Dc but i got error as classpath is read only. It is also showing name clash against class path file in DTR perspective. even when i tried to sync same DC i got following error . How to resolve this problem???
    com.sap.tc.devconf.SyncException: Unkown error during unsync: Cannot delete mount point if there are still files synced: C:\Documents and Settings\Admin\.dtc\0\DCs\asianpaints.com\prp\_comp\gen\default\logs\build.log
    at com.sap.tc.devconf.impl.DCProxy.unsync(DCProxy.java:1428)
    at com.sap.tc.devconf.impl.DevelopmentConfiguration.unsync(DevelopmentConfiguration.java:4897)
    at com.sap.tc.devconf.impl.DevelopmentConfiguration.unsync(DevelopmentConfiguration.java:4889)
    at com.sap.tc.devconf.impl.DevelopmentComponentNode.unsync(DevelopmentComponentNode.java:828)
    at com.sap.ide.eclipse.component.provider.actions.dc.DcCreateProjectAction$1.syncSelectedDCs(DcCreateProjectAction.java:440)
    at com.sap.ide.eclipse.component.provider.actions.dc.DcCreateProjectAction$1.execute(DcCreateProjectAction.java:237)
    at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:71)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1595)
    at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:85)
    at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:302)
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:252)
    at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:357)
    at com.sap.ide.eclipse.component.provider.actions.dc.DcCreateProjectAction.execute(DcCreateProjectAction.java:483)
    at com.sap.ide.eclipse.component.provider.actions.dc.DcCreateProjectAction.execute(DcCreateProjectAction.java:126)
    at com.sap.ide.eclipse.component.provider.actions.dc.DCSyncSourcesAndUsedDCsAction.run(DCSyncSourcesAndUsedDCsAction.java:52)
    at com.tssap.selena.model.extension.action.SelenaActionCollector$GenericElementActionWrapper.run(SelenaActionCollector.java:229)
    at com.tssap.util.ui.menu.MenuFactory$MuSiAction.saveRunAction(MenuFactory.java:1425)
    at com.tssap.util.ui.menu.MenuFactory$MuSiAction.run(MenuFactory.java:1391)
    at com.tssap.util.ui.menu.MenuFactory$DelegateAction.processInternal(MenuFactory.java:616)
    at com.tssap.util.ui.menu.MenuFactory$DelegateAction.access$100(MenuFactory.java:586)
    at com.tssap.util.ui.menu.MenuFactory$DelegateAction$BusyProcessWorker.run(MenuFactory.java:716)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
    at com.tssap.util.ui.menu.MenuFactory$DelegateAction.process(MenuFactory.java:610)
    at com.tssap.util.ui.menu.internal.MenuListenerFactory$ProcessAdapter.widgetSelected(MenuListenerFactory.java:172)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2022)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1729)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402)
    at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385)
    at com.tssap.util.startup.WBLauncher.run(WBLauncher.java:79)
    at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858)
    at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.sap.ide.eclipse.startup.Main.basicRun(Main.java:291)
    at com.sap.ide.eclipse.startup.Main.run(Main.java:789)
    at com.sap.ide.eclipse.startup.Main.main(Main.java:607)
    Caused by: com.tssap.dtr.client.lib.vfs.VfsRuntimeException: Cannot delete mount point if there are still files synced: C:\Documents and Settings\Admin\.dtc\0\DCs\asianpaints.com\prp\_comp\gen\default\logs\build.log
    at com.tssap.dtr.client.lib.vfs.config.impl.Client.checkPreconditionsForDeleteMountPoint(Client.java:509)
    at com.tssap.dtr.client.lib.vfs.config.impl.Client.internalDeleteMountPointWithoutReleasingManager(Client.java:484)
    at com.tssap.dtr.client.lib.vfs.config.impl.Client.internalDeleteMountPoints(Client.java:317)
    at com.tssap.dtr.client.lib.vfs.config.impl.Client.deleteMountPoints(Client.java:230)
    at com.sap.tc.devconf.impl.VFSHandler.removeMountPoint(VFSHandler.java:1063)
    at com.sap.tc.devconf.impl.DevelopmentConfiguration.removeMountPoint(DevelopmentConfiguration.java:2591)
    at com.sap.tc.devconf.impl.DCProxy.unsync(DCProxy.java:1330)
    ... 40 more
    Caused by:
    VFS version: 7.00 645_VAL_REL 0010 (2007-01-06 16:21:22 CET) com.tssap.dtr.client.lib.vfs.VfsRuntimeException: Cannot delete mount point if there are still files synced: C:\Documents and Settings\Admin\.dtc\0\DCs\asianpaints.com\prp\_comp\gen\default\logs\build.log
    at com.tssap.dtr.client.lib.vfs.config.impl.Client.checkPreconditionsForDeleteMountPoint(Client.java:509)
    at com.tssap.dtr.client.lib.vfs.config.impl.Client.internalDeleteMountPointWithoutReleasingManager(Client.java:484)
    at com.tssap.dtr.client.lib.vfs.config.impl.Client.internalDeleteMountPoints(Client.java:317)
    at com.tssap.dtr.client.lib.vfs.config.impl.Client.deleteMountPoints(Client.java:230)
    at com.sap.tc.devconf.impl.VFSHandler.removeMountPoint(VFSHandler.java:1063)
    at com.sap.tc.devconf.impl.DevelopmentConfiguration.removeMountPoint(DevelopmentConfiguration.java:2591)
    at com.sap.tc.devconf.impl.DCProxy.unsync(DCProxy.java:1330)
    at com.sap.tc.devconf.impl.DevelopmentConfiguration.unsync(DevelopmentConfiguration.java:4897)
    at com.sap.tc.devconf.impl.DevelopmentConfiguration.unsync(DevelopmentConfiguration.java:4889)
    at com.sap.tc.devconf.impl.DevelopmentComponentNode.unsync(DevelopmentComponentNode.java:828)
    at com.sap.ide.eclipse.component.provider.actions.dc.DcCreateProjectAction$1.syncSelectedDCs(DcCreateProjectAction.java:440)
    at com.sap.ide.eclipse.component.provider.actions.dc.DcCreateProjectAction$1.execute(DcCreateProjectAction.java:237)
    at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:71)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1595)
    at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:85)
    at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:302)
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:252)
    at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:357)
    at com.sap.ide.eclipse.component.provider.actions.dc.DcCreateProjectAction.execute(DcCreateProjectAction.java:483)
    at com.sap.ide.eclipse.component.provider.actions.dc.DcCreateProjectAction.execute(DcCreateProjectAction.java:126)
    at com.sap.ide.eclipse.component.provider.actions.dc.DCSyncSourcesAndUsedDCsAction.run(DCSyncSourcesAndUsedDCsAction.java:52)
    at com.tssap.selena.model.extension.action.SelenaActionCollector$GenericElementActionWrapper.run(SelenaActionCollector.java:229)
    at com.tssap.util.ui.menu.MenuFactory$MuSiAction.saveRunAction(MenuFactory.java:1425)
    at com.tssap.util.ui.menu.MenuFactory$MuSiAction.run(MenuFactory.java:1391)
    at com.tssap.util.ui.menu.MenuFactory$DelegateAction.processInternal(MenuFactory.java:616)
    at com.tssap.util.ui.menu.MenuFactory$DelegateAction.access$100(MenuFactory.java:586)
    at com.tssap.util.ui.menu.MenuFactory$DelegateAction$BusyProcessWorker.run(MenuFactory.java:716)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
    at com.tssap.util.ui.menu.MenuFactory$DelegateAction.process(MenuFactory.java:610)
    at com.tssap.util.ui.menu.internal.MenuListenerFactory$ProcessAdapter.widgetSelected(MenuListenerFactory.java:172)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2022)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1729)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402)
    at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385)
    at com.tssap.util.startup.WBLauncher.run(WBLauncher.java:79)
    at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858)
    at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.sap.ide.eclipse.startup.Main.basicRun(Main.java:291)
    at com.sap.ide.eclipse.startup.Main.run(Main.java:789)
    at com.sap.ide.eclipse.startup.Main.main(Main.java:607)

    i checked in DTR. My webdynpro DC is showing .classpath , .project and .metamodel files which are not there in othe WebDynpro DCs. should i delete that files or only classpath file??? if yes then how to delete that file from DTR???????
    Edited by: kavita chavan on Feb 14, 2008 10:05 AM

  • Similar product to entourage project centre that will sync with ical

    I have been using entourage, however, would like to just use ical. I like the project organisation in entourage and was hoping to find a similar mac product, something where I can bring tasks, notes, emails, files etc together based on projects. Nothing that mac offers in its iworks, ilife or mail program compares in this feature. I want software that is not too complicated but something that could integrate well with ical etc.
    Any referrals would be appreciated. Thanks.
    Treezy

    A couple you could try:
    Bento (www.filemaker.co.uk/bento)
    Midnight Inbox (http://www.midnightbeep.com/)
    Omnifocus (http://www.omnigroup.com/applications/omnifocus/)
    Bento's probably the easiest to get to grips with immediately, but people have very different tastes in this kind of stuff.

  • NullPointerException when getting resources

    Hi,
    I am trying to build a simple program to get a file resource. The code is fairly simple, with the next method in mypackage.MyClass:
    File someMethod(String filename) {
             String name =
                  this.getClass().getResource(filename).getFile();
            File file = new File(name);
    return file;
    }The project is organised as follows:
    /src - the sources directory
    /bin - the binaries directory
    /resources - the directory where my file exists, let's say testfile.html
    I try to call someMethod("resources/testfile.html") or
    someMethod("../resources/testfile.html").
    Also tried to set the classpath in the .ant file:
      <path id="classpath.project">
         <pathelement path="${dir.build}"/>
         <pathelement location="resources"/>
      </path>and then call someMethod("testfile.html").
    Every time I get NullPointerException, IDE or command line.
    Thanks for help!
    l.

    Hi,
    I am trying to build a simple program to get a file
    resource. The code is fairly simple, with the next
    method in mypackage.MyClass:
    File someMethod(String filename) {
    String name =
    this.getClass().getResource(filename).getFile();
    File file = new File(name);
    return file;
    }The project is organised as follows:
    /src - the sources directory
    /bin - the binaries directory
    /resources - the directory where my file exists, let's
    say testfile.html
    I try to call someMethod("resources/testfile.html") or
    someMethod("../resources/testfile.html").
    Also tried to set the classpath in the .ant file:
    <path id="classpath.project">
    <pathelement path="${dir.build}"/>
    <pathelement location="resources"/>
    </path>and then call someMethod("testfile.html").
    Every time I get NullPointerException, IDE or command
    line.
    Thanks for help!
    l.try the following:
    String name = ClassLoader.getSystemClassLoader().getResource("../resources/" + filename).getFile();In the API you can find:
    public URL getResource(String name)
    Finds a resource with a given name. This method returns null if no resource with this name is found. The rules for searching resources associated with a given class are implemented by the * defining class loader of the class.
    This method delegates the call to its class loader, after making these changes to the resource name: if the resource name starts with "/", it is unchanged; otherwise, the package name is prepended to the resource name after converting "." to "/". If this object was loaded by the bootstrap loader, the call is delegated to ClassLoader.getSystemResource.
    The fact that the package is prepended to the resource might cause many problems
    (as it also did within my project).
    Remark that the .. might also cause problems (since I'm not sure if this is 100% pure java
    or if this is 100% windows). I guess you should parse the filename in order to find the parent-directory.
    kind regards,

  • Connecting with SQL Server

    Dear All,
    I m new to JDeveloper and want to make a connection with SQL Server 2008 but in Connection Dialogue with following Settings :-
    Connection Type: SQL Server
    UserName: sa
    Password: ******
    HostName: EServer
    DatabaseName: DBName
    PortNumber: 1430
    Driver Class: com.microsoft.sqlserver.jdbc.SQLServerDriver
    Library:
    As I Press Test Connection it gives following error:
    Test failed: Driver class not found.
    Verify the Driver location
    Pls suggest

    Download sqljdbc.jar and Add it to the Viewcontroller Libraries and Classpath (Project Properties of ViewController)

  • Assistance required for deploying a validation handler in OIM 11g

    Hi All,
    I wanted to deploy a validation handler in OIM 11g so that I can check that the telephone number that is entered by the user has length of ten and all of them are digits.
    I created a new eclipse workspace called TelephoneValidationHandler on the OIM Host machine. I created a new Java project in the workspace with the name TelephoneValidationHandler. I created a class called TelephoneValidationHandler in this project. Put in the following code in this java file -
    /* TelephoneValidationHandler.java */
    package com.custom;
    import java.io.Serializable;
    import java.util.HashMap;
    import oracle.iam.platform.kernel.ValidationException;
    import oracle.iam.platform.kernel.ValidationFailedException;
    import oracle.iam.platform.kernel.spi.ValidationHandler;
    import oracle.iam.platform.kernel.vo.BulkOrchestration;
    import oracle.iam.platform.kernel.vo.Orchestration;
    public class TelephoneValidationHandler implements ValidationHandler{
              @Override
              public void initialize(HashMap<String, String> arg0) {
              // TODO initialization
              System.out.println("***********************************************************************************");
              System.out.println("************************** Init validate event handler ****************************");
              System.out.println("***********************************************************************************");
              @Override
              public void validate(long processId, long eventId, Orchestration orchestration)
              throws ValidationException, ValidationFailedException {
              System.out.println("************************** Beginning of validation *************************");
              HashMap<String, Serializable> parameters = orchestration.getParameters();
              String telephone = (String) parameters.get("Telephone Number");     
              //String regex="[0-9]{10}";
                   if (telephone.length()==10)
                        for(int i=0; i<10; i++)
                             if (Character.isDigit(telephone.charAt(i))){
                                  continue;
                             else
                                  throw new ValidationFailedException();
                        System.out.println("****************** Validated *********************");
              else
                   System.out.println("*************EXCEPTION OCCURRED*******************");
              throw new ValidationFailedException();
              System.out.println("************************** End of validation *************************");
              @Override
              public void validate(long processId, long eventId, BulkOrchestration arg2)
                        throws ValidationException, ValidationFailedException {
              // TODO - N/A
                   System.out.println("************************** INSIDE BULK VALIDATE ***************************");
    I included the files in reference libraries as - right click on the project, click on Build Path -> Configure Build Path -> Add External JARs. In this I selected the jars that were needed to compile the code successfully and i selected them from the place where they exist in the OIM host for eg. C:\Oracle\Middleware\server\platform\iam-platform-kernel.jar path for iam-platform-kernel.jar.
    Now i created a jar file out of this compiled project by right clicking on the project name and clicking Export -> Java -> JAR File. Selected the .classpath and .project files to export as well. Selected first option 1. Export generated class files and resources option. Other three existing options apart from this one which i selected were: 2. Export all output folders for checked projects. 3. Export Java source files and resources 4. Export refactorings for checked projects. So with the 1st option selected, I clicked next and then selected Generate New Manifest file in the final screen and clicked on Finish. Exported this by the name TelephoneValidationHandler.jar to desktop. If I open this jar by changing extension to zip, I see the following folder structure inside it :
    com -> custom -> TelephoneValidationHandler.class
    META-INF -> MANIFEST.INF
    .classpath
    .project
    I created a folder called lib and placed this jar file inside this lib folder. Then outside this lib folder, i placed the plugin.xml file created for this as follows:
    plugin.xml ->
    <?xml version="1.0" encoding="UTF-8"?>
    <oimplugins xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <plugins pluginpoint="oracle.iam.platform.kernel.spi.ValidationHandler">
    <plugin class="com.custom.TelephoneValidationHandler" version="1.0" name="TelephoneValidationHandler">
    </plugin>
    </plugins>
    </oimplugins>
    Now I selected the lib folder and plugin.xml and created a new zip file by the name TelephoneValidationHandler.zip which will be used for plugin registration. The zip folder directly inside it has the structure - plugin.xml file and lib folder having the jar file inside it.
    lib -> TelephoneValidationHandler.jar
    plugin.xml
    Now I went to the directory C:\Oracle\Middleware\server\plugin_utility and opened the ant.properties file in that and put in the values as:
    ant.properties ->
    # The installation directory for WLS
    wls.home=C:\\Oracle\\Middleware\\wlserver_10.3
    # The home directory for OIM. In case of shiphome its same as install directory
    oim.home=C:\\Oracle\\Middleware\\Oracle_IDM1\\server
    #login file name with path.
    login.config=C:\\Oracle\\Middleware\\Oracle_IDM1\\server\\config\\authwl.conf
    Now I opened a cmd prompt, traversed to C:\Oracle\Middleware\server\plugin_utility directory and typed in "ant -f pluginregistration.xml register" and executed this command.
    It asked for oim userid - xelsysadm, oim password: Password, server url: t3://oimhost:14000, name of plugin file with path: C:\\temp\\TelephoneValidationHandler.zip
    I got these errors in the redirector.out file in C:\Oracle\Middleware\server\plugin_utility :
    Error in registering the plugin. null
    Error occured during the use of plugin registering utility.
    And this is the detailed description in the redirector.err in C:\Oracle\Middleware\server\plugin_utility :
    Jul 17, 2012 6:05:58 PM PluginUtility main
    SEVERE: Exception occured {0}
    java.lang.NullPointerException
         at java.util.regex.Matcher.getTextLength(Matcher.java:1140)
         at java.util.regex.Matcher.reset(Matcher.java:291)
         at java.util.regex.Matcher.<init>(Matcher.java:211)
         at java.util.regex.Pattern.matcher(Pattern.java:888)
         at weblogic.utils.classloaders.FilteringClassLoader.matchesClassFilterList(FilteringClassLoader.java:213)
         at weblogic.utils.classloaders.FilteringClassLoader.findClass(FilteringClassLoader.java:97)
         at weblogic.utils.classloaders.FilteringClassLoader.loadClass(FilteringClassLoader.java:86)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
         at oracle.iam.platform.pluginframework.PluginReader.validateInstance(PluginReader.java:303)
         at oracle.iam.platform.pluginframework.PluginReader.validatePluginsFromFile(PluginReader.java:363)
         at oracle.iam.platform.pluginframework.PluginReader.readPluginsFromZIP(PluginReader.java:147)
         at oracle.iam.platform.pluginframework.PluginReader.readPlugins(PluginReader.java:66)
         at oracle.iam.platform.pluginframework.PluginManagerImpl.registerPlugin(PluginManagerImpl.java:74)
         at oracle.iam.platformservice.impl.PlatformServiceImpl.registerPlugin(PlatformServiceImpl.java:129)
         at oracle.iam.platformservice.api.PlatformServiceEJB.registerPluginx(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
         at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
         at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy528.registerPluginx(Unknown Source)
         at oracle.iam.platformservice.api.PlatformService_ott20t_PlatformServiceRemoteImpl.__WL_invoke(Unknown Source)
         at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
         at oracle.iam.platformservice.api.PlatformService_ott20t_PlatformServiceRemoteImpl.registerPluginx(Unknown Source)
         at oracle.iam.platformservice.api.PlatformService_ott20t_PlatformServiceRemoteImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:667)
         at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
         at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Jul 17, 2012 6:05:58 PM PluginUtility main
    SEVERE: Exception occured {0}
    java.lang.NullPointerException
         at java.util.regex.Matcher.getTextLength(Matcher.java:1140)
         at java.util.regex.Matcher.reset(Matcher.java:291)
         at java.util.regex.Matcher.<init>(Matcher.java:211)
         at java.util.regex.Pattern.matcher(Pattern.java:888)
         at weblogic.utils.classloaders.FilteringClassLoader.matchesClassFilterList(FilteringClassLoader.java:213)
         at weblogic.utils.classloaders.FilteringClassLoader.findClass(FilteringClassLoader.java:97)
         at weblogic.utils.classloaders.FilteringClassLoader.loadClass(FilteringClassLoader.java:86)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
         at oracle.iam.platform.pluginframework.PluginReader.validateInstance(PluginReader.java:303)
         at oracle.iam.platform.pluginframework.PluginReader.validatePluginsFromFile(PluginReader.java:363)
         at oracle.iam.platform.pluginframework.PluginReader.readPluginsFromZIP(PluginReader.java:147)
         at oracle.iam.platform.pluginframework.PluginReader.readPlugins(PluginReader.java:66)
         at oracle.iam.platform.pluginframework.PluginManagerImpl.registerPlugin(PluginManagerImpl.java:74)
         at oracle.iam.platformservice.impl.PlatformServiceImpl.registerPlugin(PlatformServiceImpl.java:129)
         at oracle.iam.platformservice.api.PlatformServiceEJB.registerPluginx(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
         at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
         at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy528.registerPluginx(Unknown Source)
         at oracle.iam.platformservice.api.PlatformService_ott20t_PlatformServiceRemoteImpl.__WL_invoke(Unknown Source)
         at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
         at oracle.iam.platformservice.api.PlatformService_ott20t_PlatformServiceRemoteImpl.registerPluginx(Unknown Source)
         at oracle.iam.platformservice.api.PlatformService_ott20t_PlatformServiceRemoteImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:667)
         at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
         at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Exception in thread "Main Thread" java.lang.NullPointerException
         at java.util.regex.Matcher.getTextLength(Matcher.java:1140)
         at java.util.regex.Matcher.reset(Matcher.java:291)
         at java.util.regex.Matcher.<init>(Matcher.java:211)
         at java.util.regex.Pattern.matcher(Pattern.java:888)
         at weblogic.utils.classloaders.FilteringClassLoader.matchesClassFilterList(FilteringClassLoader.java:213)
         at weblogic.utils.classloaders.FilteringClassLoader.findClass(FilteringClassLoader.java:97)
         at weblogic.utils.classloaders.FilteringClassLoader.loadClass(FilteringClassLoader.java:86)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
         at oracle.iam.platform.pluginframework.PluginReader.validateInstance(PluginReader.java:303)
         at oracle.iam.platform.pluginframework.PluginReader.validatePluginsFromFile(PluginReader.java:363)
         at oracle.iam.platform.pluginframework.PluginReader.readPluginsFromZIP(PluginReader.java:147)
         at oracle.iam.platform.pluginframework.PluginReader.readPlugins(PluginReader.java:66)
         at oracle.iam.platform.pluginframework.PluginManagerImpl.registerPlugin(PluginManagerImpl.java:74)
         at oracle.iam.platformservice.impl.PlatformServiceImpl.registerPlugin(PlatformServiceImpl.java:129)
         at oracle.iam.platformservice.api.PlatformServiceEJB.registerPluginx(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
         at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
         at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy528.registerPluginx(Unknown Source)
         at oracle.iam.platformservice.api.PlatformService_ott20t_PlatformServiceRemoteImpl.__WL_invoke(Unknown Source)
         at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
         at oracle.iam.platformservice.api.PlatformService_ott20t_PlatformServiceRemoteImpl.registerPluginx(Unknown Source)
         at oracle.iam.platformservice.api.PlatformService_ott20t_PlatformServiceRemoteImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:667)
         at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
         at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    But in the end of this run it still does show - BUILD SUCCESSFUL message but it obviously doesn't work properly because after this registration is done, I go to the MDS through command prompt and import the new EventHandlers.xml which I create as shown below:
    EventHandlers.xml ->
    <?xml version='1.0' encoding='UTF-8'?>
    <eventhandlers xmlns="http://www.oracle.com/schema/oim/platform/kernel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.oracle.com/schema/oim/platform/kernel orchestration-handlers.xsd">
    <validation-handler class="com.custom.TelephoneValidationHandler" name="TelephoneValidationHandler" entity-type="User" operation="ANY" order="1002" />
    </eventhandlers>
    This import of EventHandlers.xml is done to the path - /metadata/user/custom
    But after all this, whenever I try creating a new user, I don't even get to see the create user page. Instead I get a NullPointer exception thrown at me.
    Can someone please go through these above steps and tell me if there is any particular step I might be doing wrong??? Maybe the ant.properties is not set properly or maybe the ValidationHandler java code is not implemented properly. However as far as I see I think these steps are correct. I have checked with other posts in this category and followed them. However this error still exists. Please help me.
    Thanks,
    $id
    Edited by: $id on Jul 17, 2012 6:36 PM

    Hey You were right. I changed the plugin.xml file so that the plugin xml tag changed to <plugin pluginclass="..." ..> and now when I ran the ant utility to register the plugin, it did not give any errors. Instead I got a message saying Plugin registered successfully. Also then I went to the dev_oim schema and in that the plugins table and checked it. This time the plugin entry was present in the database in this table.
    Now I imported the EventHandlers.xml file using MDS utility as follows:
    Placed the EventHandlers.xml file in C:/temp/metadata/user/custom/EventHandlers.xml
    The EventHandlers.xml file is as mentioned earlier as follows:
    <?xml version='1.0' encoding='UTF-8'?>
    <eventhandlers xmlns="http://www.oracle.com/schema/oim/platform/kernel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.oracle.com/schema/oim/platform/kernel orchestration-handlers.xsd">
    <validation-handler class="com.custom.TelephoneValidationHandler" name="TelephoneValidationHandler" entity-type="User" operation="ANY" order="1002"/>
    </eventhandlers>
    Now I changed the weblogic.properties file under C:/Oracle/Middleware/Oracle_IDM1/server/bin file to have the entry as follows:
    metadata_from_loc=C:\ \tempThen went to the cmd prompt and navigated to this same folder. Then executed the command: weblogicImportMetadata.bat. It asked the user name : weblogic, password: password and then the url: t3://oimhost:7001
    There were no errors after this executed. I only got End of Import Metadata Script as the message.
    I then executed the "PurgeCache all" command while in the same directory.
    And gave the oimusername: xelsysadm, oimpassword: password and the oim server url: t3://oimhost:14000.
    I got the message :
    PurgeCache Login Success...
    Purging the cache categories:[all] is successful
    After this I logged in to the OIM console and tried to create a user and provided proper telephone number in the field. But when i clicked on Save after giving in these details, I got the following error on the OIM console:
    A system error occurred.
    When i go the oim server logs i see the following lines in it whenever I click on save for a new user:
    [2012-07-18T11:15:22.799+05:30] [oim_server1] [NOTIFICATION] [IAM-0080013] [oracle.iam.platform.kernel.impl] [tid: [ACTIVE].ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [APP: oim#11.1.1.3.0] Kernel executing default validation with process id, event id, entity and operation 1,796.0.User.CREATE
    [2012-07-18T11:15:23.111+05:30] [oim_server1] [NOTIFICATION] [IAM-3050013] [oracle.iam.identity.usermgmt.impl] [tid: [ACTIVE].ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm][APP: oim#11.1.1.3.0] Searching for users with the specified criteria.
    [2012-07-18T11:15:23.688+05:30] [oim_server1] [WARNING] [IAM-0080002] [oracle.iam.platform.kernel.impl] [tid: [ACTIVE].ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm][APP: oim#11.1.1.3.0] Orchestration validation failed on the event handler - Event handler TelephoneValidationHandler implemented using class/plug-in com.custom.TelephoneValidationHandler could not be loaded.
    [2012-07-18T11:15:23.938+05:30] [oim_server1] [ERROR] [IAM-3050029] [oracle.iam.identity.usermgmt.impl] [tid: [ACTIVE].ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm][APP: oim#11.1.1.3.0] The user cannot be created due to validation errors.[[
    oracle.iam.platform.kernel.ValidationFailedException: Event handler TelephoneValidationHandler implemented using class/plug-in com.custom.TelephoneValidationHandler could not be loaded.
    After this error occurred I logged into the database and queried the database with following queries:
    SELECT * FROM dev_oim.orchprocess ORDER BY ID DESC; -> Got the latest entry of process id for operation CREATE and stage as validation-handler but the status of this entry was FAILED.
    Then executed another query as follows to get the event details for the latest process id i got from above query results:
    select * from dev_oim.orchevents WHERE processid=1797 ORDER BY orchorder;The output of this query was:
    "ID"     "NAME"     "STATUS"     "PROCESSID"     "STAGE"     "ORCHORDER"     "RETRY" "CONTEXTID"     "RESULT"
    "7544"     "CreateUserValidationHandler"     "COMPLETED"     "1797"     "validation-handler"     "1"     "0"     "0"     "(BLOB)"
    "7543"     "TelephoneValidationHandler"     "FAILED"     "1797"     "validation-handler"     "2"     "0"     "0"     "(BLOB)"
    I already have pasted my java code initially above. Please guide me if anything wrong in the code or with the EventHandlers.xml file. After importing, I checked again by exporting the EventHandlers.xml file from the location where I had imported it and it did exist in that path.
    Thanks,
    $id
    Edited by: $id on Jul 18, 2012 11:25 AM
    Edited by: $id on Jul 18, 2012 11:34 AM

  • A VERY Strange Eclipse Error

    I have a test class which I am running as an application in Eclipse to test the behavior of another class, MyClass:
    public class TestMyClass {
         public static void main(String[] args) {
              MyClass mc = new MyClass();
              mc.method1();
    }I run the application, method1 behaves as expected. Then I change "method1" to "method2" in the code above, save it, and run again (I have Eclipse set to "build automatically"). method2 does not behave as expected. I then touch ANY OTHER FILE in the project (ie, i make a change, undo the change, and save), and method2 behaves as expected. That is, the project HAS NOT CHANGED AT ALL, yet the behavior changes.
    "Cleaning" the project in after changing method1 to method2 doesn't help either. I have to actually touch one of the files.
    How can this be happening????
    TIA,
    John

    There's something seriously f'd up. For a very rude
    and crude way of getting rid of this:
    1) go to the directory where your project is stored;
    2) throw away anything that starts with a dot, e.g.
    .metadata, .classpath, .project;
    3) throw away all your .class files;
    4) go to the directory where eclipse itself is
    stored;
    5) throw away the 'configuration' directory;
    6) start a newborn eclipse.
    kind regards,
    JosYou forgot: Format your hard drive.
    � {�                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Problem in delete folder

    Please don't refer me to the innumeras delete folder solutions available in the SDN. None of them has come to my help.
    I need to delete a folder. Well, codes are available everywhere, I run it, it successfully deletes the folder specified.
    But the requirement is, I need to make a zip of the folder, then I'll delete the original folder. I am pasting the code here. The zip part is working, the delete part is not! if you comment the line calling zip, it deletes the folder, but after zipping, it cannot delete.
    Is there some lock present? How to check and remove that? Please help.
    * Created on Jan 16, 2006
    * To change the template for this generated file go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    package com.ibm.eis.printapi;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.PrintStream;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipOutputStream;
    * @author localusr
    * To change the template for this generated type comment go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    class PrintUtils {
         static String folderName = "EISMENU_bak";
         static String path = "c:\\samik";
         static String outFilename = "outfile.zip";
         public static void main(String args[]) throws IOException {
              File inFileName = new File(path + "\\" + folderName);
              //make the zip file
              makeZip(inFileName, path, outFilename);
              //Now, delete the directory
              File inFileName2 = new File(path + "\\" + folderName);
              inFileName2.renameTo(new File(path + "\\" + "aaa"));
              deleteDir(inFileName2);
         public static void makeZip(File inFile, String path, String outFile) throws IOException {
              File[] filenames = inFile.listFiles();
              byte b[] = new byte[512];
              ZipOutputStream out = null;
              try {
                   out = new ZipOutputStream(new FileOutputStream(path + "\\" + outFilename));
                   for (int i = 0; i < filenames.length; i++) {
                        if (filenames.isFile()) {
                             InputStream in = new FileInputStream(filenames[i]);
                             ZipEntry e = new ZipEntry(filenames[i].toString().replace(File.separatorChar, '/'));
                             out.putNextEntry(e);
                             int len = 0;
                             while ((len = in.read(b)) != -1) {
                                  out.write(b, 0, len);
                             print(e);
              } catch (IOException ioe) {
                        ioe.printStackTrace();
              } finally {
                   out.close();
                   out = null;
                   filenames = null;
                   b = null;
         public static void print(ZipEntry e) {
              PrintStream sop = System.out;
              sop.print("added " + e.getName());
              if (e.getMethod() == ZipEntry.DEFLATED) {
                   long size = e.getSize();
                   if (size > 0) {
                        long csize = e.getCompressedSize();
                        long ratio = ((size - csize) * 100) / size;
                        sop.println(" (deflated " + ratio + "%)");
                   } else {
                        sop.println(" (deflated 0%)");
              } else {
                   sop.println(" (stored 0%)");
         public static boolean deleteDir(File dir) {
              boolean deleted = false;
              try {
                   if (dir.isDirectory()) {
                        String[] children = dir.list();
                        for (int i = 0; i < children.length; i++) {
                             boolean success = deleteDir(new File(dir, children[i]));
                             if (!success) {
                                  deleted = false;
                             } else {
                                  deleted=true;
                   // The directory is now empty so delete it
                   //System.out.println(dir.canRead())
                   deleted = dir.delete();
              } catch (Exception e) {
                   System.out.println("error: " + e);
              return deleted;

    Thanks it worked.
    The problem was, the folder I was trying to delete had .classpath, .project, .websettings files. It was encountering problem to delete these files because it internally also uses files of same name.
    May be that was the reason.
    I tried with any other folder, it worked.

  • Cairgorm 3 sample applications - errors in unit tests

    After the last update the sample applications started to work - they now even show images.
    But the unit tests for Commands are reporting errors on my machine:
    TypeError: Error #1034: Type Coercion failed: cannot convert []@56443a9 to XMLList.
    at asmock.integration.flexunit::ASMockClassRunner/withBeforeClasses
    at org.flexunit.runners::ParentRunner/classBlock(ParentRunner.as:221)
    etc...
    As I am just starting to explore unit testing, I do not know how to debug it.
    Can someone help me?
    Thanks, Zdenek M

    Hi,
    Could you confirm that you are running the unitTests using the InSyncBasicTestRunner.mxml? Also make sure that you don't have another version of FlexUnit4 on your classpath (Project->Properties->Flex Build Path) as the one shipped with the latest version of Flash Builder may conflict with the version of ASMock we are using at this time.
    Let me know if you are still experiencing issues with the test suite.
    Best,
    Nicolas

  • Why are my masters offline in aperture after restore from vault (not referenced)

    I really hope someone can help as I am at my whits end!
    I recently had to do a clean install of lion and so dutifly backed up my Aperture 3 library to a vault. 100% of my library was managed and I have never referenced files and always avoided it.
    I then restored the aperture library from the vault.
    When the new library opens all the files and project organisation is there, but quite a few images are showing as offline.
    I have noticed that the number of offline images is going up by the minute. Something is changing the state of the images.
    I have checked inside the vault and all the masters are there, but for some reason aperture things they are missing. When selecting the "offline" images and then consolidate masters it gives me the alert that there are no referenced files!
    I have tried repairing and then rebuilding the database but this has no effect.
    Does anyone know whats going on or how I can recover the situation?
    I really do look forward to some help from you guys.
    Many Thanks.
    Brad

    It seems so Puzzling Shutter.
    I have the Aperture Library and the Vault both on the internal hard drive.
    I prepared the vault yesterday and according to aperture it was up to date (updated it several times to make sure)
    My vault was on an external hard drive and I copied it to the mac before restoring.
    Once I restored. The library is the same size as the vault.
    When I use the meta search bar in aperture and select show offline images it shows 144 but each time i come out of the all photos view and go back in this number creeps up!
    When I then go and check the vault (on the mac) and the library, the file arent there either but the size of the library and vault hasnt gone down.
    Do you think it could be because I copied the vault to the mac before restoring from it. Do you think I should try restoring from the vault as it is on the hard drive?
    I really appreciate any advice.
    Thanks,
    Brad

  • Cannot access image in jar

    I have created a jar file in which I fill in the client classes, one of which loads an image as below:
    try
    System.out.println("before loading the image is ...");
    url = new URL(getClass().getResource("../images/Leo.bmp"), "Leo.bmp");
    System.out.println("The url is ...=" url);
    image = ImageIO.read(url);
    System.out.println("the image is ...=" image);
    catch (Exception e) { /handled in paintComponent()/System.out.println("image loading unsuccessful..."); }
    The client works fine, that is, it loads the image fine, only when I run the program in eclipse. But when I create a jar file and try to run it, it throws the exception and doesn't load the image.
    The jar file entries are:
    - cs package which has the class files and the source files
    - images folder which has the Leo.bmp image
    - META-INF which MANIFEST.MF
    - .classpath
    - .project
    So the problem that everything works fine, but the only problem is that my JPanel class cannot load the image.

    blinkaj wrote:
    I have created a jar file in which I fill in the client classes, one of which loads an image as below:
    try
    System.out.println("before loading the image is ...");
    url = new URL(getClass().getResource("../images/Leo.bmp"), "Leo.bmp");
    System.out.println("The url is ...=" url);
    image = ImageIO.read(url);
    System.out.println("the image is ...=" image);
    catch (Exception e) { /handled in paintComponent()/System.out.println("image loading unsuccessful..."); }What a freakin' mess. How can you read that rubbish? When posting code for others to examine, please
    1) use the standard forms of indenting and bracketing code, and don't have two or more code statements per line.
    2) post it inside code tags so the formatting and indentation is preserved. To do that, select the code and click the CODE button.
    try
        System.out.println("before loading the image is ...");
        url = new URL(getClass().getResource("../images/Leo.bmp"), "Leo.bmp");
        System.out.println("The url is ...=" url);
        image = ImageIO.read(url);
        System.out.println("the image is ...=" image);
    catch (Exception e)
        /handled in paintComponent()
        /System.out.println("image loading unsuccessful...");
    }Now that I can clearly see the code:
    1) Don't swallow exceptions(3). Either throw them or at the very least report them.
    2) getClass().getResource() will return a valid URL, or null. If it is valid, the extra 'wrapper' you have for creating a URL is unnecessary, and if it is null, adding the
    new URL(null, "Leo.bmp")is pointless.
    3) Hey. Wait a second! That code should not even compile!
    import java.net.*;
    class TestCompile {
        public static void main(String[] args) {
            URL url;
            try
                System.out.println("before loading the image is ...");
                url = new URL(getClass().getResource("../images/Leo.bmp"), "Leo.bmp");
                System.out.println("The url is ...=" url);
                image = ImageIO.read(url);
                System.out.println("the image is ...=" image);
            catch (Exception e)
                /handled in paintComponent()
                /System.out.println("image loading unsuccessful...");
    Running tool: Java Compile
    /media/disk/projects/numbered/all/TestCompile.java:10: ')' expected
                  System.out.println("The url is ...=" url);
                                                      ^
    /media/disk/projects/numbered/all/TestCompile.java:10: illegal start of expression
                  System.out.println("The url is ...=" url);
                                                          ^
    /media/disk/projects/numbered/all/TestCompile.java:13: ')' expected
                  System.out.println("the image is ...=" image);
                                                        ^
    /media/disk/projects/numbered/all/TestCompile.java:13: illegal start of expression
                  System.out.println("the image is ...=" image);
                                                              ^
    /media/disk/projects/numbered/all/TestCompile.java:17: illegal start of expression
                  /handled in paintComponent()
                  ^
    /media/disk/projects/numbered/all/TestCompile.java:17: ';' expected
                  /handled in paintComponent()
                          ^
    /media/disk/projects/numbered/all/TestCompile.java:17: ';' expected
                  /handled in paintComponent()
                                            ^
    7 errors
    Why are you wasting our time by putting some 'approximate representation' of the code you are using?
    Further, your use of the '..' prefix is probably causing problems. Instead try..
    url = getClass().getResource("/images/Leo.bmp");

  • Is there a way of preventing Mavericks from tagging autosaves?

    I really dig the new tags, it's great being able to keep all the files for a current multimetia project organised in one location. However, all this beautiful organisation is somewhat spoiled when this 'tag group' is filled with autosaves. The issue I'm having so far is specifically with Logic Pro saves, but I imagine any other program with an autosave feature will have its autosaves tagged as well (please correct me if I'm wrong on this).
    Is there a way of getting round this? Is this an important feature that everbody except me thinks is really useful?
    Any help would be much appreciated,
    Thanks!
    Tronk

    Maybe this post (there is also a link to a Youtube tutorial) can clarify:
    Why choose Standard over Simple action? - Captivate blog
    Although this was written for CP6, everything is also valid for CP8

  • Meta migration ant task throw exception

    Hi,
    I am trying the migration from kodo 2 to 3.
    I successfully migrated the properties file using the integrated ant
    task; but run into some problem with the meta data migration (the *.jdo
    files). following is the ant task I am using:
    <target name="migrate-meta" depends="init, prepare-jdo-meta, compile" >
    <!-- define the kodo2migrator task; this can be done at the top
    of -->
    <!-- the build.xml file, so it will be available for all
    targets -->
    <taskdef name="kodo2migrator"
    classname="kodo.jdbc.ant.Kodo2MigratorTask">
    <classpath>
    <pathelement
    path="${java.class.path}:${project.classpath}:${project.build.jdometa.dtd}"/>
    </classpath>
    </taskdef>
    <!-- invoke migrator on all .jdo files below the src directory -->
    <kodo2migrator>
    <classpath>
    <pathelement
    path="${java.class.path}:${project.classpath}:${project.build.jdometa.dtd}"/>
    </classpath>
    <fileset dir="${project.kodo.src}">
    <include name="**/*.jdo" />
    </fileset>
    <config properties="${jdo.properties}" />
    </kodo2migrator>
    </target>
    the exception it is throwning is :
    [kodo2migrator] kodo.jdbc.migration.kodo2.util.FatalUserException: The
    specified driver class "null" is neither a java.sql.Driver nor a
    javax.sql.DataSource. Please specify a valid driver in the
    javax.jdo.option.ConnectionDriverName property.
    [kodo2migrator] at
    kodo.jdbc.migration.kodo2.schema.ConfigurationConnector.createConnectionFactory(ConfigurationConnector.java:108)
    [kodo2migrator] at
    kodo.jdbc.migration.kodo2.schema.ConfigurationConnector.<init>(ConfigurationConnector.java:65)
    [kodo2migrator] at
    kodo.jdbc.migration.kodo2.schema.ConfigurationConnector.<init>(ConfigurationConnector.java:57)
    [kodo2migrator] at
    kodo.jdbc.migration.kodo2.schema.ConfigurationConnector.<init>(ConfigurationConnector.java:37)
    [kodo2migrator] at
    kodo.jdbc.migration.kodo2.Kodo2Migrator.migrate(Kodo2Migrator.java:161)
    [kodo2migrator] at
    kodo.jdbc.migration.kodo2.Kodo2Migrator.run(Kodo2Migrator.java:1141)
    [kodo2migrator] at
    kodo.jdbc.ant.Kodo2MigratorTask.executeOn(Kodo2MigratorTask.java:53)
    [kodo2migrator] at
    com.solarmetric.ant.TaskBase.execute(TaskBase.java:105)
    [kodo2migrator] at
    org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:193)
    [kodo2migrator] at org.apache.tools.ant.Task.perform(Task.java:341)
    [kodo2migrator] at
    org.apache.tools.ant.Target.execute(Target.java:309)
    [kodo2migrator] at
    org.apache.tools.ant.Target.performTasks(Target.java:336)
    [kodo2migrator] at
    org.apache.tools.ant.Project.executeTarget(Project.java:1339)
    [kodo2migrator] at
    org.apache.tools.ant.Project.executeTargets(Project.java:1255)
    [kodo2migrator] at org.apache.tools.ant.Main.runBuild(Main.java:609)
    [kodo2migrator] at org.apache.tools.ant.Main.start(Main.java:196)
    [kodo2migrator] at org.apache.tools.ant.Main.main(Main.java:235)
    BUILD FAILED
    file:/home/tyang/eclipse/workspace/UMA/build.xml:208:
    kodo.jdbc.migration.kodo2.util.FatalUserException: The specified driver
    class "null" is neither a java.sql.Driver nor a javax.sql.DataSource.
    Please specify a valid driver in the
    javax.jdo.option.ConnectionDriverName property.
    the properties file I am using is like this: (just a snipet)
    javax.jdo.PersistenceManagerFactoryClass:
    kodo.jdbc.runtime.JDBCPersistenceManagerFactory
    javax.jdo.option.ConnectionDriverName: org.postgresql.Driver
    javax.jdo.option.ConnectionURL: jdbc:postgresql://127.0.0.1/cwdevdb
    javax.jdo.option.ConnectionUserName: cwdev
    javax.jdo.option.ConnectionPassword:
    javax.jdo.option.DefaultFetchBatchSize: 10
    javax.jdo.option.DefaultFetchThreshold: 30
    javax.jdo.option.IgnoreCache: true
    javax.jdo.option.NontransactionalRead: true
    javax.jdo.option.NontransactionalWrite: false
    javax.jdo.option.Optimistic: true
    javax.jdo.option.RestoreValues: false
    javax.jdo.option.RetainValues: false
    kodo.ConnectionFactoryProperties: MaxActive=20, MaxWait=5000
    kodo.ConnectionRetainMode: persistence-manager
    kodo.DataCache: true(CacheSize=10000)
    kodo.LicenseKey: xxxx-xxxx-xxxx-xxxx-xxxx
    kodo.ManagedRuntime: TransactionManagerName=java:/TransactionManager
    kodo.PersistenceManagerImpl: CloseOnManagedCommit=true
    kodo.QueryCache: true
    kodo.RemoteCommitProvider: sjvm(Topic=topic/KodoCacheTopic)
    kodo.jdbc.DBDictionary: postgres(StoreCharsAsNumbers=false)
    kodo.jdbc.SequenceFactory: PrimaryKeyColumn=PKX,
    SequenceColumn=SEQUENCEX, TableName=JDO_SEQUENCEX
    To make sure this IS the one it is using, not only I echo out the
    "${jdo.properties}" value, but also I tried to comment out the
    licenseKey line, then it threw "license key invalid" exception. so I am
    sure this is the properties file I am using in that ant task.
    Also I tried using the command line on one of our classes, it does not
    run into this problem.
    Any clue what I am missing?
    Thanks a lot,
    Tao

    The 3.0.0 migrator task has a couple of bugs. These will be ironed out
    in 3.0.1, which is due for release any day now. But if you must work
    around the bugs immediately, you'll have to:
    1. Run the task using your old properties file. Actually this will be a
    requirement even in 3.0.1; that's why in the migration chapter of the
    docs we say to migrate your metadata before your properties. The
    migration tool needs to access 2.5 properties to map your classes properly.
    2. Add the the following property to your old properties file:
    kodo.LicenseKey: <your license key>
    3. Name the properties file "kodo.properties" and place it in one of the
    directories listed in the ant task's CLASSPATH. If that doesn't work,
    place it in a directory in your system CLASSPATH. The 3.0.0 task has
    some classpath problems, and also the <config> task element doesn't work.
    Or, you could just set your system CLASSPATH and run the kodo2migrator
    tool from the command line.
    I hope this helps. As I said, 3.0.1 resolves these ant problems, and
    will be released very shortly.

  • How to organize assets in Adobe Audition

    I've been exporting my Premiere Pro sessions to Audition for mixing and have liked the flexibility of what Audition can do.  But I've also been completely baffled by how one organizes assets in an efficient way (such as using folders or bins like in After Effects or Premiere).  I'm only editing a :60 trailer and I'm getting lost trying to find the files I need.  I can't imagine trying to do audio-post on a short film (or god forbid any kind of feature) if this option doesn't exist.  I've googled around and have found people asking this questions since 2009, with none of them answered.
    Sometimes this sort of thing happens and I'm pleasantly surprised that there's an easy option I somehow missed.
    Often times, I'm convinced that if Adobe built automobiles like it makes software, the cars would have no turn signals or headlights.
    I'm afraid we have a "headlight" moment here.  Please, someone prove me wrong.
    Thanks for any help.

    Yes, the over-arching project, and the organisation of assets into bins is the making of Premiere.  All the audio files I use in my Premiere projects have been edited in Audition, using the round trip method from within Premiere.  With care I can put the extracted audio files from Premiere within my Windows folder structure for the video project.  Left to itself, Audition puts them in an obscure corner of my User folder within the Windows installation - the last thing I want in there is multi-megabyte audio files.
    I have often wondered how you guys who work primarily with audio and no attached video cope with project organisation.  Even with my Premiere based use of Audition, a project/"bin" based structure for Audition would be very useful.  This is because I extract the audio from all my video files, and then work exclusively in Audition.  Finally, when the audio edit is done, I import my nice clean audio files back into Premiere.

Maybe you are looking for