Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 4790

I can't deploy the rest-builder module (Liferay 7.4)

$
0
0

The rest-builder module is created without problem in the “modules” folder of the workspace with the following command: blade create -t rest-builder demo-rest-builder

Next I refresh the gradle of the project, the rest-builder module is shown in the project explorer without any problem.

rest-builder module created in the workspace

In the “rest-openapi.yaml” file I have added the following code:

rest-openapi.yaml file

info:    description: "DemoRestBuilder REST API"    license:        name: "Apache 2.0"        url: "http://www.apache.org/licenses/LICENSE-2.0.html"    title: "DemoRestBuilder"    version: v1.0openapi: 3.0.1paths:"/get-usuario":    get:      operationId: getUsuarioById      parameters:        - in: query          name: usuarioId          required: true          schema:            type: integer            format: int64      responses:        200:          description: "Success Response"          content:            application/json:              schema:                items:                  $ref: "#/components/schemas/UsuarioEntidad"            application/xml:              schema:                items:                  $ref: "#/components/schemas/UsuarioEntidad"      tags: ["Usuario"]components:  schemas:    UsuarioEntidad:      properties:        usuarioId:          type: integer          format: int64

The following command is then executed in the “demo-rest-builder” module path: blade gw buildREST

The project's gradle is then refreshed, where the following packages will be automatically created:

demo-rest-builder-impl src package

Finally, the following command is executed: blade gw deploy

An error occurs in the “BaseUsuarioResourceImpl” class because it is importing the deprecated class “TransformUtil”.

Deprecated Transform class 1

Deprecated Transform class 2

Trace error in rest builder module deployment

Task :modules:demo-rest-builder:demo-rest-builder-impl:compileJava FAILED/Projects/Liferay_Projects/compania_ficticia/compania_ficticia_repositorio/compania-ficticia-workspace/modules/demo-rest-builder/demo-rest-builder-impl/src/main/java/demo/rest/builder/internal/resource/v1_0/BaseUserResourceImpl.java:259: error: no suitable method found for transform(T#1[],UnsafeFunction<T#1,R#1,Exception>,Class<CAP#1>)return TransformUtil.transform(array, unsafeFunction, clazz);^method TransformUtil.<T#2,R#2,E#1>transform(Collection<T#2>,UnsafeFunction<T#2,R#2,E#1>) is not applicable(cannot infer type-variable(s) T#2,R#2,E#1(actual and formal argument lists differ in length))method TransformUtil.<R#3,E#2>transform(int[],UnsafeFunction<Integer,R#3,E#2>,Class) is not applicable(cannot infer type-variable(s) R#3,E#2(argument mismatch; T#1[] cannot be converted to int[]))method TransformUtil.transform(long[],UnsafeFunction,Class) is not applicable(cannot infer type-variable(s) R#4,E#3(argument mismatch; T#1[] cannot be converted to long[]))method TransformUtil.transform(T#3[],UnsafeFunction,Class) is not applicable(inference variable R#5 has incompatible boundsequality constraints: R#1lower bounds: CAP#1)where T#1,R#1,T#2,R#2,E#1,R#3,E#2,R#4,E#3,T#3,R#5,E#4 are type-variables:T#1 extends Object declared in method transform(T#1[],UnsafeFunction,Class)R#1 extends Object declared in method <T#1,R#1>transform(T#1[],UnsafeFunction<T#1,R#1,Exception>,Class)T#2 extends Object declared in method transform(Collection,UnsafeFunction)R#2 extends Object declared in method transform(Collection,UnsafeFunction)E#1 extends Throwable declared in method transform(Collection,UnsafeFunction)R#3 extends Object declared in method transform(int[],UnsafeFunction,Class)E#2 extends Throwable declared in method transform(int[],UnsafeFunction,Class)R#4 extends Object declared in method transform(long[],UnsafeFunction,Class)E#3 extends Throwable declared in method transform(long[],UnsafeFunction,Class)T#3 extends Object declared in method transform(T#3[],UnsafeFunction,Class)R#5 extends Object declared in method transform(T#3[],UnsafeFunction,Class)E#4 extends Throwable declared in method transform(T#3[],UnsafeFunction,Class)where CAP#1 is a fresh type-variable:CAP#1 extends Object from capture of ?/Projects/Liferay_Projects/compania_ficticia/compania_ficticia_repositorio/compania-ficticia-workspace/modules/demo-rest-builder/demo-rest-builder-impl/src/main/java/demo/rest/builder/internal/resource/v1_0/BaseUserResourceImpl.java:266: error: method transformToArray in class TransformUtil cannot be applied to given types;return TransformUtil.transformToArray(^required: Collection,UnsafeFunction,Classfound: Collection,UnsafeFunction,Classreason: inference variable R#1 has incompatible boundsequality constraints: R#2lower bounds: CAP#1where T#1,R#1,E,T#2,R#2 are type-variables:T#1 extends Object declared in method transformToArray(Collection,UnsafeFunction,Class)R#1 extends Object declared in method transformToArray(Collection,UnsafeFunction,Class)E extends Throwable declared in method transformToArray(Collection,UnsafeFunction,Class)T#2 extends Object declared in method transformToArray(Collection,UnsafeFunction,Class)R#2 extends Object declared in method <T#2,R#2>transformToArray(Collection<T#2>,UnsafeFunction<T#2,R#2,Exception>,Class<?>)where CAP#1 is a fresh type-variable:CAP#1 extends Object from capture of ?Note: /Projects/Liferay_Projects/compania_ficticia/compania_ficticia_repositorio/compania-ficticia-workspace/modules/demo-rest-builder/demo-rest-builder-impl/src/main/java/demo/rest/builder/internal/resource/v1_0/BaseUserResourceImpl.java uses or overrides a deprecated API.Note: Recompile with -Xlint:deprecation for details.2 errors

FAILURE: Build failed with an exception.

  • What went wrong:Execution failed for task ':modules:demo-rest-builder:demo-rest-builder-impl:compileJava'.

Compilation failed; see the compiler error output for details.

  • What solution could be applied to this?
  • What am I doing wrong?

Viewing all articles
Browse latest Browse all 4790

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>