尝试使用java代码从Amazon EC2服务器发送邮件,但获得如下的异常 -
Exception in thread "main" Status Code: 403, AWS Request ID: 3e9319ec-bc62-11e1-b2ea-6bde1b4f192c, AWS Error Code: AccessDenied, AWS Error Message: User: arn:aws:iam::696355342546:user/brandzter is not authorized to perform: ses:SendEmail
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:500)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:262)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:166)
at com.amazonaws.services.simpleemail.AmazonSimpleEmailServiceClient.invoke(AmazonSimpleEmailServiceClient.java:447)
at com.amazonaws.services.simpleemail.AmazonSimpleEmailServiceClient.sendEmail(AmazonSimpleEmailServiceClient.java:242)
at brandzter.util.SESExample.SendMail(SESExample.java:46)
at brandzter.util.SESExample.<init>(SESExample.java:31)
at brandzter.util.SESExample.main(SESExample.java:52)
Run Code Online (Sandbox Code Playgroud)
Java结果:1
我的凭证还可以,不知道为什么我无法在这里发送电子邮件.我需要配置/更新服务器中的任何设置吗?
我在hibernate中遇到数据太大的问题.那是-
引起:java.sql.BatchUpdateException:数据截断:com.mysql.jdbc.PreparedStatement.executeBatch中com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1527)第1行第'FBZipLoc'列的数据太长(PreparedStatement.java:1065)org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195)... 12更多
是否可以自动截断所有字段的数据.或任何其他方式来处理这个问题.但我不想检查所有字段的数据长度,因为我有超过一千个字段.
我试图用代理启动selenium和selenium的浏览器但没有获得成功.我用过两种方法:
Properties sysProps = System.getProperties();
sysProps.put("proxySet", "true");
sysProps.put("proxyHost", "190.249.188.220");
sysProps.put("proxyPort", "81");
Run Code Online (Sandbox Code Playgroud)
和
java -jar lib/selenium-server.jar proxyHost=22.52.50.228 proxyPort=80
Run Code Online (Sandbox Code Playgroud)
但两者都不支持.
有人能够帮助我用代理启动selenium的浏览器.
我正在用Java创建一个Web浏览器.在这个浏览器中,我使用JEditorPane作为浏览器窗口.我正在使用"setPage(String url)"方法来显示页面.浏览器可以显示页面,但有一些问题,如上所述::
我的代码是 -
JEditorPane editorPane = new JEditorPane();
String url="http://google.co.in";
editorPane.setEditable(false);
try {
editorPane.setPage(url);
} catch (IOException e) {
System.err.println("Attempted to read a bad URL: " + url);
}
}
Run Code Online (Sandbox Code Playgroud) 我能够将表格的数据导出到CSV文件中,但无法将这些数据导出到excel文件中.这里有任何查询将这些数据导出到excel文件中.
我使用此查询将数据导出为CSV文件.
SELECT *
INTO OUTFILE 'C:/your-directory/your-filename.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\n'
FROM tableName
Run Code Online (Sandbox Code Playgroud)
我在更改文件名后使用此文件作为excel文件,your-filename.xls
但是它添加了扩展名.xls但是提供了像csv这样的数据.
我使用facebook图形API通过"type = page"获取业务详细信息,但是对于某些商业名称显示空结果
我必须使用网址
http://graph.facebook.com/search?q="Business Neme"&type = page
然后我明白了
{"数据":[
]}
请给我任何解决方案,以使用type = page获取数据的完整信息
谢谢
我正在使用jwordpress-0.4.jar发布到WordPress安装.
我使用的代码是:
Wordpress wp = new Wordpress(username, password, xmlRpcUrl);
Page recentPost = new Page();
recentPost.setPost_status("Published");
recentPost.setDescription("<ul>" + desc + "</ul>");
recentPost.setCategories(cat);
String pageID=recentPost.getPage_id();
String result = wp.newPost(recentPost, true);
Run Code Online (Sandbox Code Playgroud)
这之前运作良好,但现在当我去发布它进入其调度模式时,我尝试过:
recentPost.setPost_status( "发布时间");
和
wp.newPost(recentPost,true);
但这篇文章仍未发表:
我想通过AWSCredentials发送邮件但是获得例外
java.lang.NoClassDefFoundError:org/apache/http/conn/scheme/SchemeSocketFactory
我添加了这些jar:
我的java代码是 -
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.simpleemail.AmazonSimpleEmailServiceClient;
import com.amazonaws.services.simpleemail.model.*;
import java.util.LinkedList;
public class SESExample {
public static final String ACCESS_KEY = "My Access";
public static final String SECRET_KEY = "My Secret";
public static void main(String args[]) {
String sender = "support@brandzter.com"; // should be verified email
LinkedList<String> recipients = new LinkedList<String>();
recipients.add("khoyendra@globussoft.com"); // again a verified email, if you are in …
Run Code Online (Sandbox Code Playgroud) 我正在使用gdata-spreadsheet-3.0
jar在Google电子表格中输入数据.
我在用
(new ListEntry()).getCustomElements().setValueLocal("Header Name", "Value");
Run Code Online (Sandbox Code Playgroud)
但我不想手动创建标题.
我无法使用Java输入/创建电子表格的标题.我也无法使用电子表格的标题输入数据(意味着AB C ...).
我可以创建标题,还是可以使用电子表格的标题(表示AB C ...)?
我有这个struts代码,我正在使用forEach-
<c:forEach items="${reviewList}" var="reviewListId">
<tr>
<td colspan="6" class="we_have"><c:out value="${reviewListId}" />
</td>
</tr>
Run Code Online (Sandbox Code Playgroud)
我添加了这个taglib
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
Run Code Online (Sandbox Code Playgroud)
但代替forEach
标签显示的错误是 -
根据标记文件中的TLD或属性指令,属性项不接受任何表达式
但是代替标签lib它没有显示任何错误,这意味着它支持这个标签lib,但不知道为什么它不支持forEach标签.
java ×9
mysql ×2
amazon-ec2 ×1
email ×1
excel ×1
facebook ×1
facebook-fql ×1
foreach ×1
google-docs ×1
hibernate ×1
html ×1
jakarta-mail ×1
jeditorpane ×1
posting ×1
proxy ×1
selenium ×1
selenium-rc ×1
struts ×1
swing ×1
wordpress ×1