IntelliJ make error

1,680 views
Skip to first unread message

Gilles Koffmann

unread,
Nov 10, 2014, 3:04:33 PM11/10/14
to mayoca...@googlegroups.com
Hello,

with IntelliJ configured with dev snapshot I get the following make error

Error:Cannot compile Groovy files: no Groovy library is defined for module 'mayocat-platform-store-rdbms-migrations'

There is no such error when compiling in command line.

Cheers
Gilles

Jérôme Velociter

unread,
Nov 10, 2014, 4:18:00 PM11/10/14
to mayoca...@googlegroups.com
Hi,

It seems IntelliJ needs groovy-all as a compile dependency - I've added it back, it should be fixed with https://github.com/mayocat/mayocat-shop/commit/03840d6bd236f31eb6f3953aabe64cbdd2724457

Jerome

Jérôme Velociter

unread,
Nov 10, 2014, 4:23:55 PM11/10/14
to mayoca...@googlegroups.com
Note: you might need to Maven-reimport in Idea for the fix to work.

Gilles Koffmann

unread,
Nov 12, 2014, 8:29:19 AM11/12/14
to mayoca...@googlegroups.com
Hello Jerome,

I did re-import in IntelliJ. The groovy error was resolved.
Now I have the following error when compiling in IntelliJ:

C:\path_to_mayocat\mayocat-shop\platform\accounts\security\src\main\java\org\mayocat\accounts\jersey\CheckTenantAndUserMethodDispatch.java
Error:(17, 35) java: package org.mayocat.accounts.api.v1 does not exist
Error:(163, 20) java: cannot find symbol
  symbol:   class TenantUserApi
  location: class org.mayocat.accounts.jersey.CheckTenantAndUserMethodDispatch.CheckAuthorizationMethodDispatcher

Regards
Gilles

Jérôme Velociter

unread,
Nov 12, 2014, 9:58:30 AM11/12/14
to mayoca...@googlegroups.com
Hi Gilles,

It seems IntelliJ does not automatically recognize src/main/groovy as a source root, like it does for java.

I'm trying to find a workaround. Apparently this can be done with the maven build helper plugin, I'll update here when I figure it out.

In the mean time you can mark them as source root manually (right click on the groovy folders then "Mark Directory As" -> "Sources root")

There are quite a few groovy src directories, so this is a pain

./platform/manager/src/main/groovy
./platform/accounts/default/src/main/groovy
./platform/accounts/rest/src/main/groovy
./platform/rest/default/src/main/groovy
./platform/rest/api/src/main/groovy
./platform/store/rdbms/migrations/src/main/groovy
./cms/news/src/main/groovy
./cms/pages/src/main/groovy
./cms/home/src/main/groovy
./shop/cart/internal/src/main/groovy
./shop/catalog/internal/src/main/groovy
./shop/marketplace/src/main/groovy
./shop/customer/internal/src/main/groovy
./shop/customer/api/src/main/groovy
./shop/billing/internal/src/main/groovy

Jerome

Jérôme Velociter

unread,
Nov 12, 2014, 10:16:15 AM11/12/14
to mayoca...@googlegroups.com
Gilles,

That was quicker that I thought : this is fixed now in https://github.com/mayocat/mayocat-shop/commit/235b47f83ee26f8b8ac2c7e2253b5db8300d9944

Jerome

Gilles Koffmann

unread,
Nov 12, 2014, 11:48:26 AM11/12/14
to mayoca...@googlegroups.com
Jerome,

I did re-import the last version.
Now it compiles OK in IntelliJ. Thank´s!!!!

Now I have a problem creating the admin user thru CURL. I get an unauthorized error

 curl -i -H "Content-Type: application/json" -X POST -d " \
>   {                                                      \
>     \"slug\"   : \"admin\",                              \
>     \"email\"    : \"hid...@gmail.com\",                   \
>     \"password\":\"hidden\"                         \
>   }                                                      \
>   "                                                      \
HTTP/1.1 401 Unauthorized
Date: Wed, 12 Nov 2014 16:36:57 GMT
WWW-Authenticate: realm="Mayocat Shop"
Content-Type: text/plain
Set-Cookie: session=deleted;Path=/;Expires=Thu, 01-Jan-1970 00:00:01 GMT
Set-Cookie: flash=deleted;Path=/;Expires=Thu, 01-Jan-1970 00:00:01 GMT
Transfer-Encoding: chunked

Request is not properly authenticated.

What do you think this is ?

I did not get that with 0.3 version installed from the web site

Gilles

Gilles Koffmann

unread,
Nov 12, 2014, 2:29:08 PM11/12/14
to mayoca...@googlegroups.com
Jerome,

I have no agent in my database so I don´t understand why I can´t create the initial user

