我正在将Collection更改为SortedSet,因为我需要它始终与创建它们的顺序一致.我已经更改了我的模型属性
@OneToMany(cascade = CascadeType.ALL, mappedBy = "contentId")
private Collection<Footnote> footnoteCollection;
Run Code Online (Sandbox Code Playgroud)
至
@OneToMany(cascade = CascadeType.ALL, mappedBy = "contentId")
private SortedSet<Footnote> footnoteSortedSet;
Run Code Online (Sandbox Code Playgroud)
以及所有相关功能,使Netbeans不再显示任何错误.当我运行应用程序时,我收到错误:Exception Description: Could not load the field named [footnoteSortedSet] on the class [class com.mysite.cmt.model.Content_]. Ensure there is a corresponding field with that name defined on the class.
由于我刚刚改变了这一点并重新启动了我的应用程序,我正在努力弄清楚为什么它说它没有设置......
我正在尝试使用驼峰邮件组件通过Amazon Simple Email Service从我的应用程序发送电子邮件。我尝试使用camel-mail组件而不是camel-ses组件的原因是camel-ses不支持附件。
我用它来表示 uri:
smtp://$smtpHost:$smtpPort?username=$smtpUsername&password=$smtpPassword&mail.smtp.ssl.enable=true&mail.smtp.ssl.required=true&mail.smtp.auth=true
Run Code Online (Sandbox Code Playgroud)
但我在运行时收到错误:
com.sun.mail.smtp.SMTPSendFailedException: 554 Transaction failed: Illegal header 'breadcrumbId'.
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2114)
at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:1900)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1122)
at org.apache.camel.component.mail.DefaultJavaMailSender.send(DefaultJavaMailSender.java:124)
at org.apache.camel.component.mail.MailProducer.process(MailProducer.java:49)
Run Code Online (Sandbox Code Playgroud)
因此,亚马逊对于可以发送哪些标头似乎非常严格,而 Camels 方法与 SES 的配合不佳:
Camel 将所有交换的 IN 标头复制到 MimeMessage 标头。
深入研究源代码,我可以看到该类org.apache.camel.component.mail.MailBinding具有接受以下类型的构造函数HeaderFilterStrategy:
public MailBinding(HeaderFilterStrategy headerFilterStrategy, ContentTypeResolver contentTypeResolver) {
this.headerFilterStrategy = headerFilterStrategy;
this.contentTypeResolver = contentTypeResolver;
}
Run Code Online (Sandbox Code Playgroud)
如何配置骆驼邮件以使用自定义HeaderFilterStrategy?
我正在尝试集成测试Karaf功能与Pax考试,但我无法解决如何在我的config()方法中安装功能.
Pax考试版本为2.6.0,Apache Karaf 2.3.2版本.
这是我的配置方法:
@Configuration
public Option[] config() {
return new Option[]{karafDistributionConfiguration().frameworkUrl(
maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("zip").versionAsInProject())
.karafVersion("2.3.2").name("Apache Karaf").unpackDirectory(new File("target")),
keepRuntimeFolder()};
}
Run Code Online (Sandbox Code Playgroud)
个别捆绑包可以安装,mavenBundle("group", "artifact", "version")但似乎没有机制来安装Pax考试的Karaf功能.
我能够在使用Junit注释的设置方法中以实用方式安装功能,@Before但是使用@Inject注入我的服务为时已晚.
是否可以在config()Pax考试测试的方法中安装Apache Karaf功能?