Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 404 in Queries #1

Open
raderio opened this issue Aug 29, 2017 · 6 comments
Open

Error 404 in Queries #1

raderio opened this issue Aug 29, 2017 · 6 comments

Comments

@raderio
Copy link

raderio commented Aug 29, 2017

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.

@vaibhavg12
Copy link

I am getting the same issue, can anyone help ?

@JonathanSum
Copy link

JonathanSum commented Feb 10, 2018

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.

@vaibhavg12
Copy link

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.

@JonathanSum
Copy link

JonathanSum commented Feb 12, 2018

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>

@vaibhavg12
Copy link

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

@JonathanSum
Copy link

JonathanSum commented Feb 13, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants