howtographql / graphql-java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error 404 in Queries

raderio opened this issue · comments

commented

I get error 404 in https://www.howtographql.com/graphql-java/2-queries/
for http://localhost:8080/graphql?query={allLinks{url}}

HTTP ERROR 404
Problem accessing /graphql. Reason:
Not Found

Can you please add tags for every step, how it should be in final for each step.

I am getting the same issue, can anyone help ?

Ok, I do not have this problem. I guess I did everything right. However, could anyone of you post your code and which step you are in? It is ok to post them on the GitHub. I will check them in my free time.

Hi Jonathan,

I was able to resolve the above error but now getting the following exception:-
https://gist.github.com/vaibhavg12/805414aa66b5893667fb01982a51a388

This comes while in step 2 (https://www.howtographql.com/graphql-java/2-queries/) of the tutorial. My code is committed here:-
https://github.com/vaibhavg12/graphQL

Thanks in advance for looking at it. Your help and time is much appreciated.

Best,
Vb.

Hi, Vaibhavg12. After 5mins of trying, your problem has been solved.
Go ahead copy this code into your pom.xml file and run "mvn jetty:run"

I think after looking at the code below, you will know what the problem of the code you gave me is.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>net.vb.graphql</groupId>
  <artifactId>graphql-java</artifactId>
  <packaging>war</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>graphql-java Maven Webapp</name>
  <url>http://maven.apache.org</url>
    
<dependencies>
  <dependency>
    <groupId>com.graphql-java</groupId>
    <artifactId>graphql-java</artifactId>
    <version>3.0.0</version>
  </dependency>
  <dependency>
    <groupId>com.graphql-java</groupId>
    <artifactId>graphql-java-servlet</artifactId>
    <version>4.0.0</version>
  </dependency>
  <dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.0.1</version>
    <scope>provided</scope>
  </dependency>
  <dependency>
    <groupId>com.graphql-java</groupId>
    <artifactId>graphql-java-tools</artifactId>
    <version>3.2.0</version>
  </dependency>
  <dependency>
    <groupId>org.mongodb</groupId>
    <artifactId>mongodb-driver</artifactId>
    <version>3.6.2</version>
  </dependency>
</dependencies>
  <build>
    <finalName>graphql-java</finalName>
      <plugins>
          <plugin>
              <groupId>org.eclipse.jetty</groupId>
              <artifactId>jetty-maven-plugin</artifactId>
            <version>9.4.8.v20171121</version>
          </plugin>

    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>3.5.1</version>
      <configuration>
        <source>1.8</source>
        <target>1.8</target>
      </configuration>
    </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>1.2</version>
          <configuration>
            <classpathScope>test</classpathScope>
            <executable>java</executable>
            <arguments>
              <argument>-cp</argument>
              <classpath />
              <argument>com.company.foo.EmbedMe</argument>
              <argument>8080</argument>
            </arguments>
          </configuration>
        </plugin>

    <plugin>
      <artifactId>maven-war-plugin</artifactId>
      <version>3.1.0</version>
    </plugin>
      </plugins>
  </build>

</project>

Thanks Jonathan,

I missed a pretty trivial thing in my pom. I wasn't aware that I would need that since it was no where mention in the tutorial.

Thanks again !!

Best,
Vb

Hey raderio, post your code here. If you don't, how can I know what your problem is? I am not a super creature.