NetBeans Build Failed - JasperException - web

I moved my web project to another directory. I reopened it through NetBeans from the new directory. Running it resulted in the following error:
Created dir: C:\Users\Arthur\Desktop\projectSourceCode\arthurProj\build\generated\src
org.apache.jasper.JasperException: PWC6149: The -uriroot option must specify a pre-existing directory
C:\Users\Arthur\Desktop\projectSourceCode\arthurProj\nbproject\build-impl.xml:936: Java returned: 1
BUILD FAILED (total time: 1 second)
Should I change something in the build-impl.xml file before moving the project folder? I tried "clean and build" but the same error appears. How do I "specify a pre-existing directory"?
The build-impl.xml file: http://pastebin.com/PFv2aAjh

Goto your project folder and delete build and dist folders manually.
For example, if your project path like this C:\WebProject\build\ and C:\WebProject\dist, so delete these 2 folders. Now try clean and bulid project, this will create a fresh build and dist directories.

Related

Keep build folder files for each build (Vite / SvelteKit)

When using Vite (SvelteKit) there's a hash appended to filenames when building so that the file is unique based on its contents (for example: _page.svelte-8f3ed184.js).
Currently when I run the vite build (or npm run build) the new files are built but the old files are cleared from the build folder. I would like to keep all files in the build folder on each built so that users that are currently browsing the site can still retrieve the previous build until the next time they come to the site (which would load the newer built).
Is there a setting for this in Vite? I haven't been able to find it.
Example
Build 1
"+page.svelte" file creates _page.svelte-8f3ed184.js
Build 2 ("+page.svelte" file was modified)
"+page.svelte" file creates _page.svelte-9j2dus3s.js
Currently after Build 2 only the second file is in the folder:
ls build/client/_app/immutable/components/pages/question
_page.svelte-9j2dus3s.js
What I'm looking for is after Build 2 both files are in the folder:
ls build/client/_app/immutable/components/pages/question
_page.svelte-8f3ed184.js
_page.svelte-9j2dus3s.js

Unable to duplicate template angular project in VSCode

