Invalid Configuration – yii\base\InvalidConfigException In yii2 - yii2

I'm getting error in yii2 Invalid Configuration – yii\base\InvalidConfigException
Error :
Invalid Configuration – yii\base\InvalidConfigException
The directory does not exist:
1. in /home/dobuyme/public_html/vendor/yiisoft/yii2/web/AssetManager.phpat line 239
230231232233234235236237238239240241242243244245246247248 public function checkBasePathPermission()
{
// if the check is been done already, skip further checks
if ($this->_isBasePathPermissionChecked) {
return;
}
if (!is_dir($this->basePath)) {
echo $this->basePath;
throw new InvalidConfigException("The directory does not exist: {$this->basePath}");
}
if (!is_writable($this->basePath)) {
throw new InvalidConfigException("The directory is not writable by the Web process: {$this->basePath}");
}
$this->_isBasePathPermissionChecked = true;
}
How i can solve this issue?
it shows The directory does not exist:

Related

How to get FireError SubComponent paramerter in error handler

When we invoke the Dts.Events.FireError method in a script task, we provide the description as the third parameter. This is available to error handlers in the variable System::ErrorDescription. Is the second parameter called SubComponent available to error handlers anywhere, and if so where?
There are no variables called subcomponent. This is a field that you can use to help classify the source of an error. Suppose you had a script that downloaded a file and then unzipped it. You can use the subcomponent parameter to identify the source of the error. i.e.:
try
{
//download file
}
catch (Exception e)
{
Dts.Events.FireError(0, "Download File", e.Message, "", 0);
}
try
{
//unzip file
}
catch (Exception e)
{
Dts.Events.FireError(0, "Unzip File", e.Message, "", 0);
}
The logged error could look like this: Unzip File: File does not exist
This could be a helpful pattern for catching generic errors that could apply to different sections of the script.
System::ErrorDescription will only be available in the event handler, but could be handled in a similar way if you scoped the event to particular components.
Leave it as an empty string if you do not need it.

How to validate message body with json schema using apache camel in spring boot application

I am learning apache camel, I have created one spring boot project in which i want to validate the message body with json schema. In my project, I have create route in which i am fetching file from the location in my computer and then passing it to next endpoint where i have applied json validator component and then passed to seda endpoint where i consumed the output.
The code is as follow :
#SpringBootApplication
public class ExampleCamelDemoApplication {
public static void main(String[] args) throws Exception {
SpringApplication.run(ExampleCamelDemoApplication.class, args);
CamelContext context = new DefaultCamelContext();
context.addRoutes(new RouteBuilder() {
public void configure() throws Exception {
//
from("file:C:\\sourceFolder?fileName=test.json&noop=true").convertBodyTo(String.class).to("json-validator:classpath:myschema.json")
.to("seda:end");
}
});
context.start();
ConsumerTemplate ct = context.createConsumerTemplate();
System.out.println(ct.receiveBody("seda:end"));
Thread.sleep(10000);
context.stop();
}
}
the test.json file content is :
{
"id" :1
}
and myschema.json file content is :
{
"id" :1
}
I placed the myschema.json file in src/main/resources folder
I am getting error :
Message History (complete message history is disabled)
RouteId ProcessorId Processor Elapsed (ms)
[route1 ] [route1 ] [from[file://C:%5CsourceFolder?fileName=test.json&noop=true] ] [ 2]
...
[route1 ] [to1 ] [json-validator:classpath:myschema.json ] [ 0]
Stacktrace
java.lang.NullPointerException: null
at com.networknt.schema.JsonSchema.combineCurrentUriWithIds(JsonSchema.java:87) ~[json-schema-validator-1.0.29.jar:na]
at com.networknt.schema.JsonSchema.(JsonSchema.java:75) ~[json-schema-validator-1.0.29.jar:na]
at com.networknt.schema.JsonSchema.(JsonSchema.java:62) ~[json-schema-validator-1.0.29.jar:na]
at com.networknt.schema.JsonSchema.(JsonSchema.java:57) ~[json-schema-validator-1.0.29.jar:na]
at com.networknt.schema.JsonSchemaFactory.newJsonSchema(JsonSchemaFactory.java:253) ~[json-schema-validator-1.0.29.jar:na]
Either this is a copy/paste mistake or your schema file is not a JSON schema, but the same as your json data.
Take a look at the Camel docs for an example of a JSON schema file that can be used with the validator.

After upgrading php version All Errors Are Now "An Internal Server Error Occurred" in cake php

i am using cake php 3. Some days ago I have updated php version from 5.6 to 7.1.17 . Now if there is any error happen in my apps it show An Internal Server Error Occurred". I can see error log in my error.log file like this [Error] Call to a member function user() on boolean
Request URL: /robots.txt
Here is how my user() function called. It was working fine with php 5.6..
public function beforeRender(Event $event)
{
if($this->Auth->user()){
$this->set('loggedIn', true);
}
else{
$this->set('loggedIn',false);
}
}
This is how I solved the problem. Added this line $this->loadComponent('Auth'); in the beforeRender function. I got this solution from
Fatal error: Call to a member function user() on boolean

Fatal error: Call to a member function setQuote() on boolean in /home/thetiresquire/public_html/app/code/core/Mage/Sales/Model/Quote.php on line 745

Please help me to resolve the error am getting on home page.
MY CART :
0 item(s) -
Fatal error: Call to a member function setQuote() on boolean in /home/thetiresquire/public_html/app/code/core/Mage/Sales/Model/Quote.php on line 745
Here is the code where it is pointing to is
public function getItemsCollection($useCache = true)
{
if ($this->hasItemsCollection()) {
return $this->getData('items_collection');
}
if (is_null($this->_items)) {
$this->_items = Mage::getModel('sales/quote_item')->getCollection();
$this->_items->setQuote($this);
}
return $this->_items;
}
The error is pointing to line $this->_items->setQuote($this);
I have cleared the cache and flushed the cache from admin
Please help am new to magento.
Thanks,
Shabana

Fatal error: Can't use function return value in write context SOMETIMES

I get so annoyed when I transfer websites from one machine to another and I get a bunch of errors, such as this case. But this one made it to my curiosity and this is why I'm asking a question. I have the following code:
namsepace MF;
class Box {
private static $dumpYard = array();
public static function get($name) {
return self::$dumpYard[$name];
}
public static function set($name, $value, $overwrite=false) {
if($overwrite || !isset(self::$dumpYard[$name])){
self::$dumpYard[$name] = $value;
}else{
if(DEBUG_MODE){
echo('Value for "'.$name.'" already set in box, can\'t overwrite');
}
}
}
}
So when my application gets to the following line on my LOCAL testing server:
if(!empty(\MF\Box::get('requestsSpam'))){
throw new \Exception('Please don\'t spam');
}
I get a Fatal error: Can't use function return value in write context. However this code does not throw an error on the actual hosting server of my website. How come is that?
empty() works only with a variable. It should be:
$result = \MF\Box::get('requestsSpam');
if(!empty($result)){
throw new \Exception('Please don\'t spam');
}
Why? empty() is a language construct and not a function. It will work only with declared variables, that's just how it is designed, no magic.