Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.(5)

Forgot Password?

Need An Account, Sign Up Here

You must login to ask question.(5)

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

ITtutoria

ITtutoria Logo ITtutoria Logo

ITtutoria Navigation

  • Python
  • Java
  • Reactjs
  • JavaScript
  • R
  • PySpark
  • MYSQL
  • Pandas
  • QA
  • C++
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Python
  • Science
  • Java
  • JavaScript
  • Reactjs
  • Nodejs
  • Tools
  • QA

dttutoria

Expert
Ask dttutoria
0 Followers
0 Questions
Home/ dttutoria/Answers
  • About
  • Questions
  • Polls
  • Answers
  • Best Answers
  • Asked Questions
  • Followed Questions
  • Favorite Questions
  • Groups
  • Posts
  • Comments
  • Followers Questions
  • Followers Answers
  • Followers Posts
  • Followers Comments
  1. Asked: July 11, 2022In: java

    java lang module findexception module javafx controls not found – How to fix it?

    Best Answer
    dttutoria Expert
    Added an answer on July 11, 2022 at 9:45 am

    Solution: There is no default loading of the javafx.controls module. By starting it with the --add-modules javafx.controls option, you can force it into the boot layer. Try that way to solve your problem: java lang module findexception module javafx controls not found.

    Solution:

    There is no default loading of the javafx.controls module. By starting it with the --add-modules javafx.controls option, you can force it into the boot layer. Try that way to solve your problem: java lang module findexception module javafx controls not found.

    See less
    • 2
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  2. Asked: July 11, 2022In: java

    java lang illegalargumentexception uri is not absolute. How to fix?

    Best Answer
    dttutoria Expert
    Added an answer on July 11, 2022 at 5:17 am

    The cause: When a relative url is used to specify the resource, java lang illegalargumentexception uri is not absolute is thrown. The whole url will be utilized to make the rest call in the spring boot RestTemplate. Solution: Solution 1: The relative url must be converted to an absolute url if it isRead more

    The cause: When a relative url is used to specify the resource, java lang illegalargumentexception uri is not absolute is thrown. The whole url will be utilized to make the rest call in the spring boot RestTemplate.

    Solution:

    Solution 1: The relative url must be converted to an absolute url if it is let into the rest call in the RestTemplate. The absolute url will be used by the RestTemplate to locate the resource. The whole url “http:/localhost:8080/student” is being used to execute a rest call with RestTemplate in the example below.

    package com.yawintutor;
    
    import javax.servlet.http.HttpServletRequest;
    
    import org.springframework.web.bind.annotation.GetMapping;
    import org.springframework.web.bind.annotation.RestController;
    import org.springframework.web.client.RestTemplate;
    
    @RestController
    public class TestController {
    
    @GetMapping(value = "/student")
    public Student getStudent() {
    return new Student(1, "name1");
    }
    
    @GetMapping(value = "/getstudent")
    private Student getStudentObject(HttpServletRequest request)
    {
    String uri = "http://localhost:8080/student";
    RestTemplate restTemplate = new RestTemplate();
    Student result = restTemplate.getForObject(uri, Student.class);
    return result;
    }
    }

    Solution 2:

    Use the HTTPRequest object to create a complete url if it is using a relative url inside a rest call that points to the same Tomcat server before passing it to the rest template. The example that follows shows how to build an entire url from a relative url to the same server.

    package com.yawintutor;
    
    import javax.servlet.http.HttpServletRequest;
    
    import org.springframework.web.bind.annotation.GetMapping;
    import org.springframework.web.bind.annotation.RestController;
    import org.springframework.web.client.RestTemplate;
    
    @RestController
    public class TestController {
    
    @GetMapping(value = "/student")
    public Student getStudent() {
    return new Student(1, "name1");
    }
    
    @GetMapping(value = "/getstudent")
    private Student getStudentObject(HttpServletRequest request)
    {
    String requestURL = request.getRequestURL().substring(0, request.getRequestURL().indexOf(request.getRequestURI()));
    String uri = requestURL + "/student";
    RestTemplate restTemplate = new RestTemplate();
    Student result = restTemplate.getForObject(uri, Student.class);
    return result;
    }
    }

    Solution 3:

    When using a relative url in a RestTemplate and needing to refer to an external host server, its url can be externalized inside the application.properties files. The relative url can have the properties added, like in the example below.

    application.properties

    external.server.url=http://www.yawintutor.com

    TestController.java

    package com.yawintutor;
    
    import javax.servlet.http.HttpServletRequest;
    
    import org.springframework.beans.factory.annotation.Value;
    import org.springframework.web.bind.annotation.GetMapping;
    import org.springframework.web.bind.annotation.RestController;
    import org.springframework.web.client.RestTemplate;
    
    @RestController
    public class TestController {
    
    @Value("${external.server.url}")
    String externalServerURL;
    
    @GetMapping(value = "/student")
    public Student getStudent() {
    return new Student(1, "name1");
    }
    
    @GetMapping(value = "/getstudent")
    private Student getStudentObject()
    {
    String uri = externalServerURL + "/student";
    RestTemplate restTemplate = new RestTemplate();
    Student result = restTemplate.getForObject(uri, Student.class);
    return result;
    }
    }
    See less
    • 1
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  3. Asked: July 11, 2022In: java

    How to deal with the error: it is indirectly referenced from required.class files?

    Best Answer
    dttutoria Expert
    Added an answer on July 11, 2022 at 4:01 am

    The cause:  You are about to utilize a class that calls another class, which in turn calls more classes. There could be many layers to this relationship. The aforesaid error will occur during this call because a specific class's package is missing. Solution: To fix the problem "it is indirectly refeRead more

    The cause: 

    You are about to utilize a class that calls another class, which in turn calls more classes. There could be many layers to this relationship. The aforesaid error will occur during this call because a specific class’s package is missing.

    Solution: To fix the problem “it is indirectly referenced from required.class files”, you need to add the lacking package to the classpath.

    See less
    • 2
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  4. Asked: July 11, 2022In: c

    iso c90 forbids mixed declarations and code – How to fix it?

    Best Answer
    dttutoria Expert
    Added an answer on July 11, 2022 at 3:35 am

    Solution: I suggest the variable declaration should be moved to the top of the block to solve the issue iso c90 forbids mixed declarations and code. That is: { foo(); int i = 0; bar(); } to { int i = 0; foo(); bar(); }

    Solution:

    I suggest the variable declaration should be moved to the top of the block to solve the issue iso c90 forbids mixed declarations and code.

    That is:

    {
    foo();
    int i = 0;
    bar();
    }

    to

    {
    int i = 0;
    foo();
    bar();
    }
    See less
    • 2
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  5. Asked: July 10, 2022In: Error

    iso c++ forbids declaration of with no type – How to solve it?

    Best Answer
    dttutoria Expert
    Added an answer on July 10, 2022 at 4:42 am

    The cause:  In response to your second update, This is the cause of your issue: iso c++ forbids declaration of with no type. You likely overlooked the creation of the object file, which is a compilation step: Solution: Step 1: g++ -c services.cpp This will produce the object file which you can do foRead more

    The cause: 

    In response to your second update,

    This is the cause of your issue: iso c++ forbids declaration of with no type. You likely overlooked the creation of the object file, which is a compilation step:

    Solution:

    Step 1:

    g++ -c services.cpp

    This will produce the object file which you can do for linking, the final step:

    g++ main.cpp services.cpp -o executablename

    Since you were essentially pasting the complete code into the main during pre-processing, including the .cpp files in the main fixes the issue.

    See less
    • 2
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  6. Asked: July 8, 2022In: Error

    importerror: libcublas.so.10.0: cannot open shared object file: no such file or directory – How to fix?

    Best Answer
    dttutoria Expert
    Added an answer on July 8, 2022 at 12:54 pm

    The cause: It results from the claimed library's wrong location. Nvidia has changed the library's location from the cuda-10.1 directory toward the cuda-10.2 directory. This is what would occur in Ubuntu 18.04 if Cuda was installed using a *.deb package from Nvidia. Solution:  To fix the error, incluRead more

    The cause: It results from the claimed library’s wrong location. Nvidia has changed the library’s location from the cuda-10.1 directory toward the cuda-10.2 directory. This is what would occur in Ubuntu 18.04 if Cuda was installed using a *.deb package from Nvidia.

    Solution: 

    To fix the error, include this path to the cuda-10.2 library in your LD_LIBRARY_PATH:

    export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
    See less
    • 1
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  7. Asked: July 8, 2022In: Error

    How to fix the issue: import declarations may only appear at top level of a module?

    Best Answer
    dttutoria Expert
    Added an answer on July 8, 2022 at 12:03 pm

    The cause: Firefox browser will display the SyntaxError: import declarations may only appear at top level of a module problem since you didn't utilize the type="module" attribute. Solution: So you need to Add type="module" to fix the problem. Prior to importing the JS file, first, turn on the dom.moRead more

    The cause: Firefox browser will display the SyntaxError: import declarations may only appear at top level of a module problem since you didn’t utilize the type="module" attribute.

    Solution:

    So you need to Add type="module" to fix the problem.

    Prior to importing the JS file, first, turn on the dom.moduleScripts.enabled option in about:config and then add type="module" to your script tag.

    <script type="module" src="appthatimports.js"></script>

    Finally, use:

    import * from "./mylib.js"

     

    See less
    • 1
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  8. Asked: July 6, 2022In: Error

    hostname ip does not match certificate’s altnames. How to fix?

    Best Answer
    dttutoria Expert
    Added an answer on July 6, 2022 at 4:09 pm

    Hi. I will tell you the way to fix the hostname or IP not matching certificate’s altnames with Node.js. Solution:  You could utilize http-proxy with changeOrigin to true. For example, I write: const proxy = httpProxy.createProxyServer(); proxy.web(req, res, { changeOrigin: true, target: 'https://exaRead more

    Hi. I will tell you the way to fix the hostname or IP not matching certificate’s altnames with Node.js.

    Solution: 

    You could utilize http-proxy with changeOrigin to true.

    For example, I write:

    const proxy = httpProxy.createProxyServer();
    
    proxy.web(req, res, {
    changeOrigin: true,
    target: 'https://example.com:3000'
    });

    to set up a proxy so that traffic going to example.com:3000 is proxied.

    Next, we design the server using:

    httpProxy.createServer({
    ssl: {
    key: fs.readFileSync('valid-ssl-key.pem', 'utf8'),
    cert: fs.readFileSync('valid-ssl-cert.pem', 'utf8')
    },
    target: 'https://example.com:3000',
    secure: true
    }).listen(443);

    We use fs.readFileSync to read the key as well as certificate, and after that, we establish target to the hostname where our server is being hosted.

    See less
    • 1
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  9. Asked: July 6, 2022In: Error

    Way to fix hardware assisted virtualization and data execution protection must be enabled in the bios error.

    Best Answer
    dttutoria Expert
    Added an answer on July 6, 2022 at 3:38 pm

    As you can see in the error message, it is clear what causes the problem. I have a suggestion to fix the error hardware assisted virtualization and data execution protection must be enabled in the bios, you should do the following: Solution:  You should execute one of the commands listed below. AndRead more

    As you can see in the error message, it is clear what causes the problem. I have a suggestion to fix the error hardware assisted virtualization and data execution protection must be enabled in the bios, you should do the following:

    Solution: 

    You should execute one of the commands listed below. And to apply the modifications, you must restart the system.

    Activate Hyper V by:

    dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All

    Activate Hypervisor by:

    bcdedit /set hypervisorlaunchtype auto

    If the issue persists, your system’s Hyper-V is definitely corrupt, therefore

    Uncheck every item linked to Hyper-V under Programs > Windows Features in Control Panel. System restart. Reactivate Hyper-V. Restart.

     

    See less
    • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  10. Asked: July 5, 2022In: Error

    fatal error: unexpectedly found nil while unwrapping an optional value. How to fix it?

    Best Answer
    dttutoria Expert
    Added an answer on July 5, 2022 at 4:17 pm
    This answer was edited.

    The cause: When you encounter the fatal error: unexpectedly found nil while unwrapping an optional value, you need to pay attention to that you forced open an optional with ! while it was nil. Let's assume that this code is capable of running even before the user has signed in. When a user is not loRead more

    The cause: When you encounter the fatal error: unexpectedly found nil while unwrapping an optional value, you need to pay attention to that you forced open an optional with ! while it was nil.

    Let’s assume that this code is capable of running even before the user has signed in. When a user is not logged in, the username field is null. As a result, it is optional.

    Solution:

    Solve the problem like this:

    Before forcing the unwrapping of username, you use if-statement to see whether username is null. The code enclosed in the brackets { } is not run when username is nil.

    let username:String? = nil
    
    if username != nil {
    let message = “Welcome, ” + username!
    print(message)
    }

     

    See less
    • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
1 2 3 4 5 6 … 19

Sidebar

Ask A Question
  • How to Split String by space in C++
  • How To Convert A Pandas DataFrame Column To A List
  • How to Replace Multiple Characters in A String in Python?
  • How To Remove Special Characters From String Python

Explore

  • Home
  • Tutorial

Footer

ITtutoria

ITtutoria

This website is user friendly and will facilitate transferring knowledge. It would be useful for a self-initiated learning process.

@ ITTutoria Co Ltd.

Tutorial

  • Home
  • Python
  • Science
  • Java
  • JavaScript
  • Reactjs
  • Nodejs
  • Tools
  • QA

Legal Stuff

  • About Us
  • Terms of Use
  • Privacy Policy
  • Contact Us

DMCA.com Protection Status

Help

  • Knowledge Base
  • Support

Follow

© 2022 Ittutoria. All Rights Reserved.