2015-04-23 5 views
0

У меня довольно большое приложение GWT, и я хотел попробовать gwteventservice. Для этого я взял зависимость версии 1.2.1 от Maven Repository Page:Добавление gwteventservice в качестве проекта зависимости зависимости Maven project

<dependency> 
    <groupId>de.novanic.gwteventservice</groupId> 
    <artifactId>eventservice</artifactId> 
    <version>1.2.1</version> 
</dependency> 

После добавления его к моим pom.xml, обновлению зависимостей Maven и делать очистку сборки моего проекта, целую кучу ошибок компилятора неожиданно появился.
Я скопировал соответствующие сообщения на вкладке «Проблемы» в Затмении (каждая строка является отдельной записью):

The method setCellStyleNames(String) is undefined for the type Column<T,capture#5-of ?> 
The constructor SimplePager(SimplePager.TextLocation, boolean, int, boolean) is undefined 
com.google.gwt.cell.client.Cell.Context cannot be resolved to a type 
com.google.gwt.cell.client.Cell.Context cannot be resolved to a type 
The method getSafeUri() is undefined for the type ImageResource GameSearchTable.java 
The method getSafeUri() is undefined for the type ImageResource GameSearchTable.java 
The method getSafeUri() is undefined for the type ImageResource GameSearchTable.java 
The method getSafeUri() is undefined for the type ImageResource GameSearchTable.java 
The method getSafeUri() is undefined for the type ImageResource GameSearchTable.java 
The method setSortable(boolean) is undefined for the type GameSearchTable.RatingColumn 
The method setSortable(boolean) is undefined for the type GameSearchTable.StatusColumn 
The method setSortable(boolean) is undefined for the type TextColumn<GameDTO> 
The method setSortable(boolean) is undefined for the type TextColumn<GameDTO> 
The type GameSearchTable.RatingCell must implement the inherited abstract method AbstractCell<GameDTO>.render(GameDTO, Object, SafeHtmlBuilder) 
The type GameSearchTable.StatusCell must implement the inherited abstract method AbstractCell<GameDTO>.render(GameDTO, Object, SafeHtmlBuilder) 
com.google.gwt.cell.client.Cell.Context cannot be resolved to a type 
com.google.gwt.cell.client.Cell.Context cannot be resolved to a type 
The method getSafeUri() is undefined for the type ImageResource 
The method getSafeUri() is undefined for the type ImageResource 
The method getSafeUri() is undefined for the type ImageResource 
The method getSafeUri() is undefined for the type ImageResource 
The method getSafeUri() is undefined for the type ImageResource 
The method setSortable(boolean) is undefined for the type GameTable.RatingColumn 
The method setSortable(boolean) is undefined for the type GameTable.StatusColumn 
The method setSortable(boolean) is undefined for the type TextColumn<GameDTO> 
The type GameTable.RatingCell must implement the inherited abstract method AbstractCell<GameDTO>.render(GameDTO, Object, SafeHtmlBuilder) 
The type GameTable.StatusCell must implement the inherited abstract method AbstractCell<GameDTO>.render(GameDTO, Object, SafeHtmlBuilder) 
The constructor ActivityManager(ActivityMapper, EventBus) is undefined 
The method register(com.google.gwt.place.shared.PlaceController, com.google.gwt.event.shared.EventBus, com.google.gwt.place.shared.Place) in the type PlaceHistoryHandler is not applicable for the arguments (com.google.gwt.place.shared.PlaceController, com.google.web.bindery.event.shared.EventBus, com.google.gwt.place.shared.Place) 
The constructor PlaceController(EventBus) is undefined 
com.google.gwt.cell.client.Cell.Context cannot be resolved to a type 
com.google.gwt.cell.client.Cell.Context cannot be resolved to a type 
com.google.gwt.cell.client.Cell.Context cannot be resolved to a type 
Context cannot be resolved to a type 
Context cannot be resolved to a type 
The method getSafeUri() is undefined for the type ImageResource 
The method getSafeUri() is undefined for the type ImageResource 
The method getSafeUri() is undefined for the type ImageResource 
The method getSafeUri() is undefined for the type ImageResource 
The method getSafeUri() is undefined for the type ImageResource 
The method setSortable(boolean) is undefined for the type PlatformTable.ProgressBarColumn 
The method setSortable(boolean) is undefined for the type PlatformTable.RatingColumn 
The method setSortable(boolean) is undefined for the type PlatformTable.StatusColumn 
The method setSortable(boolean) is undefined for the type TextColumn<PlatformDTO> 
The type PlatformTable.ProgressBarCell must implement the inherited abstract method AbstractCell<PlatformDTO>.render(PlatformDTO, Object, SafeHtmlBuilder) 
The type PlatformTable.RatingCell must implement the inherited abstract method AbstractCell<PlatformDTO>.render(PlatformDTO, Object, SafeHtmlBuilder) 
The type PlatformTable.StatusCell must implement the inherited abstract method AbstractCell<PlatformDTO>.render(PlatformDTO, Object, SafeHtmlBuilder) 
The method setWidget(int, int, Widget) in the type HTMLTable is not applicable for the arguments (int, int, IsWidget) 
The method setWidget(int, int, Widget) in the type HTMLTable is not applicable for the arguments (int, int, IsWidget) 