if (this.isTenantEmptyOfUser() && this.isCreateUserResource()) {
                    // This means there is no user for that tenant yet, and this is the request to create the
                    // initial user.
                    // Awright, you good to go

                } else {
                    // TODO make the authentication challenge configurable
                    throw new WebApplicationException(Response.status(Response.Status.UNAUTHORIZED)
                            .header("WWW-Authenticate", "realm=\"Mayocat Shop\"")
                            .entity("Request is not properly authenticated.")
                            .type(MediaType.TEXT_PLAIN_TYPE)
                            .build());

Jérôme Velociter

unread,
Nov 12, 2014, 3:51:35 PM11/12/14
to mayoca...@googlegroups.com
I'm debugging this now with a fresh DB.

Jérôme Velociter

unread,
Nov 12, 2014, 4:23:33 PM11/12/14
to mayoca...@googlegroups.com
This is now fixed on master.

Note: make sur to activate multitenancy in mayocat.yml if you want to create a multi-tenant platform (it's not activated by default in mayocat.yml.example)

Jerome

Gilles Koffmann

unread,
Nov 13, 2014, 9:17:30 AM11/13/14
to mayoca...@googlegroups.com
Ok Jerome,

Now I could create the admin user.

What I have now is :

1- in single tenant mode, I've created a product and when i access the product I have the error "can not find product.html"

2- in multi-tenant mode I had to create a new admin so to access tenant manager
When I try to access the shop, it goes to shop.localhost:8080  and the browser fail with DNS_PROBE_FINISHED_NXDOMAIN

I created a new tenant but I have the same problem.

Cheers
Gilles

Jerome Velociter

unread,
Nov 13, 2014, 9:48:42 AM11/13/14
to Gilles Koffmann, mayoca...@googlegroups.com
Gilles,

I think the the error "can not find product.html" is the same as your
other error "theme not found", related to the encoding of paths. I'll
have to try and setup a windows machine to debug this.

In multi-tenant mode, you'll have to edit your /etc/hosts/ to point
all <shopname>.localhost to 127.0.0.1. Note that I plan to make it
easier on local mode by enabling path based navigation (like
http://localhost:8080/tenant/<shopname>/).

Cheers,

Jerome
> --
> You received this message because you are subscribed to the Google Groups
> "mayocat-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mayocat-user...@googlegroups.com.
> To post to this group, send email to mayoca...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mayocat-users/bfbf1e12-1788-4c32-a25e-e9860f940c66%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Gilles Koffmann

unread,
Nov 13, 2014, 10:59:20 AM11/13/14
to mayoca...@googlegroups.com, gilles....@gmail.com, jerome.v...@gmail.com
Jerome,

Ok I´ve configured my host, now I´m accessing the tenants
For the other point you are right: in debugging mode the theme property of DefaultWebContext is null so for sure it was not found because of the path problem.

Cheers
Gilles

Gilles Koffmann

unread,
Nov 13, 2014, 11:21:10 AM11/13/14
to mayoca...@googlegroups.com, gilles....@gmail.com, jerome.v...@gmail.com
Jerome,

When I debug it seems that the application is seeking the theme in 3 places before surrendering

First, base folder is : path_to_mayocat/shop/application

Then it searches in : 
1- data\tenants\shop\themes\default
2- data\themes\default
3- themes\default


Well, it does not find anything since in my installation there is no such folders.

in the path_to_mayocat/shop/application i have only the following folders

data\elasticsearch
data\imagecache

Gilles

Gilles Koffmann

unread,
Nov 13, 2014, 11:38:07 AM11/13/14
to mayoca...@googlegroups.com, gilles....@gmail.com, jerome.v...@gmail.com
So I guess I have to create those directories.. trying this

Gilles Koffmann

unread,
Nov 13, 2014, 11:42:01 AM11/13/14
to mayoca...@googlegroups.com, gilles....@gmail.com, jerome.v...@gmail.com
Jerome, that was it !!!! 

Jérôme Velociter

unread,
Nov 14, 2014, 9:11:07 AM11/14/14
to mayoca...@googlegroups.com, gilles....@gmail.com, jerome.v...@gmail.com
Hi Gilles,

I think there is still an issue : as you say normally the theme manager looks into :
1- data\tenants\shop\themes\default (the tenant own theme)
2- data\themes\default (default themes of the platform)
3- themes\default (default themes packaged in a jar / classpath resources)

Number 3- should always exists.

Did you startup from IntelliJ or from command line ? If you started from intelliJ you have to make sure the theme is added as classpath resources (same as client assets per http://www.mayocat.org/building-guide). I realize this isn't documented on the building guide, I'll update it.

Jerome
Reply all
Reply to author
Forward
0 new messages