java – Aplicação Spring Boot Error 500 não lista meus paises


import com.github.Anacarlags.citiesapi.repository.CountryRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
@RequestMapping("/countries")
public class CountryResource {
    @Autowired
    private CountryRepository repository;
    public CountryResource(CountryRepository repository) {
        this.repository = repository;
    }

    @GetMapping
    public List<Country> countries(){
        return repository.findAll();
    }

}```

**Mostra isso**

´´´2021-02-25 18:01:43.653  INFO 3050 --- (           main) c.g.A.citiesapi.CitiesApiApplication     : Starting CitiesApiApplication using Java 11.0.10 on aninhacarla with PID 3050 (/home/ana-carla/Documentos/cities-api/build/classes/java/main started by ana-carla in /home/ana-carla/Documentos/cities-api)
2021-02-25 18:01:43.675  INFO 3050 --- (           main) c.g.A.citiesapi.CitiesApiApplication     : No active profile set, falling back to default profiles: default
2021-02-25 18:01:45.611  INFO 3050 --- (           main) .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-02-25 18:01:45.791  INFO 3050 --- (           main) .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 135 ms. Found 1 JPA repository interfaces.
2021-02-25 18:01:47.209  INFO 3050 --- (           main) o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2021-02-25 18:01:47.237  INFO 3050 --- (           main) o.apache.catalina.core.StandardService   : Starting service (Tomcat)
2021-02-25 18:01:47.238  INFO 3050 --- (           main) org.apache.catalina.core.StandardEngine  : Starting Servlet engine: (Apache Tomcat/9.0.43)
2021-02-25 18:01:47.429  INFO 3050 --- (           main) o.a.c.c.C.(Tomcat).(localhost).(/)       : Initializing Spring embedded WebApplicationContext
2021-02-25 18:01:47.429  INFO 3050 --- (           main) w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 3434 ms
2021-02-25 18:01:47.801  INFO 3050 --- (           main) com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2021-02-25 18:01:47.980  INFO 3050 --- (           main) com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2021-02-25 18:01:48.080  INFO 3050 --- (           main) o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo (name: default)
2021-02-25 18:01:48.206  INFO 3050 --- (           main) org.hibernate.Version                    : HHH000412: Hibernate ORM core version 5.4.28.Final
2021-02-25 18:01:48.426  INFO 3050 --- (           main) o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2021-02-25 18:01:48.687  INFO 3050 --- (           main) org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL10Dialect
2021-02-25 18:01:49.234  INFO 3050 --- (           main) org.hibernate.tuple.PojoInstantiator     : HHH000182: No default (no-argument) constructor for class: com.github.Anacarlags.citiesapi.Country (class must be instantiated by Interceptor)
2021-02-25 18:01:49.650  INFO 3050 --- (           main) o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: (org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform)
2021-02-25 18:01:49.663  INFO 3050 --- (           main) j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2021-02-25 18:01:50.365  WARN 3050 --- (           main) JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2021-02-25 18:01:50.654  INFO 3050 --- (           main) o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2021-02-25 18:01:51.141  INFO 3050 --- (           main) o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2021-02-25 18:01:51.172  INFO 3050 --- (           main) c.g.A.citiesapi.CitiesApiApplication     : Started CitiesApiApplication in 8.703 seconds (JVM running for 9.563)```

python – Obtengo el siguiente error al “OSError: [Errno -9999] Unanticipated host error” al usar speech_recognition

sucede que estaba programando un reconocedor de voz y al probarlo, me dio el siguiente error y no le he encontrado solución, espero puedan ayudarme.

def takecommand():
r = sr.Recognizer()
with sr.Microphone() as source:
    print("Escuchando....")
    r.pause_threshold = 1
    audio = r.listen(source)
try:
    print("Reconociendo....")
    query = r.recognize_google(audio, language="es-CL")
    print(query)
except Exception as e:
    print(e)
    print("¿Puedes repetir eso, por favor?")
    return "None"
return query

introducir la descripción de la imagen aquí

migration – Error to migrate DB 2008 R2 to 2017 Standard

I have data base with 35 GB when i try to migrate it from 2008 R2 to 2017 standard with the usual method detach and attach file she show me that I was same partition Id crashed and the same when I do backup so I did same investigation I find that error was in table in catalogue full text and I don’t use this one I try to delete it but she can’t be deleted

So I used the task generate script with the option schema and data except that catalogue file and she gives me a sql file with 36 GB that I can’t run even using cmd

