How to use text files in RandomAccessFile both are in same Jar file

when double click the executable jar file the class file contains the RandomAccessFile ,it will not take the text files,both the files are in jar file

I used this:
Scanner fileScan = new Scanner (new file
("Words.txt"));
but when I make a jar file, it doesnt find the txt
file inside a jar,
do I need to specify path or something?I have already told you that you shouldn't use new File(..) you should use getResourceAsStream(String name) to get an InputStream to the file.
Kaj

Similar Messages

  • Initiating a deployment task with id 0,1,2,3...same jar file

    I have been deploying a single EJB jar file but my server starts redeploying same
    jar file until I kill the sever its keep doing this, because it deployed jar (EJB
    component) once successfully, all of next attempt cause "NameAlreadyBoundException".
    I don’t know why it is re deploying same component? Please help.
    pls look at this statement from myserver.log file..
    Initiating a deployment task with id 0 for application appsdirtitanapp_dir
    preparing application appsdirtitanapp_dir on myserver
    EJB Deploying file: titanapp\titanejb.jar
    prepared application appsdirtitanapp_dir on myserver
    activating application appsdirtitanapp_dir on myserver
    EJB Deployed EJB with JNDI name CabinHomeRemote.
    activated application appsdirtitanapp_dir on myserver
    Configuration changes for domain saved to the repository.
    Completing a deployment task with id 0 for application appsdirtitanapp_dir with
    status Completed
    Initiating a deployment task with id 1 for application appsdirtitanapp_dir-0
    I am using Weblogic 7 and using workbook example of Monson-Haefel book.
    Thanks in advance.
    Kumar

    This looks like a bug.
    Is there something in your app which makes it modify the timestamp of the
    root directory or rootDir/META-INF/REDEPLOY file ? That would be the only
    valid reason for the auto deployment to keep triggering. If that is the case
    you might want to use weblogic.Deployer.
    "Kumar" <[email protected]> wrote in message
    news:[email protected]..
    >
    I have been deploying a single EJB jar file but my server startsredeploying same
    jar file until I kill the sever its keep doing this, because it deployedjar (EJB
    component) once successfully, all of next attempt cause"NameAlreadyBoundException".
    >
    I don't know why it is re deploying same component? Please help.
    pls look at this statement from myserver.log file..
    Initiating a deployment task with id 0 for application
    appsdirtitanapp_dir
    preparing application appsdirtitanapp_dir on myserver
    EJB Deploying file: titanapp\titanejb.jar
    prepared application appsdirtitanapp_dir on myserver
    activating application appsdirtitanapp_dir on myserver
    EJB Deployed EJB with JNDI name CabinHomeRemote.
    activated application appsdirtitanapp_dir on myserver
    Configuration changes for domain saved to the repository.
    Completing a deployment task with id 0 for application
    appsdirtitanapp_dir with
    status Completed
    Initiating a deployment task with id 1 for application
    appsdirtitanapp_dir-0
    I am using Weblogic 7 and using workbook example of Monson-Haefel book.
    Thanks in advance.
    Kumar

  • How do i use a 2nd airport extreme both are newer models

    how do i use a 2nd airport extreme both are newer models

    I assume that you mean that you want to extend the range using wireless only.
    This Apple Support Document will tell you exactly how to do that:
    http://support.apple.com/kb/HT4259
    The instructions assume that you have AirPort Utility 5.6 for Mac OS X Lion , so if you have not already done so, you will need to download and install this application to track the instructions in the support document.

  • How to use text-to-speech so that my text messages are read to me in the car?

    How to use text-to-speech so that my text messages are read to me in the car?

    I have the same question but I have iPhone 5

  • TFS Build Error - Exception Message: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters

    I am trying to set-up CI of Orchard CMS and deploy it on Azure using TF service. I am stuck at following error for path being
    longer than 260 characters. However, when counted the total characters in path are 235. Please see the below error :
    Other Errors and Warnings
    1 error(s), 1 warning(s)
    Exception Message: TF400889: The following path contains more than the allowed 259 characters: drop/_PublishedWebsites/Orchard.Web_Package/Archive/Content/C_C/a/src/projects/Orchard/dev/DevAltaf/Orchard/src/Orchard.Web/obj/Debug/Package/PackageTmp/Modules/BrentApart.BannerManager/Scripts/controllers/bannerAssignmentController.js. Specify a shorter path. (type VssServiceException)
    Exception Stack Trace: at Microsoft.TeamFoundation.Build.Workflow.Activities.FileContainerDropProvider.EndCopyDirectory(IAsyncResult result)
    at Microsoft.TeamFoundation.Build.Workflow.Activities.CopyDirectory.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
    at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
    Inner Exception Details:
    Exception Message: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. (type PathTooLongException)
    Did anyone came across such issue while deploying Orchard on Azure with TF service? If yes, how did you sort this freaking error?
    Thanks,
    Altaf B.

    Hi AltafB,
    For your situation, you can short the path for the source code. Or use a short path for build agent folder in your build definition. You can refer to the links below to solve your problem:
    http://blogs.msdn.com/b/aaronhallberg/archive/2007/06/20/team-build-and-260-character-paths.aspx
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/1638a5f0-9321-4ff9-9ee7-6d347badb972/please-some-solution-to-the-specified-path-file-name-or-both-are-too-long?forum=tfsbuild
    Besides, since you deploy Orchard to Azure, you can also publish it directly using publish profile in Visual Stduio or WebMatrix directly.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Powershell Get-childItem: The specified path, file name, or both are too long.

    Hey Scriping Guys!
    I've been using a PowerShell script for a couple of years now to generate a monthly report showing the size of user folders on a number of departmental file servers.  It's working just fine on all file servers except one where the users have gotten carried away with creating sub-folders and using realy long descriptive file names.  The problem piece of script is this:
    $colItems = (Get-ChildItem \\192.168.10.5\marketing -recurse | Measure-Object -property length -sum)
    "marketing-serv\marketing: "+"{0:N2}" -f ($colItems.sum / 1GB) + " GB"
    The reply I get is:
    Get-ChildItem : The specified path, file name, or both are too long. The fully
    qualified file name must be less than 260 characters, and the directory name mu
    st be less than 248 characters.
    At G:\data\Server_space_Report\serverspace2.ps1:37 char:27
    + $colItems = (Get-ChildItem  <<<< \\192.168.10.5\marketing -recurse | Measure-Obje
    ct -property length -sum)
    Yes, the message is correct, however, when I connect to the server, right click the folder and chose properties it returns a size of 128 GB.  My questions are
    1. Why does clicking on folder properties not produce an error (what is it doing differently from my script)?
    2. How can I fix my script?
    Thanks,

    I am trying to clear up the older open posts on this forum. If this is still an unresolved issue for you please let me know. If you do not post back within one week I will assume it is resolved and will close this thread.
    Thank you
    Ed Wilson
    Microsoft Scripting Guy

  • IPhone question:  Im trying to update applications on my iphone.  When I do it I'm as for password from a different Apple ID from what I have in Itunes.  How do I change so that both are the same?

    IPhone question:  Im trying to update applications on my iphone.  When I do it I'm as for password from a different Apple ID from what I have in Itunes.  How do I change so that both are the same?

    All apps are tied to the apple id that it was used to purchase or download the app.
    did you use a different id to buy the app?
    you can change id, settings - appstore - apple id - log out and log in with correct id.

  • SharePoint 2010, Visual Studio 2010, Packaging a solution - The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

    Hi,
    I have a solution that used to contain one SharePoint 2010 project. The project is named along the following lines:
    <Company>.<Product>.SharePoint - let's call it Project1 for future reference. It contains a number of features which have been named according
    to their purpose, some are reasonably long and the paths fairly deep. As far as I am concerned we are using sensible namespaces and these reflect our company policy of "doing things properly".
    I first encountered the following error message when packaging the aforementioned SharePoint project into a wsp:
    "The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters."
    I went through a great deal of pain in trying to rename the project, shorten feature names and namespaces etc... until I got it working. I then went about gradually
    renaming everything until eventually I had what I started with, and it all worked. So I was none the wiser...not ideal, but I needed to get on and had tight delivery timelines.
    Recently we wanted to add another SharePoint project so that we could move some of our core functinality out into a separate SharePoint solution - e.g. custom workflow
    error logging. So we created another project in Visual Studio called:
    <Company>.<Product>.SharePoint.<Subsystem> - let's call it Project2 for future reference
    And this is when the error has come back and bitten me! The scenario is now as follows:
    1. project1 packages and deploys successfully with long feature names and deep paths.
    2. project2 does not package and has no features in it at all. The project2 name is 13 characters longer than project1
    I am convinced this is a bug with Visual Studio and/or the Package MSBuild target. Why? Let me explain my findings so far:
    1. By doing the following I can get project2 to package
    In Visual Studio 2010 show all files of project2, delete the obj, bin, pkg, pkgobj folders.
    Clean the solution
    Shut down Visual Studio 2010
    Open Visual Studio 2010
    Rebuild the solution
    Package the project2
    et voila the package is generated!
    This demonstrates that the package error message is in fact inaccurate and that it can create the package, it just needs a little help, since Visual Studio seems to
    no longer be hanging onto something.
    Clearly this is fine for a small time project, but try doing this in an environment where we use Continuous Integration, Unit Testing and automatic deployment of SharePoint
    solutions on a Build Server using automated builds.
    2. I have created another project3 which has a ludicrously long name, this packages fine and also has no features contained within it.
    3. I have looked at the length of the path under the pkg folder for project1 and it is large in comparison to the one that is generated for project2, that is when it
    does successfully package using the method outlined in 1. above. This is strange since project1 packages and project2 does not.
    4. If I attempt to add project2 to my command line build using MSBuild then it fails to package and when I then open up Visual Studio and attempt to package project2
    from the Visual Studio UI then it fails with the path too long error message, until I go through the steps outlined in 1. above to get it to package.
    5. DebugView shows nothing useful during the build and packaging of the project.
    6. The error seems to occur in
    CreateSharePointProjectService target called at line 365 of
    Microsoft.VisualStudio.SharePoint.targetsCurrently I am at a loss to work out why this is happening? My next task is to delete
    project2 completely and recreate it and introduce it into my Visual Studio solution.
    Microsoft, can you confirm whether this is a known issue and whether others have encountered this issue? Is it resolved in a hotfix?
    Anybody else, can you confirm whether you have come up with a solution to this issue? When I mean a solution I mean one that does not mean that I have to rename my namespaces,
    project etc... and is actually workable in a meaningful Visual Studio solution.

    Hi
    Yes, I thought I had fixed this my moving my solution from the usual documents  to
    c:\v2010\projectsOverflow\DetailedProjectTimeline
    This builds ok, but when I come to package I get the lovely error:
    Error 2 The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. C:\VS2010\ProjectsOverflow\DetailedProjectTimeline\VisualDetailedProjectTimelineWebPart\Features\Feature1\Feature1.feature VisualDetailedProjectTimeline
    Now, the error seems to be related to 
    Can anyone suggest what might be causing this. Probably some path in an XML file somewhere. Here is my prime suspect!
    <metaData>
    <type name="VisualDetailedProjectTimelineWebPart.VisualProjectTimelineWebPart.VisualProjectTimeline, $SharePoint.Project.AssemblyFullName$" />
    <importErrorMessage>$Resources:core,ImportErrorMessage;</importErrorMessage>
    </metaData>
    <data>
    <properties>
    <property name="Title" type="string">VisualProjectTimelineWebPart</property>
    <property name="Description" type="string">My Visual WebPart</property>
    </properties>
    </data>
    </webPart>
    </webParts>
    .... Unless I can solve this I will have to remove the project and recreate but with simple paths. Tho I will be none the wiser if I come across this again.
    Daniel

  • Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

    Hi, Im trying to get the whole path in my server, so i tried that with this following code
    Get-ChildItem $sourceFolder  -Recurse | ?{$_.PsIsContainer} |Get-Acl
    But then, it showed me somtehing like this :
    Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
     I tried to find the solver everywhere and mostly they propose to change the path name, which is impossible, since I am working with my company server, and those folder have already there before i start to work here, then the other ask me to use robocopy,
    but all of the trick just dont work
    is there any way to solve this problem? thanks

    There is no simple solution to this. And it is not a limitation of powershell itself, but of the underlying NTFS file system.
    If the problem is that a folder with a name longer than 248 exists anywhere within your directory structure, you are hooped.
    If the problem is that some fully qualified path names exceed 260 characters, then, in those cases, the solution already given is to create a psdrive partway up the path from the drive letter or server/share root of the path. Unfortunately, the output produced
    will be relative to that psdrive and not to what is specified as the $sourcefolder.
    unless you already know where those problematic paths are, you might consider trying to trap those errors and have your script figure out where it needs to create psdrives. You might then be able to calculate the equivalent path for each file or folder and
    output that. the programming effort would be simpler to just created a psdrive for each folder encountered, however I expect that would be very inefficient.
    Al Dunbar -- remember to 'mark or propose as answer' or 'vote as helpful' as appropriate.

  • How do i have landscape and portrait slides in the same keynote file?

    how do i create landscape and portrait slides in the same keynote file?

    You cant, its one or the other not both, the slide size setting is for the whole presentation, not for individual slides.
    The slide format is chosen to match the display the presentation is shown on. I have presentations showing on vertical, horizontal, square, circular and iregular shaped screens with rear projection, but a single format must still be set.

  • TS3274 I play candy crush both on my IPad and my samsung android, how do I synch them so they both show the same results?

    I play candy crush both on my IPad and my samsung android, how do I synch them so they both show the same results?

    We went through the same drill.
    First, decide which computer you are going to use.  One or the other.  You can't have it both ways.
    Then plug in the 'foreign' device.   Do not let it sync.  Yet. 
    Give this device a new name in the left pane in I tunes so that you all know which device is which.  You will need to authorise the computer to the new I tunes account.  You will need to transfer any purchases to that computer.  You will need to upload any photos to the photo library.
    Then sync.   Each time you plug it, it will remember the specific device, the old on, or the foreign one, and bring up its own particular arrangement as a starting point.
    You will find that by checking the boxes, you can share apps, and music.   But when you go to do updates, if you are mingling apps, each user will need to know the apple password to get updates.
    We found it to be a little confusing, but once you get used to it, using the same I tunes for 2 different accounts works ok.
    Before you do anything, please make a full backup ofmthe original device.  If something gets out of hand, you can always revert back to where your were.

  • How to use dvb to find which blocks are corrupted?

    hi
    how to use dvb to find which blocks are corrupted?
    and how to repair it from two days back user managed back up when database is in no archive log mode?
    rgrds
    Edited by: new2appsdba on Jul 30, 2010 9:50 PM

    Hi,
    Please see these documents.
    Note: 434013.1 - HOW TO TROUBLESHOOT AND RESOLVE an ORA-1110
    Note: 352907.1 - Script To Run DBV On All Datafiles Of the Database
    Note: 836658.1 - Identify the corruption extension using RMAN/DBV/ANALYZE etc
    Note: 35512.1 - DBVERIFY - Database file Verification Utility (7.3.2 - 10.2)
    Note: 403747.1 - FAQ: Physical Corruption
    Note: 28814.1 - Handling Oracle Block Corruptions in Oracle7/8/8i/9i/10g/11g
    Thanks,
    Hussein

  • How to create xml file from Oracle and sending the same xml file to an url

    How to create xml file from Oracle and sending the same xml file to an url

    SQL/XML (XMLElement, XMLForest, XMLAgg, etc) and UTL_HTTP.
    Whether that works for you with the version of Oracle you have, your requirements, and needs is another story. A little detail goes a long way.

  • Deploying 2 entity beans in the same jar file using jboss

    i have beans namely savings entity bean, checkings entity beans and teller session beans, i'm trying to deploy it with in the same jar file. but im getting an error 'savings bean : bean expects one persistance-type'. i hope someone could help me about this. its urgent. thanks

    Although I am not super familiar with Jboss, my guess is that looks like the ejb xml sheet is not specifying the persistance type correctly for an entity bean. Take a look at your ejb xml sheet or post it if necessary.
    -Dat

  • What are the basic .jar files to be set in web dynpro project classpath

    Hi,
    I am having a problem while customizing the ESS. I used DTR, DC and imported configuration. After that, I created project from one of the DC(say ess/jp/addr). Later when I open an iView from any Web Dynpro component, I am getting lot of errors without even making any modifications.
    I closed the project and reopened it and reload & rebuilt, but it doesn't solved my problem. In my classpath settings I couldn't find any jar files except the jre_lib. Could you please let me know what are the basic jar files we have to set in classpath and where to get them from. We are using NWDS 7.0.06 version.
    Can you please let me know how to solve this or any other way to work around this.
    It's an urgent to be fixed as early as possible, plz help me out.
    Thanks & Regards,
    Raj

    Hi Julien,
    Thanks for your reply.
    We imported the the specified SCAs in our track.
    we are getting the following errors.
    Kind Status Priority Description Resource In Folder Location
    Error The import com.sap.xss.per cannot be resolved CcPerAddressInterface.java NS1_XSSTR_Dessusaddrsap.com/gen_wdp/packages/com/sap/xss/hr/per/us/address/cc line 18
    Error com.sap.pcuigp cannot be resolved (or is not a valid type) for the argument fpm of the method loadConfiguration CcPerAddressInterface.java NS1_XSSTR_Dessusaddrsap.com/gen_wdp/packages/com/sap/xss/hr/per/us/address/cc line 113
    Error com.sap.pcuigp cannot be resolved (or is not a valid return type) for the method getNextPerspective CcPerAddressInterface.java NS1_XSSTR_Dessusaddrsap.com/gen_wdp/packages/com/sap/xss/hr/per/us/address/cc line 127
    Error com.sap.pcuigp cannot be resolved (or is not a valid type) for the argument currentPerspective of the method getNextPerspective CcPerAddressInterface.java NS1_XSSTR_Dessusaddrsap.com/gen_wdp/packages/com/sap/xss/hr/per/us/address/cc line 127
    Error com.sap.pcuigp cannot be resolved (or is not a valid return type) for the method getCAPState CcPerAddressInterface.java NS1_XSSTR_Dessusaddrsap.com/gen_wdp/packages/com/sap/xss/hr/per/us/address/cc line 137
    Error com.sap.pcuigp cannot be resolved (or is not a valid type) for the argument perspective of the method getCAPState CcPerAddressInterface.java NS1_XSSTR_Dessusaddrsap.com/gen_wdp/packages/com/sap/xss/hr/per/us/address/cc line 137
    we manually set below .jar files in classpath settings.
    pcuixssfpm.jar
    pcuixssutils.jar
    logging.jar
    essper.jar
    Is there any alternative to work around.
    Thanks & Regards,
    Raj

