WAMP doesn't refresh files - file

I've been working with WAMP for 2 years now and it's the first time I got this problem. I created a new website base with Symfony, and now I'm adding some files to it in Windows (by creating a bundle in a console) but it doesn't appear in the browser in localhost even I refresh it, so when I go in /web, I got those errors like these :
( ! ) Fatal error: Uncaught Error: Class 'SNS\PlatformBundle\SNSPlatformBundle' not found in D:\wamp\www\sns_symfony\sns_symfony\app\AppKernel.php on line 20
( ! ) Error: Class 'SNS\PlatformBundle\SNSPlatformBundle' not found in D:\wamp\www\sns_symfony\sns_symfony\app\AppKernel.php on line 20
Call Stack
# Time Memory Function Location
1 0.0010 385736 {main}( ) ...\app.php:0
2 0.0070 418000 AppKernel->handle( ) ...\app.php:19
3 0.0070 418000 AppKernel->boot( ) ...\Kernel.php:195
4 0.0070 418000 AppKernel->initializeBundles( ) ...\Kernel.php:132
5 0.0070 417952 AppKernel->registerBundles( ) ...\Kernel.php:492
Can someone help me please ? ^^'
I'll explain myself more. I used the bundle generator of Symfony so I dind't write anything, juste used the console. By the way there is some folders that WAMP can't see (I don't see them in the browser in localhost) and the file he's looking for are in those folders he can't see. There is the problem.

First of all, double check if the bundle really exists on your hard drive. You're on Windows, so just go to D:\wamp\www\sns_symfony\sns_symfony\src and check if there's a PlatformBundle\SNSPlatformBundle.php in your src dir. If not - now you know the generator didn't generate anything. Maybe accidentally aborted?
Then check if you have right PSR-0 or PSR-4 (most likely ) namespace in your composer.json file. You can run php composer validate to see warnings.
And as the last step run composer dump-autoload which updates the autoload file

Finally I found the solution after hours of deeps researches. Here it is :
Create the bundle
Edit your app/config/config.yml file like (add templating: engines ['twig'] in framework:)
framework:
templating:
engines: ['twig']
Thanks for help people ! :D
SOLVED !

Related

Codename one - Android build error

I encounter an error when trying to send my app to the server for building (android). Netbeans outputs the following message (actual username removed):
Prompting for password
Building for username: <actualUsernameHere>
/home/user/NetBeansProjects/OPKP/build.xml:338: The attribute can't be empty
BUILD FAILED (total time: 6 seconds)
Build.xml (around line 338):
<target name="build-for-android-device" depends="clean,copy-android-override,copy-libs,jar,clean-override">
<codeNameOne
jarFile="${dist.jar}"
displayName="${codename1.displayName}"
packageName = "${codename1.packageName}"
mainClassName = "${codename1.mainName}"
version="${codename1.version}"
icon="${codename1.icon}"
vendor="${codename1.vendor}"
subtitle="${codename1.secondaryTitle}"
targetType="android"
keystoreAlias="${codename1.android.keystoreAlias}"
keystore="${codename1.android.keystore}"
certPassword="${codename1.android.keystorePassword}"
automated="${automated}"
/> //line 338
</target>
Also Codename One settings won't show up...
It stared when I received this error:
Cannot use a cn1lib with java version greater then the project java version
At the same time Netbeans had a problem with JavaFX. So I downloaded the latest jdk and add a hint in codename one: java.version -> 8. This fixed both issues, but now I can't build my app.
EDIT:
Codename_settings.properties file (some info are hidden, but are present in the file):
#
#Tue Jul 11 14:27:58 CEST 2017
codename1.ios.appid=
codename1.ios.release.provision=
codename1.arg.java.version=8
codename1.arg.rim.obfuscation=false
codename1.arg.ios.project_type=ios
foobarfoo=This is a description of what we are going to do
codename1.arg.ios.interface_orientation=UIInterfaceOrientationPortrait\:UIInterfaceOrientationPortraitUpsideDown\:UIInterfaceOrientationLandscapeLeft\:UIInterfaceOrientationLandscapeRight
codename1.displayName=
codename1.android.keystoreAlias=
codename1.ios.release.certificate=
codename1.arg.ios.background_modes=,bluetooth-central,bluetooth-peripheral
codename1.android.keystorePassword=<actualPassHidden>
codename1.ios.provision=
codename1.arg.ios.add_libs=;CoreBluetooth.framework
codename1.arg.ios.dsym=false
codename1.arg.android.release=true
roid.keystoreAlias=<actualAliasHidden>
codename1.arg.ios.statusbar_hidden=false
codename1.languageLevel=5
codename1.android.keystore=<actualPathHidden>
codename1.arg.ios.pods=,Cordova
codename1.vendor=CodenameOne
codename1.arg.win.ver=8
codename1.ios.certificatePassword=
codename1.ios.debug.certificatePassword=
codename1.mainName=Main
codename1.ios.release.certificatePassword=
codename1.arg.ios.prerendered_icon=false
codename1.ios.debug.certificate=
libVersion=169
codename1.arg.android.xpermissions=<uses-permission android\:name\="android.permission.BLUETOOTH"/><uses-permission android\:name\="android.permission.BLUETOOTH_ADMIN"/><uses-permission android\:name\="android.permission.ACCESS_COARSE_LOCATION"/>
codename1.arg.ios.application_exits=false
codename1.secondaryTitle=CodenameOne_Template
codename1.description=
codename1.ios.debug.provision=
codename1.arg.build.incSources=1
codename1.arg.j2me.nativeThemeConst=0
codename1.rim.certificatePassword=
codename1.version=2.0
codename1.ios.certificate=
codename1.icon=icon.png
codename1.rim.signtoolCsk=
codename1.arg.ios.plistInject=<key>NSBluetoothPeripheralUsageDescription</key><string>${foobarfoo}</string>
codename1.arg.android.debug=false
codename1.rim.signtoolDb=
codename1.arg.ios.includePush=false
codename1.arg.ios.testFlight=false
codename1.packageName=com.ijs.opkp
Does anyone know what can be the problem?
Looking thru the entries in the properties vs. the XML it seems the displayName property is blank. I didn't check everything but that seems to be an issue.