8 – General error: 2 File ‘/code/sites/default/files/myfile/myfile.csv’ not found (Errcode: 2) insert csv record in DB

I am getting an error while inserting CSV records in the database. It was working fine before, but now it doesn’t. I am using MySQL 10.0.23-MariaDB-log.

DrupalCoreDatabaseDatabaseExceptionWrapper: SQLSTATE(HY000): General error: 2 File ‘/code/sites/default/files/myfile/myfile.csv’ not found (Errcode: 2): LOAD DATA LOCAL INFILE ‘/code/sites/default/files/myfile/myfile.csv’ INTO TABLE pantheon.tablename FIELDS TERMINATED BY ‘,’ ENCLOSED BY ‘”‘ LINES TERMINATED BY ‘ ‘ IGNORE 1 ROWS; Array ( ) in DrupalmodulenameFormmyUploadForm->submitForm() (line 56 of /code/modules/custom/modulename/src/Form/myUploadForm.php).

This the code causing the error.

$database = Drupal::database();
$query = $database->query("TRUNCATE TABLE tablename");
$query = $database->query("LOAD DATA LOCAL INFILE '$file_server_path'
  INTO TABLE `pantheon`.`tablename`
  FIELDS TERMINATED BY ','
  ENCLOSED BY '"'
  LINES TERMINATED BY 'n'
  IGNORE 1 ROWS");

magento2 – SSL Certificate error when trying to download the Cybersource Magento Plugin

I’m trying to install the Cybersource package for Magento. I’m new to Magento, I had a pretty hard time installing Magento itself, but I got there. Now, I’m stuck installing this cybersource module.
I’m following this installion guide Magento Cybersource Installation Guide to install the extension, for some reason, I get this error:
curl error 60 while downloading https://repo.packagist.org/p2/cybersource/global-payment-management.json: SSL certificate problem: unable to get local issuer certificate.
I tried doing these as suggested by some people, but it doesn’t seem to work:

  1. Download and place the cacert.pem in the PHP root/SSL directory and mention the path ibn php.ini.
  2. Download the server certificate from https://repo.packagist.org/p2/cybersource/global-payment-management.json and add it to the curl-ca-bundle certificate.

As mentioned in the installation guide I’ve created my auth.json file in the project root directory and verified the public and private keys. I’m not sure what else is missing. Would really appreciate any help. Btw, I’m running Magento 2.4 on XAMPP.
Here’s the error log:

The "magento/magento-composer-installer" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
The "magento/inventory-composer-installer" plugin was skipped because it requires a Plugin API version ("^1.1") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
The "laminas/laminas-dependency-plugin" plugin was skipped because it requires a Plugin API version ("^1.1") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
The "magento/composer-root-update-plugin" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
https://repo.magento.com could not be fully loaded (curl error 60 while downloading https://repo.magento.com/packages.json: SSL certificate problem: unable to get local issuer certificate), package information was loaded from the local cache and may be out of date
https://repo.magento.com could not be fully loaded (curl error 60 while downloading https://repo.magento.com/packages.json: SSL certificate problem: unable to get local issuer certificate), package information was loaded from the local cache and may be out of date
https://repo.packagist.org could not be fully loaded (curl error 60 while downloading https://repo.packagist.org/packages.json: SSL certificate problem: unable to get local issuer certificate), package information was loaded from the local cache and may be out of date


  (ComposerDownloaderTransportException)
  curl error 60 while downloading https://repo.packagist.org/p2/cybersource/global-payment-management.json: SSL certificate problem: unable to get local issuer certificate```

nginx – How do I troubleshoot 403 access forbidden by rule error?

In the first 40-50 minutes after I restart my server (Apache with Ngintron) I get a 403 nginx error, and in the logs it says “access forbidden by rule”.
I have all my traffic redirected to HTTPS.
This is my etc/nginx/common_https.conf:

# Common definitions for HTTPS content

# TLS/SSL common
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;

# Diffie-Hellman parameter for DHE ciphersuites (2048 bits)
ssl_dhparam /etc/ssl/certs/dhparam.pem;

# --- Protocols & Ciphers (start) ---

# Maximum client support (enabled by default)
# Supports Firefox 1, Android 2.3, Chrome 1, Edge 12, IE8 on Windows XP, Java 6, OpenSSL 0.9.8, Opera 5 & Safari 1
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers / removed /;
ssl_prefer_server_ciphers on;

# Intermediate client support (disabled by default)
# Supports Firefox 27, Android 4.4.2, Chrome 31, Edge, IE 11 on Windows 7, Java 8u31, OpenSSL 1.0.1, Opera 20 & Safari 9
#ssl_protocols TLSv1.2 TLSv1.3;
#ssl_ciphers /removed/;
#ssl_prefer_server_ciphers off;

# Modern client support (disabled by default)
# Supports Firefox 63, Android 10.0, Chrome 70, Edge 75, Java 11, OpenSSL 1.1.1, Opera 57 & Safari 12.1
#ssl_protocols TLSv1.3;
#ssl_prefer_server_ciphers off;

# --- Protocols & Ciphers (finish) ---

# Set the port for HTTPS proxying
set $PROXY_TO_PORT 443;

# Include common definitions and rules with HTTP
include common_http.conf;

Could be the problem this rule: ssl_session_cache shared:SSL:50m; ?

And this is my etc/nginx/common_http.conf:

# Common definitions for HTTP content

# Initialize important variables
set $CACHE_BYPASS_FOR_DYNAMIC 0;
set $CACHE_BYPASS_FOR_STATIC 0;
set $PROXY_DOMAIN_OR_IP $host;
set $PROXY_FORWARDED_HOST $host;
set $PROXY_SCHEME $scheme;
set $SITE_URI "$host$request_uri";

# Generic query string to request a page bypassing Nginx's caching entirely for both dynamic & static content
if ($query_string ~* "nocache") {
    set $CACHE_BYPASS_FOR_DYNAMIC 1;
    set $CACHE_BYPASS_FOR_STATIC 1;
}

# Proxy requests to "localhost"
if ($host ~* "localhost") {
    set $PROXY_DOMAIN_OR_IP "127.0.0.1";
}

# Disable caching for cPanel specific subdomains
if ($host ~* "^(webmail|cpanel|whm|webdisk|cpcalendars|cpcontacts).") {
    set $CACHE_BYPASS_FOR_DYNAMIC 1;
    set $CACHE_BYPASS_FOR_STATIC 1;
}

# Fix Horde webmail forwarding
if ($host ~* "^webmail.") {
    set $PROXY_FORWARDED_HOST '';
}

# Set custom rules like domain/IP exclusions or redirects here
include custom_rules;

location / {
    try_files $uri $uri/ u/backend;
}

location u/backend {
    include proxy_params_common;
    # === MICRO CACHING ===
    # Comment the following line to disable 1 second micro-caching for dynamic HTML content
    include proxy_params_dynamic;
}

# Enable browser cache for static content files (TTL is 1 hour)
location ~* .(?:json|xml|rss|atom)$ {
    include proxy_params_common;
    include proxy_params_static;
    expires 1h;
}

# Enable browser cache for CSS / JS (TTL is 30 days)
location ~* .(?:css|js)$ {
    include proxy_params_common;
    include proxy_params_static;
    expires 30d;
}

# Enable browser cache for images (TTL is 60 days)
location ~* .(?:ico|jpg|jpeg|gif|png|webp)$ {
    include proxy_params_common;
    include proxy_params_static;
    expires 60d;
}

# Enable browser cache for archives, documents & media files (TTL is 60 days)
location ~* .(?:3gp|7z|avi|bmp|bz2|csv|divx|doc|docx|eot|exe|flac|flv|gz|less|mid|midi|mka|mkv|mov|mp3|mp4|mpeg|mpg|odp|ods|odt|ogg|ogm|ogv|opus|pdf|ppt|pptx|rar|rtf|swf|tar|tbz|tgz|tiff|txz|wav|webm|wma|wmv|xls|xlsx|xz|zip)$ {
    set $CACHE_BYPASS_FOR_STATIC 1;
    include proxy_params_common;
    include proxy_params_static;
    expires 60d;
}

# Enable browser cache for fonts & fix u/font-face cross-domain restriction (TTL is 60 days)
location ~* .(eot|ttf|otf|woff|woff2|svg|svgz)$ {
    include proxy_params_common;
    include proxy_params_static;
    expires 60d;
}

# Prevent logging of favicon and robot request errors
location = /favicon.ico {
    include proxy_params_common;
    include proxy_params_static;
    expires 60d;
    log_not_found off;
}

location = /robots.txt  {
    include proxy_params_common;
    include proxy_params_static;
    expires 1d;
    log_not_found off;
}

# Deny access to files like .htaccess or .htpasswd
location ~ /.ht {
    deny all;
}

How do I troubleshoot further exactly which rule causes the issue?

filters – chosen_shipping_methods – Uncaught Error: Call to a member function get() on null

I use the function to filter payment gateways. Unfortunately, since I updated WordPress by several versions (5.6.2), I get an error:

The E_ERROR error was caused on line 155 of /(…)/functions.php. Error message: Uncaught Error: Call to a member function get () on null in /(…)/functions.php:155

Probably a small thing, but I’ve been trying to find a solution for a long time and I have no idea. Someone help?

This error is very important because I do not have access to the tabs in the administration panel: Statistics and Marketing.

function my_custom_available_payment_gateways( $gateways ) {
    $chosen_shipping_rates = WC()->session->get( 'chosen_shipping_methods' );

        if ( in_array( 'flat_rate:1', $chosen_shipping_rates ) ) {
        unset( $gateways('cod') );}
        
        elseif ( in_array( 'flat_rate:5', $chosen_shipping_rates ) ) {
        unset( $gateways('bacs') );
        unset( $gateways('przelewy24') );       }
        
        elseif ( in_array( 'flat_rate:2', $chosen_shipping_rates ) ) {
        unset( $gateways('cod') );      }
        
        elseif ( in_array( 'flat_rate:6', $chosen_shipping_rates ) ) {
        unset( $gateways('bacs') );
        unset( $gateways('przelewy24') );       }
        
        elseif ( in_array( 'flat_rate:3', $chosen_shipping_rates ) ) {
        unset( $gateways('cod') );      }
        
        elseif ( in_array( 'flat_rate:7', $chosen_shipping_rates ) ) {
        unset( $gateways('bacs') );
        unset( $gateways('przelewy24') );       }           
        
        elseif ( in_array( 'easypack_parcel_machines_cod', $chosen_shipping_rates ) ) {
        unset( $gateways('bacs') );
        unset( $gateways('przelewy24') ); } 

        elseif ( in_array( 'local_pickup:4', $chosen_shipping_rates ) ) {
        unset( $gateways('cod') );  }

    return $gateways;
}
add_filter( 'woocommerce_available_payment_gateways', 'my_custom_available_payment_gateways' );

Error: Error reading from database, shutting down

Cannot finish the initial phase. Installed the software v0.21.0 on Windows 10 64bit,
started a loooooooooong process to retrieve the blocks 2-3 days, then, always around 70-80% of the process:
Error: Error reading from database, shutting down
It’s the 3rd time I am re-starting from 0, after cleaning everything
Can anyone HELP ME! Thanks

terminal – Error in Virtual Box: Failed to open a session for the virtual machine

I want to install Ubuntu 20.10 on Virtual Box 6.1.18, when I create the virtual machine is okay so I press start but when I want to search the ISO file this error appears to me.

enter image description here

I saw different solutions in the terminal for Windows, but any for Mac helped me. Downgrade Virtual Box isn’t an option because my professor requires this version.

linux – ERROR: Virtual Raspbian on Qemu in Ubuntu

I am trying to emulate Raspberry-pi/Raspbian with QEMU on my linux subsystem. I followed this link and did the following steps

$ mkdir ~/qemu_vms/
Download/copy Raspbian Wheezy to ~/qemu_vms/
Download kernel-qemu to ~/qemu_vms/
$ sudo apt-get install qemu-system
$ file ~/qemu_vms/2013-02-09-wheezy-raspbian.img
From the output of the file command, take the partition 2 'startsector' value an multiply by 512, and use this figure as the offset value in the mount command below.
$ sudo mount ~/qemu_vms/2013-02-09-wheezy-raspbian.img -o offset=62914560 /mnt
$ sudo nano /mnt/etc/ld.so.preload
Comment out the line in the file (use a # as the first character of the line) and save the file (CTRL+X, then "Y" for yes).
$ sudo umount ~/qemu_vms/2013-02-09-wheezy-raspbian.img /mnt

When i ran last command in the above commands, my output was

umount: /mnt: not mounted.

What does this mean? Anyways, thinking i was on the right track, I proceeded and did the following steps

$ cd ~/qemu_vms/
$ qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1" -hda ~/qemu_vms/2013-02-09-wheezy-raspbian.img -redir tcp:5022::22

but instead of QEMU giving me a root shell, I got an error with following output

qemu-system-arm: -redir: invalid option

Where exactly am I making a mistake and how can I complete this process successfully?

Incase this process depends on my Linux subsystem, here is the my ubuntu version:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.2 LTS
Release:        20.04
Codename:       focal

What i currently have in the folder qemu_vms are 2013-02-09-wheezy-raspbian.img and kernel-qemu which i got from here