小编Ely*_*ian的帖子

无法反序列化;嵌套异常是 org.springframework.core.serializer.support.SerializationFailedException: Failed to deserialize payload

我正在使用eclipse marse jee, spring 4, redis 3

spring这里下载了一个例子。此示例有 4 个应用程序:

admin- gateway- resource- ui

我已经运行了所有这些程序。我测试http://localhost:8080/ui/并使用用户名:admin,密码:admin 登录。我在ui应用程序中遇到了这个错误。

org.springframework.data.redis.serializer.SerializationException: Cannot deserialize; nested exception is org.springframework.core.serializer.support.SerializationFailedException: Failed to deserialize payload. Is the byte array a result of corresponding serialization for DefaultDeserializer?; nested exception is java.io.InvalidClassException: org.springframework.security.core.context.SecurityContextImpl; local class incompatible: stream classdesc serialVersionUID = 410, local class serialVersionUID = 400
    at org.springframework.data.redis.serializer.JdkSerializationRedisSerializer.deserialize(JdkSerializationRedisSerializer.java:41) ~[spring-data-redis-1.6.4.RELEASE.jar:na]
    at org.springframework.data.redis.core.AbstractOperations.deserializeHashValue(AbstractOperations.java:316) ~[spring-data-redis-1.6.4.RELEASE.jar:na]
    at org.springframework.data.redis.core.AbstractOperations.deserializeHashMap(AbstractOperations.java:277) …
Run Code Online (Sandbox Code Playgroud)

java spring

8
推荐指数
2
解决办法
3万
查看次数

在 textview 上更改约束布局时,文本不跟随动画

我试图在文本视图上制作动画,当它被按下时。

文本视图在顶部扩展以填充屏幕。

以下两张图片显示了我按下之前和之后的文本视图。

点击前

动画片

如您所见,在更改约束布局(做动画)时,文本会向下跳。

红点,textView 中的一个 drawable 应该遵循,但文本行为错误。我附上了 onclick 方法调用的动画代码。它改变了 textview 中的约束。

注意:mapsContainer 是包含谷歌地图和菜单栏的容器。searchDummmy 是文本视图。

guidelineText 是一条线,用于设置 searchdummy 的高度。

private void animateSearchDummy() {

    searchDummyConsttraints.clone((ConstraintLayout) fragmentView.findViewById(R.id.mapsContainer));

    AutoTransition t = new AutoTransition();
    t.setDuration(5000);
    TransitionManager.beginDelayedTransition((ConstraintLayout) fragmentView.findViewById(R.id.mapsContainer), t);

    searchDummyConsttraints.clear(R.id.searchDummy);

    searchDummyConsttraints.constrainHeight(R.id.searchDummy, 0);
    searchDummyConsttraints.connect(R.id.searchDummy, ConstraintSet.BOTTOM, R.id.guidelineTest, ConstraintSet.TOP, 0);
    searchDummyConsttraints.connect(R.id.searchDummy, ConstraintSet.LEFT, R.id.mapsContainer, ConstraintSet.LEFT,0);
    searchDummyConsttraints.connect(R.id.searchDummy, ConstraintSet.RIGHT, R.id.mapsContainer, ConstraintSet.RIGHT,0);
    searchDummyConsttraints.connect(R.id.searchDummy, ConstraintSet.TOP, R.id.mapsContainer, ConstraintSet.TOP,0);

    searchDummyConsttraints.applyTo((ConstraintLayout) fragmentView.findViewById(R.id.mapsContainer)); 
}
Run Code Online (Sandbox Code Playgroud)

还附上了该视图的 xml 文件。

