小编Pra*_*gha的帖子

java.security.NoSuchAlgorithmException:RIPEMD160 MessageDigest 不可用

我们有一个项目,它在启动 saml 应用程序时初始化各种算法。启动时,它会抛出以下错误(请检查日志):未获取 RIPEMD160、HMACRIPEMD160 和 RIPEMD160withRSA。我尝试深入研究 RIPEMD160,发现 RIPEMD160 映射到rt.jar 内 DigestMethod.java 文件中的URL“ http://www.w3.org/2001/04/xmlenc#ripemd160 ”。

但无法找到为什么唯一失败的算法是 RIPEMD160、RIPEMD160withRSA、HMACRIPEMD160 而不是其他算法的原因。

14:28:38.930 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'BlockEncryption' with URI 'http://www.w3.org/2001/04/xmlenc#tripledes-cbc': org.opensaml.xmlsec.algorithm.descriptors.BlockEncryptionDESede
    14:28:38.930 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmlenc#tripledes-cbc
    14:28:38.931 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'MessageDigest' with URI 'http://www.w3.org/2001/04/xmldsig-more#md5': org.opensaml.xmlsec.algorithm.descriptors.DigestMD5
    14:28:38.931 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#md5
    14:28:38.931 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'MessageDigest' with URI 'http://www.w3.org/2001/04/xmlenc#ripemd160': …
Run Code Online (Sandbox Code Playgroud)

java saml

9
推荐指数
1
解决办法
5135
查看次数

Spring Batch 中具有不同实体的多个编写器

初始代码:

Tasklet 类定义有 3 个方法:

    class Tasklet{
        doBeforeStep(){
        //Records a retrieved from the table.
        }

        doExecute(){
        //It opens the file and reads the file.
        //Does all the processing one by one and creates a 2 list of records to update into the database.
        }

        doAfterStep(){
        //The 2 list of records(Entities) are saved into the 2 different tables database using its corresponding repository class. Example:
RepositoryClass.saveall(List containing 105,000 records)  //using the CRUDRepository method
        }
    }
Run Code Online (Sandbox Code Playgroud)

面临的问题: 该文件包含 150,000 条记录,因此,在 doExecute() 方法之后,它在列表中存储了 …

spring-batch spring-boot

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

如何编写文本,画一条线,然后使用PDFBox在pdf文件中再次编写文本

要求:附上了屏幕截图。我必须在pdf中写2行文本,然后画一条线,然后再次开始写一些文本。

因此,我的算法通过:

contentStream = new PDPageContentStream(doc, page);
contentStream.setFont(font, fontSize);
contentStream.beginText();
Run Code Online (Sandbox Code Playgroud)

创建了一个新的PDPageContentStream并触发了函数beginText()。我能够写出所附图像中显示的上部文本部分。

下面给出的是上部文字和以下各行的以下代码行:

        contentStream.showText("Entry Form – Header");
        yCordinate -= fontHeight;  //This line is to track the yCordinate
        contentStream.newLineAtOffset(0, -leading);
        yCordinate -= leading;
        contentStream.showText("Date Generated: " + dateFormat.format(date));
        yCordinate -= fontHeight;
        contentStream.newLineAtOffset(0, -leading);
        yCordinate -= leading;
        contentStream.endText(); // End of text mode
Run Code Online (Sandbox Code Playgroud)

我必须结束此文本模式,因为下面的三行代码(绘制一条线)不会在文本模式下执行:

            contentStream.moveTo(startX, yCordinate);
            contentStream.lineTo(endX, yCordinate);
            contentStream.stroke();        
Run Code Online (Sandbox Code Playgroud)

现在在这行代码之后,如果我写:

contentStream.beginText();
contentStream.showText("Name: XXXXX");
Run Code Online (Sandbox Code Playgroud)

名称显示在页面的左下角。我希望此线在下图所示的线之后。

任何帮助将不胜感激。在此处输入图片说明

java pdfbox

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

有效载荷(空内容类型)禁止错误| 在ember中从服务器下载pdf文件时

目标:想要通过生成以下URL从服务器下载PDF文件: http:// localhost:4200/bookStore/secured/rest/books/14119

当在路线中的book.js中执行以下行时,将生成URL.

return this.store.findRecord('book', bookId);
Run Code Online (Sandbox Code Playgroud)

但我得到403禁止错误.错误详情:

Error: Ember Data Request GET /bookStore/secured/rest/books/14119 returned a 403
Payload (Empty Content-Type)
Forbidden
    at new AdapterError (-private.js:3170)
    at Class.handleResponse (rest.js:594)
    at ajaxError (rest.js:956)
    at Class.hash.error (rest.js:623)
    at fire (jquery.js:3317)
    at Object.fireWith [as rejectWith] (jquery.js:3447)
    at done (jquery.js:9274)
    at XMLHttpRequest.<anonymous> (jquery.js:9514)
Run Code Online (Sandbox Code Playgroud)

我是否需要将内容类型设置为"application/pdf"?如果是,那么请建议如何设置它.

以下是JS代码:

路线\ book.js

actions: {
    pdfClick(bookId) {
      return this.store.findRecord('book', bookId);
   }
}
Run Code Online (Sandbox Code Playgroud)

模板\ book.hbs

<button {{action "pdfClick" book.bookId}}>PDF</button>
Run Code Online (Sandbox Code Playgroud)

在服务器端,接收和响应请求的代码如下:

@GET
@Path("/{bookId}")
@Produces("application/pdf")
public Response bookExport(@PathParam("bookId") long bookId) {
   //Code
}
Run Code Online (Sandbox Code Playgroud)

根据服务器端代码,我们从服务器获取PDF文件.使用PostMan成功测试了这一点.

javascript pdf ember.js

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

执行 git svn clone 命令时出现“命令返回错误:127”

目标:从 svn 迁移到具有所有 svn 历史的 gitlab。

方法:使用以下命令:

git svn clone -r<intital revision number>:HEAD --authors-file=authors.txt <svn URL like http://svn/Trunk> <Destination Folder like C:/Project>
Run Code Online (Sandbox Code Playgroud)

从svn取数据将近1小时后,出现错误:

ls-tree -z asdafsdfsdfsdfsdf ./xyz.java: command returned error: 127
Run Code Online (Sandbox Code Playgroud)

任何克服解决方案的建议都将非常有帮助。

git

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

标签 统计

java ×2

ember.js ×1

git ×1

javascript ×1

pdf ×1

pdfbox ×1

saml ×1

spring-batch ×1

spring-boot ×1