R - error installing caret package

> Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()),
> versionCheck = vI[[j]]) : namespace ‘pbkrtest’ 0.4-2 is being
> loaded, but >= 0.4.4 is required
> Error: package or namespace load
> failed for ‘caret’
Caret was working fine until I tried to load Rcpp and it messed everything up.
I searched the answers for a similar problem with caret but the solutions posted did not seem to work on mine. I followed:
install.packages("caret", dependencies = TRUE)
But it did not work.
I would suggest you to check the R version. I updated the version to 3.5.1 and it works perfectly :)
Mac only – use updateR
Similar to installr, updateR is the package to help updating R on Mac OS.
The R code you will need are the following 5 lines:
install.packages('devtools') #assuming it is not already installed
library(devtools)
install_github('andreacirilloac/updateR')
library(updateR)
updateR(admin_password = 'Admin user password')
I have the same problem with my dynlm package. I get the same error. But as R states pbkrtest is required. This package isn't available under R 3.2.3.
However you can download the package online, look a bit further on this site, the question is already asked on stackoverflow and they gave a site where you can find the packages. Then write the following code:
install.packages("...",repos = NULL, type="source")
install.packages("pbkrtest", dependencies = TRUE)
In the first line, here I wrote the 3 dots you need to write the path to the file where you placed the pbkrtest-package.
I also faced the same problem with caret package and I could solve it as the following:
install.packages("lme4", dependencies = TRUE)
library(lme4)
methods(sigma)
install.packages("pbkrtest", dependencies = TRUE)
library(caret)
This worked for me!
Try
install.packages('DEoptimR')
and followed by
install.packages("caret", dependencies = TRUE)
I had the same issues. Both of these commands worked for me.
I faced the same error with caret and none of the above suggestions helped. My R version was 3.2 and current version is 3.4.
I installed the new version and the issue was resolved
I have faced this issue and tried many ways but followed r console about error thrown and started downloading packages one by one. steps noted down what i did for this. y r studio version is "R version 3.4.4"
First install.packages("caret"), install.packages("ggplot2"), install.packages("lattice"), install.packages("lava")..
then load library(ggplot2) then library(lattice) then library(lava) and then finally library(caret).
What i believe that caret have these packages dependency so once caret is installed ideally 'install.packages('caret', dependencies = TRUE)' should work but it was not working in my R version so i did the step as given above and it worked for me.
hope it may work if someone get this issue
I did try all the above mentioned ways to install and activate caret but none worked for me.
finally what I did was to go to my drive location where R libraries are located. I removed a folder called "caret" and then in R studio I run "remove.packeges("caret")" to remove the caret package.
then I reinstalled the package.
install.packages("caret")
library(caret)
it worked for me.
I'm in R 3.6.1 and got the same error today.
I used this code:
install.packages("caret",dep = TRUE)
install.packages("ggplot2")
install.packages("lattice")
install.packages("lava")
install.packages("purrr")
library(ggplot2)
library(lattice)
library(lava)
library(purrr)
library(caret)
And now it works fine for me. It's all about dependencies that you should install with caret.
Use this:
install.packages(c("ggplot2", "lattice", "lava", "purrr", "caret"))
library(c("ggplot2", "lattice", "lava", "purrr", "caret"))
If that doesn't work, create a folder (R_LIB in this case) on your computer (documents in this case) and include the folder location as follow:
install.packages(c("ggplot2", "lattice", "lava", "purrr", "caret"), lib = "C:/documents/R_LIB")
library(c("ggplot2", "lattice", "lava", "purrr", "caret"), lib = "C:/documents/R_LIB")

Getting StringIndexOutOfBoundsException when attempting to create a new Form in Codenameone

