我正在使用我的Ubuntu 14.04 LTS进行构建但是我得到以下内容:
Started by user anonymous
Building in workspace /var/lib/jenkins/workspace/videovixx
> /usr/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> /usr/bin/git config remote.origin.url https://bitbucket.org/mdennis10/videovixx.git # timeout=10
Fetching upstream changes from https://bitbucket.org/mdennis10/videovixx.git
> /usr/bin/git --version # timeout=10
using .gitcredentials to set credentials
> /usr/bin/git config --local credential.helper store -- file=/tmp/git6236060328558794078.credentials # timeout=10
> /usr/bin/git fetch --tags --progress https://bitbucket.org/mdennis10/videovixx.git +refs/heads/*:refs/remotes/origin/*
> /usr/bin/git config --local --remove-section credential # timeout=10
> /usr/bin/git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> /usr/bin/git rev-parse …Run Code Online (Sandbox Code Playgroud) 我在eclipse中有一个maven android项目,即使我已经配置我的项目使用兼容性库,它仍然在我的styles.xml中给出以下错误:
android:colorAccent requires API level 21 (current min is 15)
android:colorPrimary requires API level 21 (current min is 15)
android:colorPrimaryDark requires API level 21 (current min is 15)
Run Code Online (Sandbox Code Playgroud)
style.xml
<style name="AppBaseTheme" parent="Theme.AppCompat"></style>
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:colorPrimary">@color/primary</item>
<item name="android:colorPrimaryDark">@color/primary_dark</item>
<item name="android:colorAccent">@color/accent</item>
</style>
Run Code Online (Sandbox Code Playgroud)
AndroidManifest.xml中
package="com.app"
android:versionCode="1"
android:versionName="0.0.1-SNAPSHOT" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity android:name="com.app.activity.MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Run Code Online (Sandbox Code Playgroud)
的pom.xml
<build>
<finalName>${project.artifactId}</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId> …Run Code Online (Sandbox Code Playgroud) 我想使用Alamofire从Web API检索持票令牌,但我是ios和alamofire的新手.如何通过Alamofire实现这一目标?
func executeURLEncodedRequest(url: URL, model: [String : String]?, handler: RequestHandlerProtocol) {
addAuthorizationHeader()
Alamofire.request(.POST,createUrl(url), parameters: model, headers: headers,encoding:.Json)
}
Run Code Online (Sandbox Code Playgroud) 我有一个包含两个表User和Country的数据库.我想要关系,许多用户可以属于一个县.我使用以下模型类使用hibernate实现它:
@Entity (name = "user")
public class User {
@Id @GeneratedValue (strategy = GenerationType.IDENTITY)
private int userId;
private String username;
private String password;
@ManyToOne ()
@JoinColumn (name = "countryId")
private Country country;
//Getter & Setter
}
@Entity (name = "country")
public class Country {
@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
private int countryId;
private String countryName;
//Getter & Setter
}
Run Code Online (Sandbox Code Playgroud)
当我尝试保存用户对象时,我得到以下异常:
org.hibernate.HibernateException: Data was not saved: object references an unsaved transient instance - save the transient instance before flushing: com.kyrogaming.models.Country
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?
我使用Eclipse Maven插件创建了一个Java EE 7项目.我的问题是当我运行应用程序时,实现SerlvetContextListener的类不会被调用.是什么导致了这个问题?
@WebListener
public class ApplicationContextListener implements ServletContextListener{
@Override
public void contextInitialized(ServletContextEvent sce)
{
Request request = new HttpRequest(sce);
new Thread (request).start();
HibernateUtil.getSessionFactory();
}
@Override
public void contextDestroyed(ServletContextEvent sce)
{
}
}
Run Code Online (Sandbox Code Playgroud)
web.xml中:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<listener>com.kyrogaming.AppServletContextListener</listener>
<!-- Jersey Mapping -->
<servlet>
<servlet-name>jersey-servlet</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>com.kyrogaming.webservices</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>jersey-servlet</servlet-name>
<url-pattern>/service/*</url-pattern>
</servlet-mapping>
<!-- end Jersey Mapping -->
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
Run Code Online (Sandbox Code Playgroud)
我正在编写一个Android应用程序,它需要在应用程序需要的数据访问API中注入依赖项(我正在实现此API).我不想手动编写依赖注入.因此,我在考虑使用Spring.我意识到弹簧有两个版本.常规版和Android版.可以在android应用程序中使用常规版本因为我只想要依赖注入功能并且已经有了文件.
我真的不明白class关键字在某些情况下是如何工作的.
例如,该get(ClientResponse.class)方法采用 ClientResponse.class.当它获得它时它如何使用它,并且仅仅传递它的实例有什么优势?
我正在使用 Spring Web、Spring Security 和 Spring Social 创建一个 Spring boot 应用程序。该应用程序包含利用基本身份验证来确保安全的其余服务。我正在尝试配置 Spring 以使应用程序无状态,但是当我使用浏览器向 Web 服务发出请求时,浏览器会提示输入用户凭据,但由于会话创建,所有先前的请求都使用相同的用户凭据。我已经配置了应用程序阻止这种情况发生,但仍然存在问题。\
public class SecurityConfig extends WebSecurityConfigurerAdapter{
@override
protected void configure(HttpSecurity http) throws Exception{
http.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
.csrf().disable()
.authorizeRequests()
.antMatchers("/api/**")
.hasRole("USER")
.andBasic();
}
@override
protected void configure(AuthenticatioinManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication()
.withUser("some@gmail.com")
.password("12345")
.role("USER");
}
}
Run Code Online (Sandbox Code Playgroud)
我应该更改或添加什么才能获得此功能。
当我在Android Studio 2.2中启用Jack编译器时,不会生成Dagger 2组件.Dagger 2可以和杰克一起使用吗?如果是这样,我将如何配置我的应用程序?
从我的应用程序build.gradle:
jackOptions {
enabled true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 jersey 框架实现 jax-rs Web 服务。我已经编写了 Web 服务,但我不完全理解 web.xml 标签的含义,所以我不知道我是否已正确配置它,但当我尝试访问该服务时,我收到错误。这是网络服务:
package org.LMS.Controller;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
@Path ("/test")
public class Test {
private String name = "Worked";
@GET
@Produces (MediaType.APPLICATION_XHTML_XML)
public String getTest ()
{
return name;
}
}
Run Code Online (Sandbox Code Playgroud)
我的 web.xml 是:
<!-- Test web service mapping -->
<servlet>
<display-name>Test</display-name>
<servlet-name>Test</servlet-name>
<servlet-class>org.LMS.Controller</servlet-class>
<init-param>
<param-name>org.LMS.Controller.Test</param-name>
<param-value>eduscope</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>Test</servlet-name>
<url-pattern>/test</url-pattern>
</servlet-mapping>
<!--end Test web service mapping -->
Run Code Online (Sandbox Code Playgroud)
这是我尝试访问我的应用程序时遇到的错误: HTTP Status 500 - type Exception report message …