I am starting up with angular. I have a basic angular template project ready, with some of my changes done in it:
When I do ng serve, it starts correctly in the browser.
When I copy paste it in vscode to create duplicate, it seems that it does not fully copy pastes it:
Now when I do ng serve inside this project folder, it gives me following error message:
PS E:\workspaces\angular-course\5-second-app-proj-template> ng serve
Could not find module "#angular-devkit/build-angular" from "E:\\workspaces\\angular-course\\5-second-app-proj-template".
Error: Could not find module "#angular-devkit/build-angular" from "E:\\workspaces\\angular-course\\5-second-app-proj-template".
at Object.resolve (C:\Users\anir\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\#angular-devkit\core\node\resolve.js:141:11)
at Observable.rxjs_1.Observable [as _subscribe] (C:\Users\anir\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\#angular-devkit\architect\src\architect.js:132:40)
at Observable._trySubscribe (C:\Users\anir\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\rxjs\internal\Observable.js:43:25)
at Observable.subscribe (C:\Users\anir\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\rxjs\internal\Observable.js:29:22)
at DoOperator.call (C:\Users\anir\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\rxjs\internal\operators\tap.js:29:23)
at Observable.subscribe (C:\Users\anir\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\rxjs\internal\Observable.js:24:22)
at C:\Users\anir\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\rxjs\internal\util\subscribeTo.js:22:31
at Object.subscribeToResult (C:\Users\anir\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\rxjs\internal\util\subscribeToResult.js:7:45)
at MergeMapSubscriber._innerSub (C:\Users\anir\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\rxjs\internal\operators\mergeMap.js:75:38)
at MergeMapSubscriber._tryNext (C:\Users\anir\AppData\Roaming\npm\node_modules\#angular\cli\node_modules\rxjs\internal\operators\mergeMap.js:72:14)
How should I duplicate my template angular project, to start up with new one. I went to Windows File Explorer and found that the angular project contained 28241 files, 3644 folders and is of 241 MBs. Copying this in Windows File Explorer also takes a lot of time. Am I doing anything wrong?
You forgot to copy the src folder into your duplicated project. And all project config inside a package.json are missing. You also missing all angular-cli necessary dependencies.
First:
go into your second project and make sure all files from your first project are successully copied. i.e following: src folder, package.json, tsconfig.json, tslint.json, etc...
You should go into your windows explorer folder and copy all the files and folder (excluding the node_modules folder) into your second project.
second:
if all files are copied, run npm install inside your new project in order to generate a new node_modules folder. Then ng serve should work fine as expected.

Activating extension `ms-vscode.wordcount` failed: Cannot find module 'd:/VSCode/vscode-wordcount/out/extension'

I try to build and debug an extension in Code.
I downloaded the sample of word-count from https://github.com/microsoft/vscode-wordcount.
When I clicked F5, ./out folder was not generated and I saw failure: Activating extension ms-vscode.wordcount failed: Cannot find module 'd:/VSCode/vscode-wordcount/out/extension'.
I found the post
https://github.com/Microsoft/vscode-go/issues/35
and I think this was because I failed to build the extension.
And I checked my path that node and npm were both set.
I found there were 2 possible issues.
I could not find .\node_modules folder in my extension folder. The folder structure is like
.vscode\
-- launch.json
-- settings.json
-- tasks.json
image\
test\
typings\
-- vscode-typings.d.ts
extension.ts
package.json
tsconfig.json
My node version is v0.12.2.
Could you give me some hints how to investigate the issue?
You probably downloaded directly from GitHub.
You will need to run npm install in your project's folder in order to create the node_modules directory and add the required dependencies.
If you simply want to install the extension to use it, you will also need to:
Move the folder to the correct place
npm install
OR
Install the built version directly from the Visual Studio Marketplace through the command pallet.

Node build issue on TFS

TFS Builds work on all all projects except the Node for Visual Studio Project.
I get this error:
$/IT/my-home.njsproj - 1 error(s), 0 warning(s), View Log File
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets (132): Could not copy the file "obj\Debug\my-home.exe" because it was not found.
I tried to do this below in the targets file:
<Disable_CopyWebApplication Condition="'$(Disable_CopyWebApplication)' == ''">True</Disable_CopyWebApplication>
I just came across this issue. Add this to your build arguments:
/p:Disable_CopyWebApplication=True

copy static files to build output folder in gradle

I was using ANT before (Android Project) and i had "static" files in the same packages as my code
Here is an example
src/com/my/app/test/Parser.java
src/com/my/app/test/json_to_parse.json
When executing the unit tests, the json file was copied into the gen folder, therfor it was possible to access the json in the test with
getClass().getResourceAsStream(fileName)
I had to convert the project to gradle, but now the tests are failing.
After checking the "build" folder, i've realised, the .json files are not there, therefor the getResourceAsStream method returns null.
Any idea how to include these "static" files (json, xml, ...) into the build folder?
Moving the files into the resources folder did not work out of the box in Android Studio (even though is should have)
This should be fixed in Android Studio 1.2.
However, this is what i did:
Moved all static files into the resources folder.
In my unit-test module i've added this to the build.gradle file
task copyTestResources(type: Copy) {
from "${projectDir}/src/test/resources"
into "${buildDir}/classes/test"
}
processTestResources.dependsOn copyTestResources
Now, all files located inside src/test/resources will be copied into /classes/test where i can access them with
getClass().getResourceAsStream(fileName)
If i keep the package structure inside the resources folder the same as it was in the java folder, i don't need to adjust any code.
To complete the story a bit more:
JUnit4 runner requires
getClass().getResourceAsStream(name)
while Robolectric requires
getClass().getClassLoader().getResourceAsStream(name)
The files you are asking about are called "resource files" in Maven/Gradle lingo.
Gradle assumes that you are using the Maven Standard Directory Layout.
So, either you move your files into src/test/resources (then Gradle will pick them up automatically), or you tell Gradle that it should look for resources in some other place.
In the latter case, you need to modify the processTestResources task. However, keeping resource files in the same directory as source code is a bad practice. So I advise the former option.
if your problem is happen when you create apk with AndroidStudio.
you can create a jar file that includes your resources with jar.exe
for example i put a.txt into resources directory
and run this code in cmd:
"C:\Program Files\Java\jdk1.7.0_79\bin\jar" cvfe res.jar -c resources
after that a jar file "res.jar" was created
then add that res.jar into libs folder in your project
when your apk is creating resources are added to your final apk and you can use this code to acsess a.txt:
someclass.class.getClassLoader().getResourceAsStream("resources/a.txt");
with this job no need to change Gradle setting.

Resources