I am using Netbeans and updated to use the latest codenameone plugin. I am trying to follow the walkthrough tutorial at http://www.codenameone.com/blog/gui-builder-walkthru.html, but I keep on getting a StringIndexOutOfBoundsException when attempting to generate a new Form using the NewGuiBuilderWizardIterator. The following is the stacktrace that I'm seeing. Any and all help would be greatly appreciated!
SEVERE [com.codename1.actions.OpenGuiBuilderAction]: Relative path com\mycompany\myapp\MyApp.java
SEVERE [com.codename1.actions.OpenGuiBuilderAction]: Gui file C:\Users\joshua\Documents\NetBeansProjects\TestGui1\res\guibuilder\com\mycompany\myapp\MyApp.gui
SEVERE [com.codename1.actions.OpenGuiBuilderAction]: Props C:\Users\joshua\Documents\NetBeansProjects\TestGui1\codenameone_settings.properties
SEVERE [com.codename1.actions.OpenGuiBuilderAction]: The GUI file doesn't exist!
WARNING [org.openide.filesystems.Ordering]: Found same position 100 for both Loaders/application/res/Actions/org-openide-actions-OpenAction.shadow and Loaders/application/res/Actions/sep-1.instance
WARNING [org.netbeans.modules.java.JavaTemplateAttributesProvider]: No classpath was found for folder: C:\Users\joshua\Documents\NetBeansProjects\TestGui1#b78894d2:1aed2d64
WARNING [org.openide.WizardDescriptor]
java.lang.StringIndexOutOfBoundsException: String index out of range: -4
at java.lang.String.substring(String.java:1919)
at com.codename1.NewGuiBuilderWizardIterator.instantiate(NewGuiBuilderWizardIterator.java:95)
at org.openide.loaders.TemplateWizard$InstantiatingIteratorBridge.instantiate(TemplateWizard.java:1046)
at org.openide.loaders.TemplateWizard.handleInstantiate(TemplateWizard.java:605)
at org.openide.loaders.TemplateWizard.instantiateNewObjects(TemplateWizard.java:439)
at org.openide.loaders.TemplateWizardIterImpl.instantiate(TemplateWizardIterImpl.java:248)
at org.openide.loaders.TemplateWizardIteratorWrapper.instantiate(TemplateWizardIteratorWrapper.java:160)
at org.openide.WizardDescriptor.callInstantiateOpen(WizardDescriptor.java:1629)
at org.openide.WizardDescriptor.callInstantiate(WizardDescriptor.java:1570)
at org.openide.WizardDescriptor.access$2300(WizardDescriptor.java:92)
[catch] at org.openide.WizardDescriptor$Listener$2$1.run(WizardDescriptor.java:2257)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1423)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
You need to select a package when you do this and not the top level project since the code won't recognize that situation and won't know where to place the GUI file.
Notice that since an XML GUI file is created in the background, refactoring after the fact won't work well so this isn't something we should generally fix.

Access to shared_path in deploy.rb

I try to set command map using shared_path like that:
SSHKit.config.command_map[:composer] = "php #{shared_path.join('composer.phar')}"
But the path is /var/www/xxx not using the path I set on :deploy_to deploy/staging.rb.
I guess this is because staging.rb is loaded after.
What the right way then?
I had the same issue and although I don't think I have found the best way. I have found a way.
My default :deploy_to in deploy.rb points to '/var/www/my_app'. And I have a development stage where the server uses the same path. But my production server uses '/home/httpd/something/else' so I put :deploy_to in production.rb expecting it to deploy to that path. And everything works except the composer command. The composer.phar file is downloaded to the correct shared path and the files are deployed correctly. But when composer runs it tries to find it in '/var/www/my_app/shared'.
What I did was instead of putting the SSHKit.config.command_map by it self in deploy.rb, put it in a task. Something like:
namespace :deploy do
before :starting, :map_composer_command do
on roles(:app) do |server|
SSHKit.config.command_map[:composer] = "#{shared_path.join("composer.phar")}"
end
end
...
end
It feels like SSHKit.config.command_map runs "to early" or something. This seems to help. It works for me at least. And I had the exact same issue.
Edit:
I got some help from an issue I posted on capistrano/composer.

AssetCompress for CakePHP 1.3

I'm using AssetCompress v0.5 from the 1.3 branch and the dynamic built is not working. I've done the following so far:
Downloaded and copied the asset_compress folder into my app/plugins folder
Copied the config.ini and renamed it to app/config/asset_compress.ini
Created 2 CSS and JS bundles named public and logged (so 4 in total)
Added AssetCompress.AssetCompress in my $helpers array in my AppController
Changed my default.ctp layout file to: echo $this->AssetCompress->css('public'); echo $this->AssetCompress->css('logged'); (same for ->script())
The output error is:
Error: The requested address '/asset_compress/assets/get/public.css' was not found on this server.
What am I missing?
Ok, I figured it out.
It was because I was using the CssMin filter and I did not download it and put it into the vendor folder. As the plugin seems to be turning the debug level to 0, I did not see the error, until I put a Configure::write('debug', 2); into the beforeFilter().

Resources