Not a able to Write my first vertical

447 views
Skip to first unread message

jyothesh k

unread,
Aug 5, 2013, 6:23:21 AM8/5/13
to ve...@googlegroups.com
HI,

I am jyothesh K and i am new to vertx. I saw the documentation given and was able to setup the vertx on my windows 7 system. Now i am trying to write a verticle present in the http://vertx.io/core_manual_java.html#writing-verticles unser writing verticle heading. And i am getting the following errors:

the error log is here:


E:\vertx_sample\server.java:9: error: cannot find symbol
    vertx.createNetServer().connectHandler(new Handler<NetSocket>() {
    ^
  symbol:   variable vertx
  location: class server
Failed to create verticle
java.lang.RuntimeException: Compilation failed
        at org.vertx.java.deploy.impl.java.CompilingClassLoader.<init>(Compiling
ClassLoader.java:75)
        at org.vertx.java.deploy.impl.java.JavaVerticleFactory.createVerticle(Ja
vaVerticleFactory.java:48)
        at org.vertx.java.deploy.impl.VerticleManager$10.run(VerticleManager.jav
a:777)
        at org.vertx.java.core.impl.Context$2.run(Context.java:119)
        at org.jboss.netty.channel.socket.nio.AbstractNioWorker.processEventQueu
e(AbstractNioWorker.java:454)
        at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioW
orker.java:331)
        at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:35)
        at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnabl
e.java:102)
        at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProof
Worker.java:42)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
        at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.RuntimeException: Compilation failed!
        at org.vertx.java.deploy.impl.java.CompilingClassLoader.<init>(Compiling
ClassLoader.java:72)
        ... 11 more

can any one please help me...

Tim Fox

unread,
Aug 6, 2013, 4:29:35 AM8/6/13
to ve...@googlegroups.com
Have you looked at the examples?

http://vertx.io/examples.html

Also.. you didn't show us your code, so it's hard to tell what is going wrong.

jyothesh k

unread,
Aug 6, 2013, 4:32:19 AM8/6/13
to ve...@googlegroups.com
Thank you for your reply,I have written this snippet in a note and tried to execute it.

import org.vertx.java.core.Handler;
import org.vertx.java.core.net.NetSocket;
import org.vertx.java.core.streams.Pump;
import org.vertx.java.platform.Verticle;

public class server extends Verticle {

  public void start() {
    vertx.createNetServer().connectHandler(new Handler<NetSocket>() {
      public void handle(final NetSocket socket) {
        Pump.createPump(socket, socket).start();
      }
    }).listen(1234);
  }
}


Do i need to include any other things in to the program...



--
You received this message because you are subscribed to a topic in the Google Groups "vert.x" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vertx/17xzkF08bLA/unsubscribe.
To unsubscribe from this group and all of its topics, send an email to vertx+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
With Regards
Jyothesh k

Norman Maurer

unread,
Aug 6, 2013, 4:40:44 AM8/6/13
to ve...@googlegroups.com
How exactly you start it ?


You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.

jyothesh k

unread,
Aug 6, 2013, 7:34:33 AM8/6/13
to ve...@googlegroups.com
As, I already said, I placed the vertx installation directory into my E drive. Then had written the code in one note file in a file called samplevertx which is different from the installation directory. I also set the environment path so that i can execute it from command prompt in any location. Later i tried to execute that code file, then the following errors came up. I didnt include any package to that source code. I was trying that in eclipse. there also it is showing error that org.vertx is not available.

Jez P

unread,
Aug 6, 2013, 8:23:58 AM8/6/13
to ve...@googlegroups.com
What exact command are you calling to start it, at the command line?

Tim Yates

unread,
Aug 6, 2013, 8:26:13 AM8/6/13
to ve...@googlegroups.com
Also,
public class server

should be

public class Server

Norman Maurer

unread,
Aug 6, 2013, 8:40:37 AM8/6/13
to ve...@googlegroups.com
Good catch !

javajosh

