开发者

how to resolve "java.lang.NoClassDefFoundError: org/apache/velocity/context/Context"

开发者 https://www.devze.com 2023-03-30 01:58 出处:网络
I\'m a new learner of apache cxf. in the first program i implement, i encoutered the following exception( this is what my console display):

I'm a new learner of apache cxf. in the first program i implement, i encoutered the following exception( this is what my console display):

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/velocity/context/Context The java code source i run is

package com.ttdev;

import org.apache.cxf.tools.wsdlto.WSDLToJava;

public class CodeGenerator {

/**
 * @param args
 */
public static void main(String[] args) {
    System.out.println("debug");
    WSDLToJava.main(new String[] {
            "-server",
            "-d", "src/main/java",
            "src/main/resources/开发者_Go百科Service.wsdl" });
            System.out.println("Done!");
}

} so how can i resolve this problem.


You need Apache Velocity on your classpath.


Check your Pom->DependencyHierarchy -> Filter "velocity" In which package it is found , Probably it was not loaded properly.

In mycase it was C:\Users\MyUser.m2\repository\org\apache\velocity

Delete that and run "mvn clean package -DskipTests" from console, it will download all necessary packages.

0

精彩评论

暂无评论...
验证码 换一张
取 消