Maybe you are looking for

  • Itunes 10.3 on Windows 7 64-bit not starting up

    Itunes has always been working fine on my pc up until one day, I click on the Itunes icon, and it looks like it's loading for like 3 seconds and then it does absolutely nothing... I tried re-installing the program twice, nothing. I tried opening MsCo

  • How to print on a printable CD c309a

    My printer (Photosmart Premium 309a) came with the ability to print directly to a CD.  I used it several times.  However, after updating the software, and changing to Windows 7, with I select this option in the HP Solution Center, it says my printer

  • Exception occurred. Internal error: Cannot obtain XAConnection Creation of XAConnection for pool....

    Weblogic Server 6.1 SP2 is running fine. But unable to get XAConnections! I am getting following error java.sql.SQLException: Internal error: Cannot obtain XAConnection Creation of XAConnection for pool ibesXaConnection Pool failed after waitSecs:300

  • Immediate help needed with XML Parser

    I am currently running Oracle 8i and trying to use the XML utilities. Just to make sure things are working, I tried a very simple program. I followed the xslsample.sql code that was supplied by Oracle. Code is as follows: declare p xmlparser.parser;

  • Jms provider with SSL transport : connectException

    I have a jmsprovider that is connecting to a remote server(another domain) over SSl transport. I have trust and identity keystore created and configured. Looks like I have passed the SSL handshale stage and client side accepted trust certificate succ