unread,
Aug 6, 2013, 11:18:15 AM8/6/13
to ve...@googlegroups.com
By far the easiest way to get started with Vertx is using a script. You literally only need to write a single file, and no build, and you can start playing around. If you want a library, you can add it to the classpath. This isn't appropriate for a real project, but it's appropriate for first steps and playing around, which is what you're doing.

jyothesh k

unread,
Aug 6, 2013, 12:15:35 PM8/6/13
to ve...@googlegroups.com
vertx run server.java

Jez P

unread,
Aug 6, 2013, 12:48:20 PM8/6/13
to ve...@googlegroups.com
Hmm that looks consistent with the examples here https://github.com/vert-x/vertx-examples/blob/master/src/raw/java/README.md, although it would appear that your classpath is missing something (not sure why that would be)

One other question (which someone is bound to ask so it may as well be me): Which version of vert.x are you using? I don't know if this has changed between 1.3 and 2.0.

I would second what the others are saying about using scripts rather than Java. I'd also suggest using the maven or gradle templates, which make life a lot easier (in my experience anyway). However, someone on this group must have done what you're trying to do so hopefully one of them will spot the problem for you.

Cheers

Jez 

Tim Fox

unread,
Aug 6, 2013, 1:22:11 PM8/6/13
to ve...@googlegroups.com
I'd suggest running the examples in the vertx-examples repository as a
starting point.

