Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Issues with Hello World example for beginners(8080 port issue and SLF4J issue - and possibly a bug.)
Issues with Hello World example for beginners [message #1747277] Fri, 11 November 2016 14:56 Go to next message
Steve Conley is currently offline Steve ConleyFriend
Messages: 11
Registered: November 2016
Junior Member
A fix and a problem ...

I have a habit of not proceeding forward until I understand where I am ... and at the moment that involves:
Ubuntu 16.04.1
Eclipse Neon 1a
Scout 4.6.1
and (when I get to it Apache Tomcat 8.0.32)
and Oracle Java 8 u111

First, if Apache is up and running, following the example documentation directly will lead to an error because the port 8080 has already been taken.
Fix:
Fix for 8080 already taken:
helloworld.server.app.dev [webapp] dev server.launch:
change 8080 to 8081 as here:
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dscout.jetty.port=8081
-Djandex.rebuild=true"/>
AND in helloworld.ui.html.app.dev src/main/resources/config.properties:
change 8080 t0 8081 as here:
scout.server.url=http://localhost:8081

Then you may be faced with the next issue, which is my PROBLEM:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation

In trying to solve that with "many" ideas from the web, all of which fail in one way or another, I found what "seems" to be a bug in Eclipse, Scout or Maven, and I do not know which:

The most straight forward way to reproduce, is to go to the
helloworld.shared pop.xml and remove the dependency on ch.qos.logback.

If you then:
do a Scout "update all derived resource" (Needed ??)
then a maven update all projects,

you immediately get these compile errors:

Description Resource Path Location Type
HelloWorldFormData cannot be resolved to a type HelloWorldForm.java /helloworld.client/src/main/java/org/eclipse/scout/apps/helloworld/client/helloworld line 23 Java Problem
HelloWorldFormData cannot be resolved to a type HelloWorldForm.java /helloworld.client/src/main/java/org/eclipse/scout/apps/helloworld/client/helloworld line 93 Java Problem
HelloWorldFormData cannot be resolved to a type HelloWorldForm.java /helloworld.client/src/main/java/org/eclipse/scout/apps/helloworld/client/helloworld line 93 Java Problem
HelloWorldFormData cannot be resolved to a type HelloWorldFormTest.java /helloworld.client/src/test/java/org/eclipse/scout/apps/helloworld/client/helloworld line 42 Java Problem
HelloWorldFormData cannot be resolved to a type HelloWorldFormTest.java /helloworld.client/src/test/java/org/eclipse/scout/apps/helloworld/client/helloworld line 42 Java Problem
HelloWorldFormData cannot be resolved to a type HelloWorldFormTest.java /helloworld.client/src/test/java/org/eclipse/scout/apps/helloworld/client/helloworld line 45 Java Problem
HelloWorldFormData cannot be resolved to a type HelloWorldService.java /helloworld.server/src/main/java/org/eclipse/scout/apps/helloworld/server/helloworld line 15 Java Problem
HelloWorldFormData cannot be resolved to a type HelloWorldService.java /helloworld.server/src/main/java/org/eclipse/scout/apps/helloworld/server/helloworld line 15 Java Problem
HelloWorldFormData cannot be resolved to a type HelloWorldServiceTest.java /helloworld.server/src/test/java/org/eclipse/scout/apps/helloworld/server/helloworld line 28 Java Problem
HelloWorldFormData cannot be resolved to a type HelloWorldServiceTest.java /helloworld.server/src/test/java/org/eclipse/scout/apps/helloworld/server/helloworld line 28 Java Problem
HelloWorldFormData cannot be resolved to a type IHelloWorldService.java /helloworld.shared/src/main/java/org/eclipse/scout/apps/helloworld/shared/helloworld line 15 Java Problem
HelloWorldFormData cannot be resolved to a type IHelloWorldService.java /helloworld.shared/src/main/java/org/eclipse/scout/apps/helloworld/shared/helloworld line 15 Java Problem
The import org.eclipse.scout.apps.helloworld.shared.helloworld.HelloWorldFormData cannot be resolved HelloWorldForm.java /helloworld.client/src/main/java/org/eclipse/scout/apps/helloworld/client/helloworld line 15 Java Problem
The import org.eclipse.scout.apps.helloworld.shared.helloworld.HelloWorldFormData cannot be resolved HelloWorldFormTest.java /helloworld.client/src/test/java/org/eclipse/scout/apps/helloworld/client/helloworld line 16 Java Problem
The import org.eclipse.scout.apps.helloworld.shared.helloworld.HelloWorldFormData cannot be resolved HelloWorldService.java /helloworld.server/src/main/java/org/eclipse/scout/apps/helloworld/server/helloworld line 4 Java Problem
The import org.eclipse.scout.apps.helloworld.shared.helloworld.HelloWorldFormData cannot be resolved HelloWorldServiceTest.java /helloworld.server/src/test/java/org/eclipse/scout/apps/helloworld/server/helloworld line 12 Java Problem
The import org.eclipse.scout.apps.helloworld.shared.helloworld.HelloWorldFormData cannot be resolved IHelloWorldService.java /helloworld.shared/src/main/java/org/eclipse/scout/apps/helloworld/shared/helloworld line 6 Java Problem
The method load(HelloWorldFormData) from the type IHelloWorldService refers to the missing type HelloWorldFormData HelloWorldFormTest.java /helloworld.client/src/test/java/org/eclipse/scout/apps/helloworld/client/helloworld line 45 Java Problem
The type HelloWorldService must implement the inherited abstract method IHelloWorldService.load(HelloWorldFormData) HelloWorldService.java /helloworld.server/src/main/java/org/eclipse/scout/apps/helloworld/server/helloworld line 12 Java Problem
Type mismatch: cannot convert from HelloWorldFormData to HelloWorldFormData HelloWorldFormTest.java /helloworld.client/src/test/java/org/eclipse/scout/apps/helloworld/client/helloworld line 45 Java Problem


Fair enough (perhaps), but if you ADD those lines back - and the file is EXACTLY as it was before, repeat the refresh steps above,
YOU STILL have the compile errors.
And I have found no way to get rid of them once I have them, except delete the projects and start again.

This "seems" like a bug, but I don't know what piece of software is the issue (or if I am missing some step that needs to be done to "fresh" things.

It "seems" that the generated code for HelloWordFormData has been orphaned in some way - but it is still there.

I have repeated this from scratch to make sure of steps.


Re: Issues with Hello World example for beginners [message #1747286 is a reply to message #1747277] Fri, 11 November 2016 16:44 Go to previous messageGo to next message
Steve Conley is currently offline Steve ConleyFriend
Messages: 11
Registered: November 2016
Junior Member
Hm ... I solved one issue.

The extra step needed to get things to compile again:

Scout menu:
Create all Missing ClassId notations.

When doing that, it will in,fact compile again.

Now on to figure out what combination of slf4j stuff is needed in POMs.

It seems the "root" of the issue "may" be in helloworld.shared.

It has:
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>


If I "add" to that with the

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.12</version>
<scope>runtime</scope>
</dependency>

for example, I get an error saying I have "two" conflicting ones when I run either server or ui.

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/steve/.m2/repository/org/slf4j/slf4j-simple/1.7.12/slf4j-simple-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/steve/.m2/repository/ch/qos/logback/logback-classic/1.1.3/logback-classic-1.1.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]

It seems that it does now "work" - using the simple one.



Re: Issues with Hello World example for beginners [message #1747299 is a reply to message #1747277] Fri, 11 November 2016 19:19 Go to previous messageGo to next message
Santo Mota is currently offline Santo MotaFriend
Messages: 63
Registered: July 2013
Member
I had face a similar error, I'm not sure if its the same, but I let you this thread
check it and hope this help you.

https://www.eclipse.org/forums/index.php/m/1746136/#msg_1746136
Re: Issues with Hello World example for beginners [message #1747306 is a reply to message #1747286] Fri, 11 November 2016 21:09 Go to previous messageGo to next message
Steve Conley is currently offline Steve ConleyFriend
Messages: 11
Registered: November 2016
Junior Member
Ok, I finally found the combination that works with Tomcat to eliminate this slf4j error.

In helloworld.shared/pom.xml,

replace this:
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>

with this:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.12</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>

after doing this, debugging in Jetty still produces the

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation

but, logging works.

AND best of all, now logging works (for the first time) in the Tomcat webapps when deployed.
Logging appears in "catalina.out" var/lib/tomcat8/logs.

so I am back to the login failed problem of my other post.
Re: Issues with Hello World example for beginners [message #1747307 is a reply to message #1747299] Fri, 11 November 2016 21:11 Go to previous message
Steve Conley is currently offline Steve ConleyFriend
Messages: 11
Registered: November 2016
Junior Member
Santo, that appears to be a different issue from mine.

I never got that error message.

Remember also that you are working in Windows and I am working in Ubuntu 16.

Thanks for the suggestion though - and I am back to my issue with HTTPS.
Previous Topic:Any Doc. to Connect to MySQL
Next Topic:Logout
Goto Forum:
  


Current Time: Sat Dec 16 07:11:11 GMT 2017

Powered by FUDForum. Page generated in 0.01777 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software