private void animateSearchDummy() {

    searchDummyConsttraints.clone((ConstraintLayout) fragmentView.findViewById(R.id.mapsContainer));

    AutoTransition t = new AutoTransition();
    t.setDuration(5000);
    TransitionManager.beginDelayedTransition((ConstraintLayout) fragmentView.findViewById(R.id.mapsContainer), t);

    searchDummyConsttraints.clear(R.id.searchDummy);

    searchDummyConsttraints.constrainHeight(R.id.searchDummy, 0); …
Run Code Online (Sandbox Code Playgroud)

animation android textview android-layout android-constraintlayout

6
推荐指数
0
解决办法
888
查看次数

如何在android中更改TextInputLayout颜色?

嗨,我是 android 新手,在我的应用程序中,我使用的是 TextInputLayout 字段。

我设置了 EditText 边框颜色,但我不想设置编辑文本背景颜色,但根据我下面的代码,当我点击“注册”按钮时,编辑文本背景颜色显示为红色。

我们如何更改此背景颜色?

编辑文本_背景:-

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle" >

    <solid android:color="@android:color/white" />

    <stroke
        android:width="1dip"
        android:color="@android:color/holo_purple" />

    <padding android:left="5dp"
        android:top="5dp"
        android:right="5dp"
        android:bottom="5dp"/>

</shape>
Run Code Online (Sandbox Code Playgroud)

款式:-

 <style name="TextAppearance.App.TextInputLayout" parent="@android:style/TextAppearance">
        <item name="android:textColor">@color/splahbgcolor</item>
        <item name="android:textSize">14sp</item>
    </style>
Run Code Online (Sandbox Code Playgroud)

main.xml:-

<LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="?attr/actionBarSize"
        android:orientation="vertical"
        android:paddingLeft="20dp"
        android:paddingRight="20dp"
        android:paddingTop="60dp">

        <android.support.design.widget.TextInputLayout
            android:id="@+id/input_layout_name"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:hintTextAppearance="@style/TextAppearance.App.TextInputLayout">

            <android.support.v7.widget.AppCompatEditText
                android:id="@+id/input_name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:singleLine="true"
                android:background="@drawable/edittext_background"
                android:ems="10"
                android:inputType="textEmailAddress"
                android:padding="8dp"
                android:textColor="@color/splahbgcolor"
                android:hint="@string/hint_name" />

        </android.support.design.widget.TextInputLayout>
Run Code Online (Sandbox Code Playgroud)

主要活动:-

public class MainActivity extends AppCompatActivity {

    private Toolbar toolbar;
    private EditText inputName, inputEmail, inputPassword;
    private TextInputLayout …
Run Code Online (Sandbox Code Playgroud)

android android-textinputlayout

5
推荐指数
1
解决办法
3757
查看次数

如何使用批处理在 jenkins 上运行带有 SSH 密钥的 git 命令?

我有一个在我的詹金斯管道上运行的bat脚本。

它用于标记我的分支的特定提交,并将其推送回 git。看起来像这样:

"scriptCommand": https://%C_USERNAME%:%C_PASSWORD%@bitbucket.psr.io/scme/ci/ci.git\ngit push origin TAG1\ngit remote set-url --push origin https://bitbucket..psr.io/scme/ci/ci.git"
Run Code Online (Sandbox Code Playgroud)

该命令是使用变量 C_USERNAME、C_PASSWORD 和 TAG1 进行的。前两个取自 usernamePassword 类型的 jenkins 凭证,并注入到字符串中,TAG1 是一个 simple 字符串,应该用于标记我的 git 分支

当我为我的存储库使用 http 链接而不是 SSH 链接时,这是有效的

我还需要能够处理 SSH 链接。为此,我研究了 SSH 私钥,结果发现 jenkins 凭证有一个特定的字段:带有私钥的 SSH 用户名

我使用我的私钥和用户名在詹金斯中创建了一个这样的凭证

但现在我在如何创建一个与上面带有 http 链接的批处理行相同的批处理行时遇到了麻烦。

不用说,我在这件事上的经验是0。

有人可以帮我解决这个问题吗?感谢您抽出时间。

git ssh batch-file jenkins

4
推荐指数
1
解决办法
7696
查看次数

如何在opencv中合并轮廓?

好的,伙计们,我已经在这个项目上工作了很长一段时间了。

我正在构建这个玩 chrome 恐龙游戏的机器人。所以我尝试了其他方法来检测像 matchTemplate 这样的字符,甚至使用我自己的算法来定位对象,但我最喜欢这个(findcontours)。

这是我所拥有的:

我的程序看到了什么

谁能帮我找出我应该如何合并仙人掌的两个矩形?

img = screen_cap()
roi = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
ret, thresh = cv2.threshold(roi,127, 255, 0)
im2, contours, hierarchy = cv2.findContours(thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
first = True
for cnt in contours:
    area = cv2.contourArea(cnt)
    if area > 200: #filtering contours
        x,y,w,h = cv2.boundingRect(cnt)
        if w/h < 4: # filtering even more
            cv2.rectangle(img,(x,y),(x+w,y+h),(255,0,0),2)
Run Code Online (Sandbox Code Playgroud)

python opencv artificial-intelligence

3
推荐指数
3
解决办法
9328
查看次数

如何在 Java 中将 CRON 字符串转换为 ScheduleExpression?

我遇到了这个问题:

我有一个文本字段,

应该写一个 CRON 表达式,然后保存。

现在我需要一种方法来cron的字符串转换(这里有一些随机的例子:http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger.html)到Java ScheduleExpression(HTTP:/ /docs.oracle.com/javaee/6/api/javax/ejb/ScheduleExpression.html )

但是,我不知道该怎么做......

我有一个基于计时器的执行系统,它只能在几天、几周和几个月内运行,但现在我需要实现 CRON 模型,以便可以在特定的时间段内运行执行...

这是一个小代码,只是为了支持我:

@Resource
private TimerService timerService;


@Timeout
public void execute(Timer timer) {
    Script s = (Script) timer.getInfo();
    execute(s, true);
    System.out.println("Timer Service : " + s.getScriptId());
    System.out.println("Current Time : " + new Date());
    System.out.println("Next Timeout : " + timer.getNextTimeout());
    System.out.println("Time Remaining : " + timer.getTimeRemaining());
    System.out.println("____________________________________________");
    Date today = new Date();
    if (s.getTimerSetup().getEndDate() <= today.getTime()) {
        stopTimer(s);
    }
}


@Override
public void startTimer(Script s) {
    if …
Run Code Online (Sandbox Code Playgroud)

java cron timer

3
推荐指数
1
解决办法
4364
查看次数

一个查询中的 MySQL 一对多关系

如何在ONE查询中获取数据一对多关系?

示例:一本书有很多作者。

结果返回应该是这样的:

array(
   'book_title' => 'HTML for Dummies',
   'book_desc'  => '...',
   'authors' => array(
       [0] => array(
           'name' => 'Someone',
           'dob'  => '...'
       ),
       [1] => array(
           'name' => 'Someone',
           'dob'  => '...'
       )
    )
)
Run Code Online (Sandbox Code Playgroud)

我曾尝试使用子查询来选择结果,但不是运气:

SELECT *, (
    SELECT * 
    FROM authors
    WHERE book_id = b.id
) AS authors
FROM book b;
Run Code Online (Sandbox Code Playgroud)

Mysql 错误“操作数应包含 1 列”,这意味着我只能选择一列。

您可能会建议我使用 join 但它如何像我向您展示的那样存档返回结果格式?

mysql one-to-many

2
推荐指数
1
解决办法
1万
查看次数

如何在单击按钮时更改 div 背景颜色?

我可以更改背景颜色红色、蓝色和绿色,但是当我单击“重置”按钮时,我在 Chrome(浏览器)中收到错误消息:

btnReset 不是一个函数,

单击“重置”按钮时如何使所有 div 为空白?

function btnRed() {
  document.getElementById("Div1").style.backgroundColor="Red";
}
function btnGreen() {
  document.getElementById("Div2").style.backgroundColor="Green";
}
function btnBlue() {
  document.getElementById("Div3").style.backgroundColor="Blue";
}
function btnReset() {
  document.getElementById("Div1").style.backgroundColor="Black";
  document.getElementById("Div2").style.backgroundColor="white";
  document.getElementById("Div3").style.backgroundColor="white";
}
Run Code Online (Sandbox Code Playgroud)
#Div1
{ 
  z-index: -2;
  border: 1px solid black;
  height: 300px;
  width: 400px;
}
#Div2
{
  z-index: -1;
  border: 1px solid black;
  width: 300px;
  height: 200px;
  margin: 50px 0 0 50px;
}
#Div3
{
  border: 1px solid black;
  width: 200px;
  height: 150px;
  margin: 23px 0 0 47px;
}

#DivBtn
{
  margin-top: 30px; …
Run Code Online (Sandbox Code Playgroud)

html javascript onclick

0
推荐指数
1
解决办法
1万
查看次数

swift中URLQueryItem的作用是什么?

我是 iOS 开发的初学者,最近我正在学习在 iOS 开发中使用 rest API 进行网络连接。在构造 URL 以发出请求时,我发现了这样的代码:

var queryComponents: [URLQueryItem] {
    var components = [URLQueryItem]()

    for (key, value) in parameters {
        let queryItem = URLQueryItem(name: key, value: "\(value)")
        components.append(queryItem)
    }

    return components
}
Run Code Online (Sandbox Code Playgroud)

我不明白为什么数组组件应该是 URLQueryItem 数据类型。

提前致谢 :)

ios swift

0
推荐指数
1
解决办法
2845
查看次数