Интересно, что они появляются только на стороне клиента кода. И без добавленной зависимости мое приложение отлично компилируется.

Моя среда:

  • Java 1.7.0_55
  • GWT 2.6.0
  • Maven 3.3.1

То, что я пытался до сих пор без особого успеха:

  • Использование более ранней версии (1.2.0) из gwteventservice в моем pom.xml
  • Затмения предложил Quick-Fix, чтобы добавить gwt-user.jar на мой путь сборки
  • Добавление зависимости gwt-user к моему pom.xml
  • Добавление соответствующих внешних банки непосредственно мой путь сборки (это единственное, что работает, но я действительно не нравится это решение ... Я предпочел бы все в моей pom.xml)

Так что вопрос:

  • Почему добавив зависимость разорвать мой проект и
  • как я могу это исправить?

Если ничего другого не помогает, я могу вместо этого взглянуть на gwt-comet.

+1

Я бы проверял, не повлияло ли 'eventervice' на вашу зависимость от GWT. Возможно, вы создаете снова 2.1.0, который находится в списке зависимостей службы событий. Является ли ваш проект проектом Eclipse проектом Maven? – Lukino

+0

Да, это проект maven. И то, что вы и @Guillaume Rebesche отметили, похоже на фактическую причину проблемы. – QBrute

ответ

1

Попробуйте исключить зависимость, транзитивно унаследованную от службы событий.

<dependencies> 
    .... 
    <dependency> 
    <groupId>de.novanic.gwteventservice</groupId> 
    <artifactId>eventservice</artifactId> 
    <version>1.2.1</version> 
    <exclusions> 
     <exclusion> 
      <artifactId>gwt-servlet</artifactId> 
      <groupId>com.google.gwt</groupId> 
     </exclusion> 
     <exclusion> 
      <artifactId>gwt-user</artifactId> 
      <groupId>com.google.gwt</groupId> 
     </exclusion> 
    </exclusion> 
    </dependency> 
    <dependency> 
     <artifactId>gwt-user</artifactId> 
     <groupId>com.google.gwt</groupId> 
     <version>2.6.0</version> 
    </dependency> 
    <dependency> 
     <artifactId>gwt-servlet</artifactId> 
     <groupId>com.google.gwt</groupId> 
     <version>2.6.0</version> 
    </dependency> 
    .... 
</dependencies> 

Но вы должны предоставить зависимости для обоих из них (даже если они не нужно), в то время как eventservice будет искать их.

+0

Это прекрасно работает. Зависимости включены и приложение компилируется :) – QBrute

1

gwteventservice имеет зависимость от gwt 2.1.0, как вы можете видеть here. Я не думаю, что вы можете использовать его с GWT 2.6.0.

+0

Я уверен, что они «затенены», и поэтому он может использовать новейшие классы, такие как SimplePager – Lukino

+0

Ah okay. Раньше я смотрел на «parent-1.2.1.pom», но я не обратил внимания на эту часть. Я считаю, что отказаться от этого далеко не вариант, поэтому мне придется искать другую инфраструктуру. Но спасибо в любом случае :) @ Лукино, это была одна моя теория, но я не думал об этом дальше. – QBrute

Смежные вопросы