我负责的CI服务器(Hudson)构建了Maven项目.在最后一次提交之后,构建失败:
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] \hudson\jobs\path to my class\MyClass.java:[33,62] package com.sun.xml.internal.messaging.saaj.packaging.mime.util does not exist
[ERROR] \hudson\jobs\path to my class\MyClass.java:[75,5] cannot find symbol
symbol : class BASE64EncoderStream
location: class |fullname of MyClass|
[ERROR] \hudson\jobs\path to my class\MyClass.java:[75,38] cannot find symbol
symbol : class BASE64EncoderStream
location: class |fullname of MyClass|
[INFO] 3 errors
Run Code Online (Sandbox Code Playgroud)
必需的类(com.sun.xml.internal.messaging.saaj.packaging.mime.util.BASE64EncoderStream)位于rt.jar中.
我尝试(按照http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#System_Dependencies中的说明)在项目的pom.xml中添加系统依赖项:
<dependency>
<groupId>dummy</groupId>
<artifactId>dummy</artifactId>
<version>1</version>
<scope>system</scope>
<systemPath>${java.home}/lib/rt.jar</systemPath>
</dependency>
Run Code Online (Sandbox Code Playgroud)
它没有帮助.
最有趣的是所有文件在我的同事的本地机器上编译得很好(他使用Eclipse内置编译器).
在互联网上,我发现了同样的问题(链接:http://maven.40175.n5.nabble.com/Why-can-t-Maven-find-com-sun-xml-internal-messaging-saaj-util-ByteOutputStream- class-td107361.html).最后一个答案是,这个问题的原因是Oracle的Java编译器.
所以,我将Oracle的jdk更改为OpenJDK,但它没有帮助.
有人对如何解决这个问题有任何建议吗?
我有.war文件,我需要做"部署脚本".是否可以用maven做到这一点?我可以只执行生命周期的部署阶段吗?或者最好使用其他一些仪器进行部署,如ant,gant等.
我想将我的自定义maven插件上传到nexus存储库.
我的问题是,当我通过web IU将我的插件上传到nexus时,普通依赖,maven无法找到它:
插件com.huawei:maven-project-version-plugin:1.0或其中一个依赖项无法解析:无法读取com.huawei的工件描述符:maven-project-version-plugin:jar:1.0:找不到com .mycompany:maven-project-version-plugin:pom:1.0在 http:// localhost:8081/nexus/content/groups/public缓存在本地存储库中,在nexus的更新间隔过去之前,不会重新尝试解析或强制更新 - > [帮助1]
但是当我通过命令行将我的插件安装到maven local repositiry(而不是nexus)时,一切都很好.
那么,安装自定义maven插件和安装"非插件"文物之间的区别是什么?有什么窍门吗?
我的settings.xml:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:8081/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<!--make the profile active …Run Code Online (Sandbox Code Playgroud) 我读过,Cassandra的二级索引是非常无用的功能.实际上,它使写入DB的速度慢得多,您只能通过精确索引找到值,并且您需要向claster中的所有服务器发出请求以按索引查找值.任何人都可以告诉我有关利益的信息,这将是使用二级指数的原因吗?
我想使用slf4j和logback进行日志记录.
您可以在下面看到我的logback.xml:
<configuration>
<appender name="FILE-MODULE" class="ch.qos.logback.core.FileAppender">
<file>module.log</file>
<encoder>
<pattern>
%date %level [%thread] %logger{10} [%file:%line] %msg%n
</pattern>
</encoder>
</appender>
<logger name="module" level="debug" additivity="false">
<appender-ref ref="FILE-MODULE" />
</logger>
</configuration>
Run Code Online (Sandbox Code Playgroud)
问题是:当我将我的应用程序部署到Tomcat时,日志文件存储在tomcat/bin文件夹中,我想将它存储在myapp文件夹(tomcat/webapp/myapp)中.
我怎样才能做到这一点?
我在基于angularjs的应用程序中使用uploadcare小部件.我将这个小部件集成为angular指令.
文档说,我应该设置全局变量来改变语言环境:
<script>
UPLOADCARE_LOCALE = 'ru';
</script>
Run Code Online (Sandbox Code Playgroud)
但我对角度不太熟悉.所以,我不知道它是如何动态的.
我会很高兴得到任何帮助.
更新
我尝试将$ rootScope添加到我的uploadcare指令并在那里设置UPLOADCARE_LOCALE变量:
angular.module("project").directive 'projectUploadcare', ($uploadcare, $rootScope) ->
restrict: 'E'
replace: true
template: '''
<span>
<span class="uploadcare-preview"></span>
<input type="hidden">
</span>
'''
link: (scope, element, attrs) ->
$rootScope.UPLOADCARE_LOCALE = 'ru'
... other code ...
Run Code Online (Sandbox Code Playgroud)
但它没有帮助.
当我向服务器发送请求时
...
Response response = builder.method(req.getMethod(), Entity.entity(req, req.getMediaType())); // req.getMediaType() return MediaType.APPLICATION_XML
if(response.getStatus() != 200)
throw new CoreErrorException("core resulted error with status = " + response.getStatus());
T resp = response.readEntity(respType);
...
Run Code Online (Sandbox Code Playgroud)
泽西在最后一行抛出异常:
org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyReader not found for media type=application/octet-stream
Run Code Online (Sandbox Code Playgroud)
我做了一些调查.首先,我抓住了这个回应:
Content-Length: 93
Date: Thu, 21 Nov 2013 12:53:46 GMT
Server: APP
<root>
<returncode>XXX</returncode>
<desc>some description</desc>
</root>
Run Code Online (Sandbox Code Playgroud)
标头不包含有关MediaType的任何信息.
实际上,当我尝试调用response.getMediaType()时,它返回null.
我想,那就是问题所在.Jersey无法检测到响应的MediaType并默认设置它("application/octet-stream").但实际上我的回答是XML.有什么方法可以告诉泽西岛吗?
在Eclipse (项目>属性> Java构建路径)中,我们有两个选项卡:用于将一些库添加到构建路径中,以及用于组织它们的顺序.那么,问题是为什么java buildpath中的顺序很重要?
java ×5
maven ×3
angularjs ×1
buildpath ×1
cassandra ×1
deployment ×1
eclipse ×1
file-upload ×1
http-headers ×1
indexing ×1
javascript ×1
jax-rs ×1
jersey ×1
locale ×1
logback ×1
logging ×1
nexus ×1
nosql ×1
plugins ×1
rest ×1
slf4j ×1
tomcat ×1
tui ×1
uploadcare ×1