On 06/08/13 17:15, jyothesh k wrote:
> vertx run server.java
>
>
> On Tue, Aug 6, 2013 at 8:48 PM, javajosh <java...@gmail.com> wrote:
>
>> By far the easiest way to get started with Vertx is using a script. You
>> literally only need to write a single file, and no build, and you can start
>> playing around. If you want a library, you can add it to the classpath.
>> This isn't appropriate for a real project, but it's appropriate for first
>> steps and playing around, which is what you're doing.
>>
>> On Tuesday, August 6, 2013 4:34:33 AM UTC-7, jyothesh k wrote:
>>
>>> As, I already said, I placed the vertx installation directory into my E
>>> drive. Then had written the code in one note file in a file called
>>> samplevertx which is different from the installation directory. I also set
>>> the environment path so that i can execute it from command prompt in any
>>> location. Later i tried to execute that code file, then the following
>>> errors came up. I didnt include any package to that source code. I was
>>> trying that in eclipse. there also it is showing error that org.vertx is
>>> not available.
>>>
>>>
>>> On Tue, Aug 6, 2013 at 2:10 PM, Norman Maurer <norman...@googlemail.com>wrote:
>>>
>>>> How exactly you start it ?
>>>>
>>>>
>>>> Am 06.08.2013 um 10:32 schrieb jyothesh k <jyothe...@gmail.com>:
>>>>
>>>> Thank you for your reply,I have written this snippet in a note and tried
>>>> to execute it.
>>>>
>>>> import org.vertx.java.core.Handler;
>>>> import org.vertx.java.core.net.**NetSocket;
>>>> import org.vertx.java.core.streams.**Pump;
>>>> import org.vertx.java.platform.**Verticle;
>>>>
>>>> public class server extends Verticle {
>>>>
>>>> public void start() {
>>>> vertx.createNetServer().**connectHandler(new Handler<NetSocket>() {
>>>> public void handle(final NetSocket socket) {
>>>> Pump.createPump(socket, socket).start();
>>>> }
>>>> }).listen(1234);
>>>> }
>>>> }
>>>>
>>>>
>>>> Do i need to include any other things in to the program...
>>>>
>>>>
>>>>
>>>> On Tue, Aug 6, 2013 at 1:59 PM, Tim Fox <timv...@gmail.com> wrote:
>>>>
>>>>> Have you looked at the examples?
>>>>>
>>>>> http://vertx.io/examples.html
>>>>>
>>>>> Also.. you didn't show us your code, so it's hard to tell what is going
>>>>> wrong.
>>>>>
>>>>> On 05/08/13 11:23, jyothesh k wrote:
>>>>>
>>>>> HI,
>>>>>
>>>>> I am jyothesh K and i am new to vertx. I saw the documentation given and
>>>>> was able to setup the vertx on my windows 7 system. Now i am trying to
>>>>> write a verticle present in the http://vertx.io/core_manual_**java.html#writing-verticles <http://vertx.io/core_manual_java.html#writing-verticles> unser writing
>>>>> verticle heading. And i am getting the following errors:
>>>>>
>>>>> the error log is here:
>>>>>
>>>>>
>>>>> E:\vertx_sample\server.java:9: error: cannot find symbol
>>>>> vertx.createNetServer().**connectHandler(new Handler<NetSocket>() {
>>>>> ^
>>>>> symbol: variable vertx
>>>>> location: class server
>>>>> Failed to create verticle
>>>>> java.lang.RuntimeException: Compilation failed
>>>>> at
>>>>> org.vertx.java.deploy.impl.**java.CompilingClassLoader.<**init>(Compiling
>>>>> ClassLoader.java:75)
>>>>> at
>>>>> org.vertx.java.deploy.impl.**java.JavaVerticleFactory.**createVerticle(Ja
>>>>> vaVerticleFactory.java:48)
>>>>> at
>>>>> org.vertx.java.deploy.impl.**VerticleManager$10.run(**VerticleManager.jav
>>>>> a:777)
>>>>> at org.vertx.java.core.impl.**Context$2.run(Context.java:**119)
>>>>> at
>>>>> org.jboss.netty.channel.**socket.nio.AbstractNioWorker.**processEventQueu
>>>>> e(AbstractNioWorker.java:454)
>>>>> at
>>>>> org.jboss.netty.channel.**socket.nio.AbstractNioWorker.**run(AbstractNioW
>>>>> orker.java:331)
>>>>> at
>>>>> org.jboss.netty.channel.**socket.nio.NioWorker.run(**NioWorker.java:35)
>>>>> at
>>>>> org.jboss.netty.util.**ThreadRenamingRunnable.run(**ThreadRenamingRunnabl
>>>>> e.java:102)
>>>>> at
>>>>> org.jboss.netty.util.internal.**DeadLockProofWorker$1.run(**DeadLockProof
>>>>> Worker.java:42)
>>>>> at
>>>>> java.util.concurrent.**ThreadPoolExecutor.runWorker(**ThreadPoolExecutor.
>>>>> java:1145)
>>>>> at
>>>>> java.util.concurrent.**ThreadPoolExecutor$Worker.run(**ThreadPoolExecutor
>>>>> .java:615)
>>>>> at java.lang.Thread.run(Thread.**java:724)
>>>>> Caused by: java.lang.RuntimeException: Compilation failed!
>>>>> at
>>>>> org.vertx.java.deploy.impl.**java.CompilingClassLoader.<**init>(Compiling
>>>>> ClassLoader.java:72)
>>>>> ... 11 more
>>>>>
>>>>> can any one please help me...
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to a topic in the
>>>>> Google Groups "vert.x" group.
>>>>> To unsubscribe from this topic, visit https://groups.google.com/d/**
>>>>> topic/vertx/17xzkF08bLA/**unsubscribe<https://groups.google.com/d/topic/vertx/17xzkF08bLA/unsubscribe>
>>>>> .
>>>>> To unsubscribe from this group and all of its topics, send an email to
>>>>> vertx+un...@**googlegroups.com.
>>>>>
>>>>> For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>>> .
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> With Regards
>>>> Jyothesh k
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "vert.x" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to vertx+un...@**googlegroups.com.
>>>>
>>>> For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>> .
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> You received this message because you are subscribed to a topic in the
>>>> Google Groups "vert.x" group.
>>>> To unsubscribe from this topic, visit https://groups.google.com/d/**
>>>> topic/vertx/17xzkF08bLA/**unsubscribe<https://groups.google.com/d/topic/vertx/17xzkF08bLA/unsubscribe>
>>>> .
>>>> To unsubscribe from this group and all of its topics, send an email to
>>>> vertx+un...@**googlegroups.com.
>>>>
>>>> For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>> .
Reply all
Reply to author
Forward
0 new messages