I use ckedictor + ckfinder online page editor in the local test well , the picture of what functions can be achieved , why not upload it to the server after the upload picture function , and help us to see how going door prawn
web.xml configuration
ConnectorServlet
com.ckfinder.connector.ConnectorServlet
XMLConfig
/ WEB-INF/config.xml
debug
false
1
ConnectorServlet
<-! note the path where you want to place the path ckfinder and fully consistent with the job - >
/ ckfinder / core / connector / java / connector.java
10
config.xml configuration
true
yanjiusuo / uploadfile / <- where you want to save into their own ! path on it ->
1600
1200
80
UTF-8
false
CKFinder_UserRole
true
true
true
html, htm, xml, js
. svn
CVS
. *
% BASE_URL% files /
% BASE_DIR% files
0
7z, aiff, asf, avi, bmp, csv, doc, docx, fla, flv, gif, gz, gzip, jpeg, jpg, mid, mov, mp3, mp4, mpc, mpeg, mpg, ods, odt, pdf, png, ppt, pptx, pxd, qt, ram, rar, rm, rmi, rmvb, rtf, sdc, sitd, swf, sxc, sxw, tar, tgz, tif, tiff, txt, vsd, wav, wma, wmv, xls, xlsx, zip
% BASE_URL% images /
% BASE_DIR% images
0
bmp, gif, jpeg, jpg, png
% BASE_URL% flash /
% BASE_DIR% flash
0
swf, flv
*
*
/
true
true
true
true
true
true
true
true
true
% BASE_URL% _thumbs /
% BASE_DIR% _thumbs
false
100
100
80
imageresize
com.ckfinder.connector.plugins.ImageResize
fileeditor
com.ckfinder.connector.plugins.FileEditor
com.ckfinder.connector.configuration.ConfigurationPathBuilder
Content on this page
content : ------ Solution - ------------------------------------------- the project structure Screenshot sent to , ------ Solution ------------------------------------- ------- The baseUrl set to http:// ip / yanjiusuo / uploadfile / Try There is ie, you try to change chrom browser ckfinder ckeditor latest version of the previous word is seemingly browser have a choice. This did not get to know how to get . Looking at the data ------ For reference only ----------------------------------- ---- ------ For reference only ----- ---------------------------------- dizzy , too much eye
For example , I have a student table , there is a curriculum, is one to many relationship : each student can select multiple courses Student hypothetical field : s_id, s_name Course assumptions fields : c_id, c_name middle table s_c assumptions fields : id, s_id, c_id then hibernate in the middle of the table needs to be written this entity class do ? ------ Solution ------------------------------------ -------- write , do not write ------ Solution ------------------------ -------------------- No, just add the line corresponding annotation or xml configuration, if the table is automatically created by hibernate in the database to generate the corresponding an intermediate table ------ Solution ------------------------------------ -------- Each course can only be called when there is a student -to-many . configured to -many do not need . ------ Solution ---------------------------------------- ---- do not remember the details , not long , but you do not see it on oneToMany like, you go to see hibernate many, many of these comments is how to use it ------ For reference only --------------------------------------- Each course can only be called when there is a student -to-many . configured to -many do not need . is not written so that you can Student category : @Entity @Table(name = "student", catalog = "db") public class Student implements java.io.Serializable { private Integer id; private String name; private String password; private Boolean isDelete; private Set<Course> Courses= new HashSet<Course>(0); @Id @GeneratedValue(strategy = IDENTITY) @Column(name = "id", unique = true, nullable = false) public Integer getId() { return this.id; } public void setId(Integer id) { this.id = id; } @Column(name = "name") public String getName() { return this.name; } public void setName(String name) { this.name = name; } @Column(name = "password") public String getPassword() { return this.password; } public void setPassword(String password) { this.password = password; } @Column(name = "is_delete") public Boolean getIsDelete() { return this.isDelete; } public void setIsDelete(Boolean isDelete) { this.isDelete = isDelete; } @OneToMany(fetch = FetchType.LAZY, mappedBy = "student") public Set<Course> getCourses() { return this.Courses; } public void setTCourses(Set<Course> Coursea) { this.Courses= Courses; } } Course categories: @Entity @Table(name = "course", catalog = "db") public class Course implements java.io.Serializable { private Integer id; private String name; private Boolean isDelete; @Id @GeneratedValue(strategy = IDENTITY) @Column(name = "id", unique = true, nullable = false) public Integer getId() { return this.id; } public void setId(Integer id) { this.id = id; } @Column(name = "name") public String getName() { return this.name; } public void setName(String name) { this.name = name; } @Column(name = "is_delete") public Boolean getIsDelete() { return this.isDelete; } public void setIsDelete(Boolean isDelete) { this.isDelete = isDelete; } } I write it? ------ For reference only -------------------------------------- - not write , it should be how to deal with? ------ For reference only -------------------------------------- - wrong. ------ For reference only -------------------------------------- - not , he will be generated automatically , try not to write, write bad trouble ------ For reference only --------------- ------------------------ I'm a good database design , and reflection is generated . However , Hibernate automatically generates entity classes will be generated in the middle of the table , so I would like to ask , this middle of the table , it should be how to write ? Need to manually modify it? ------ For reference only -------------------------------------- - wrong. can give pointers about it? ------ For reference only -------------------------------------- - look anyway you like hibernate support not write that many- will write two one- ------ For reference only --------------------------- ------------ package com.hibernate; import java.util.HashSet; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.persistence.Table; @Entity @Table(name = "STUDENT", schema = "TEST") public class Student implements java.io.Serializable { // Fields private String stid; private String stname; private Set<StudentCourse> studentCourses = new HashSet<StudentCourse>(0); @Id @Column(name = "STID", unique = true, nullable = false, length = 40) public String getStid() { return this.stid; } public void setStid(String stid) { this.stid = stid; } @Column(name = "STNAME", length = 40) public String getStname() { return this.stname; } public void setStname(String stname) { this.stname = stname; } @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "student") public Set<StudentCourse> getStudentCourses() { return this.studentCourses; } public void setStudentCourses(Set<StudentCourse> studentCourses) { this.studentCourses = studentCourses; } } package com.hibernate; import java.util.HashSet; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.persistence.Table; @Entity @Table(name = "COURSE", schema = "TEST") public class Course implements java.io.Serializable { // Fields private String coid; private String coname; private Set<StudentCourse> studentCourses = new HashSet<StudentCourse>(0); @Id @Column(name = "COID", unique = true, nullable = false, length = 40) public String getCoid() { return this.coid; } public void setCoid(String coid) { this.coid = coid; } @Column(name = "CONAME", length = 40) public String getConame() { return this.coname; } public void setConame(String coname) { this.coname = coname; } @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "course") public Set<StudentCourse> getStudentCourses() { return this.studentCourses; } public void setStudentCourses(Set<StudentCourse> studentCourses) { this.studentCourses = studentCourses; } } package com.hibernate; import java.math.BigDecimal; import javax.persistence.AttributeOverride; import javax.persistence.AttributeOverrides; import javax.persistence.Column; import javax.persistence.EmbeddedId; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; @Entity @Table(name = "STUDENT_COURSE", schema = "TEST") public class StudentCourse implements java.io.Serializable { // Fields private StudentCourseId id; private Course course; private Student student; private BigDecimal score; @EmbeddedId @AttributeOverrides( { @AttributeOverride(name = "stid", column = @Column(name = "STID", nullable = false, length = 40)), @AttributeOverride(name = "coid", column = @Column(name = "COID", nullable = false, length = 40)) }) public StudentCourseId getId() { return this.id; } public void setId(StudentCourseId id) { this.id = id; } @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "COID", nullable = false, insertable = false, updatable = false) public Course getCourse() { return this.course; } public void setCourse(Course course) { this.course = course; } @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "STID", nullable = false, insertable = false, updatable = false) public Student getStudent() { return this.student; } public void setStudent(Student student) { this.student = student; } @Column(name = "SCORE", precision = 22, scale = 0) public BigDecimal getScore() { return this.score; } public void setScore(BigDecimal score) { this.score = score; } } package com.hibernate; import javax.persistence.Column; import javax.persistence.Embeddable; @Embeddable public class StudentCourseId implements java.io.Serializable { // Fields private String stid; private String coid; public StudentCourseId() { } /** full constructor */ public StudentCourseId(String stid, String coid) { this.stid = stid; this.coid = coid; } @Column(name = "STID", nullable = false, length = 40) public String getStid() { return this.stid; } public void setStid(String stid) { this.stid = stid; } @Column(name = "COID", nullable = false, length = 40) public String getCoid() { return this.coid; } public void setCoid(String coid) { this.coid = coid; } public boolean equals(Object other) { if ((this == other)) return true; if ((other == null)) return false; if (!(other instanceof StudentCourseId)) return false; StudentCourseId castOther = (StudentCourseId) other; return ((this.getStid() == castOther.getStid()) || (this.getStid() != null && castOther.getStid() != null && this.getStid().equals( castOther.getStid()))) && ((this.getCoid() == castOther.getCoid()) || (this.getCoid() != null && castOther.getCoid() != null && this.getCoid() .equals(castOther.getCoid()))); } public int hashCode() { int result = 17; result = 37 * result + (getStid() == null ? 0 : this.getStid().hashCode()); result = 37 * result + (getCoid() == null ? 0 : this.getCoid().hashCode()); return result; } } ------ For reference only ----------------------------------- ---- doing is to the middle of the table is also the entity class , not the middle of the table there is no way to do entity classes ? Because the current scores in the middle of the table and no other attributes , just used the mapping . ------ For reference only -------------------------------------- - many between them is actually a many to many , LZ you think it ------ For reference only ----------------- ---------------------- resolved http://blog.csdn.net/xiaobiaobiao521/article/details/9123303
This post last edited by the beijinuo on 2014-01-06 20:19:29 ask a question, such as my JSP page nested Baidu 's login page, then how can do automatic login feature. My iframe is nested under if there are other ways to achieve can also be pointing. Online . nested page login method in JS , how to pass parameters as well as the next . ------ Solution ---------------------------------------- ---- Baidu's account was used to log in , but in my project it to automatically log on Baidu If you are using Baidu 's account to log on to your site , do not know Baidu has provided interfaces. This is the Tencent QQ login interface provides : http://baike.baidu.com/view/5520251.htm - ----- For reference only --------------------------------------- own top! ------ For reference only -------------------------------------- - Zaiding time , seeking support ------ For reference only ---------------------------- ----------- ------ For reference only ----------------------------------- ---- you want to use Baidu 's account to log on to your site it . ------ For reference only -------------------------------------- - I want to do auto- login feature another project in a JSP , the For example, my a.jsp page embedded baidulogin.jsp page , when I visited a.jsp, automatic login Baidu ------ For reference only -------- ------------------------------- Baidu account you want to use your website or landing want to use your website account login Baidu ( unlikely ) ? still want to use your account login Baidu Baidu ? ------ For reference only -------------------------------------- - ---- - For reference only --------------------------------------- Baidu's account was used to log in , but in my project to automatically log on Baidu only ------ For reference only ---------------- ----------------------- Baidu's account was used to log in , but in my project to automatically log on Baidu nothing more If you are using Baidu 's account to log on to your site , do not know Baidu has provided interfaces. This is the Tencent QQ login interface provides : http://baike.baidu.com/view/5520251.htm Thank you very much , I have resolved ------ For reference only --------------------------- ------------ Baidu's account was used to log in , but in my project it to automatically log on Baidu If you are using Baidu 's account to log on to your site , do not know Baidu has provided interfaces. This is the Tencent QQ login interface provides : http://baike.baidu.com/view/5520251.htm Thank you very much , I have resolved Results posted scattered points, my favorite.
The action against the struts configuration of the spring , when spring bean is set in a single case , when set to the prototype. ------ Solution ---------------------------------------- ---- under normal circumstances action should prototype because every action is necessary to request a new instance , if you set a single case so action can only handle one request a while , like Service, DAO examples of such single long enough, because all processing can share one instance
The current program input uncommon words , such as ying ( Anna ) of the word , it will appear as a frame should ask what font to display properly set , the default is Arial In addition , if you need to download the font package can. ------ Solution - ------------------------------------------- landlord is not used the components ------ For reference only awt package under -------------------------------- ------- Yes, used under awt , is to use the swing under it? Can tell the next method . ------ For reference only --------------------------------------- awt under there will be such a problem in the Chinese support, can be used ------ For reference only swing under ------------------- -------------------- in support of Chinese awt occur under such a problem , you can use the swing under the If you do not swing down , then there can be any way around this? Because the program will be great changes , more trouble ------ For reference only ----------------------------- ---------- support of the Chinese awt occur under such a problem , you can use the swing under the which class or how to use the swing , can give a DEMO ------ For reference only -------------------- ------------------- into swing changes will not be great at the beginning of each component is to add a J, and if you want to support follow awt Chinese very troublesome ------ For reference only ----------------------------------- ---- it otherwise would have been better with a swing after that there will be similar problems will be more troublesome ------ For reference only ----- ---------------------------------- with awt then how to set Font to make this characters display correctly , I tried simsun, dialog and so can not Do you know which fonts can be set to what ------ For reference only -------------------------- ------------- into swing changes will not be great at the beginning of each component is to add a J, and if you want to support the Chinese follow awt very troublesome I have read, it seems that with the swing, but set the Font to Arial, this will not affect In addition , said the Internet has changed font.properties of this document, but I do not know what should change the font suitable ------ For reference only ------------- -------------------------- into swing changes will not have much of each component is added at the beginning of a J if you want to support the Chinese follow awt very troublesome I have read, it seems that with the swing, but set the Font to Arial, this will not affect In addition , said the Internet has changed font.properties of this document, but I do not know which font should change the appropriate with the support of the Chinese swing itself does not need to change any thing , awt , then you must be a Chinese gbk your java class files must be encoded in order to display properly gbk , but are generally used utf-8 so do not use awt with swing
/ / ================ Data paging ============== / / data collection query after the object is a collection of the same user data after the interception List obj = new ArrayList (); / / total number of data int totalCount = 155; / / Total number of pages int pageCount = 0; / / display the total number of page int endNum = 20; / / current page int startNum = 1; / * calculate the total number of pages that can be divided into * / case if (totalCount% endNum> 0) / / Total page displays the total number of data and can not be divisible { pageCount = totalCount / endNum + 1; } else case / / total number of data can be displayed per page and the total number divisible { pageCount = totalCount / endNum; } if (totalCount> 0) { if (startNum <= pageCount) { if (startNum == 1) / / current page is the first page { Total if (totalCount <= endNum) / / data is less than the number of data per page { / / As the number of total data ( currently a lack of data , according to a display ) , so as not to appear abnormal array bounds obj = obj.subList (0, totalCount); } else { obj = obj.subList (0, endNum); } } else { / / intercept the starting subscript int fromIndex = (startNum - 1) * endNum; / / intercept deadline subscript int toIndex = startNum * endNum; / * calculate interception deadline subscript * / if ((totalCount - toIndex)% endNum> = 0) { toIndex = startNum * endNum; } else { toIndex = (startNum - 1) * endNum + (totalCount% endNum); } if (totalCount> = toIndex) { obj = obj.subList (fromIndex, toIndex); } } } else { obj = null; } ------ Solution ----------------------------------- --------- general tab are only query the current page or previous content will not put all the contents are investigated to ------ Solution ------- ------------------------------------- Yes, everything is checked , when the data a large amount of time ...... That is a disaster ------ Solution --------------------------------- ----------- you this is fake page ! ! ~ ~ ~ ~ I know that sometimes is forced ~ I also have a public class ArrayPage { /**总的结果集*/ private Object[] result = new Object[]{}; /**实际显示的结果集*/ private Object[] displayResult = new Object[]{}; /**起始查询索引*/ private int start; /**每页显示多少*/ private int pageSize = 10; /**当前页号*/ private int pageNo; /**总页数*/ private int pageTotalNo; /**总条数*/ private int totalCount; /**是否是第一页*/ private boolean isFirstPage; /**是否是最后一页*/ private boolean isLastPage; /**上一页起始索引*/ private int previousPageStart; /**下一页起始索引*/ private int nextPageStart; /**最后一页起始索引*/ private int lastPageStart; public ArrayPage() { } public ArrayPage(Object[] result) { this.result = result; } public ArrayPage(Object[] result, int start, int pageSize) { this(result); this.start = start; this.pageSize = pageSize; } public Object[] getResult() { return result; } public void setResult(Object[] result) { this.result = result; } /** * 获取当前起始索引(默认从0开始) * @return */ public int getStart() { return start; } /** * 设置起始索引值 * @param start */ public void setStart(int start) { this.start = start; } /** * 获取每页显示大小 * @return */ public int getPageSize() { return pageSize; } /** * 设置每页显示条数 * @param pageSize */ public void setPageSize(int pageSize) { this.pageSize = pageSize; } /** * 获取当前页号 * @return */ public int getPageNo() { return (this.start / this.pageSize) + 1; } /** * 获取总页数 * @return */ public int getPageTotalNo() { return this.getTotalCount() % this.pageSize == 0 ? this.getTotalCount() / this.pageSize : this.getTotalCount() / this.pageSize + 1; } /** * 获取总条数 * @return */ public int getTotalCount() { return this.getResult().length; } /** * 判断是否是最后一页 * @return */ public boolean getIsLastPage() { int expectedSize = this.getPageNo() * this.pageSize; this.isLastPage = expectedSize >= this.getTotalCount() && expectedSize - this.pageSize <= this.getTotalCount() ; return this.isLastPage; } /** * 判断是否是第一页 * @return */ public boolean getIsFirstPage() { return this.getPageNo() == 1; } /** * 获取上一页起始索引 * @return */ public int getPreviousPageStart() { return this.start - this.pageSize; } /** * 获取下一页起始索引 */ public int getNextPageStart() { return this.start + this.pageSize; } /** * 获取最后一页起始索引 */ public int getLastPageStart() { this.lastPageStart = (this.getPageTotalNo() - 1) * this.pageSize; return this.lastPageStart; } /** * 获取实际需要显示的结果集 * @return */ @SuppressWarnings("unchecked") public Object[] getDisplayResult() { Object[] t = new Object[10]; if(getIsLastPage()) { int expectedSize = this.getPageNo() * this.pageSize; t = new Object[this.getPageSize() - (expectedSize - this.getTotalCount())]; } else { t = new Object[this.pageSize]; } System.arraycopy(this.getResult(), this.start, t, 0, t.length); this.displayResult = t; return displayResult; } public static void main(String[] args) { Object[] strs = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14"}; ArrayPage page = new ArrayPage(strs, 0, 12); System.out.println(Arrays.asList(page.getDisplayResult())); System.out.println("总条数:" + page.getTotalCount()); System.out.println("当前第:" + page.getPageNo() + "页"); System.out.println("总页数:" + page.getPageTotalNo()); System.out.println("是否为最后一页:" + page.getIsLastPage()); } } ------ Solution ------------------------------------- ------- paging is only checked once a page of data , so whether it is displayed in the results , or are good on another query speed . So the real action lies in each page just check one of the data, rather than check out all the data , then you selectively display to the user. ------ Solution ---------------------------------------- ---- can use SQL paging, paging using JAVA why should it ? ------ Solution ---------------------------------------- ---- upstairs say directly in the database paging, so to receive data directly inside java and then show it wants . ------ For reference only ---------------------------------- ----- engaged ...... now I have so ashamed of his ignorance database paging, paging framework like hibernate or take to find a page frame
Today, the project found that when doing servlet using Ajax connection , only the first run when connected to the servlet code , like a long time have not figured out , please help to see if this is in the end is how is it ? I put the key code to paste , <body> <a href="javascript:del()">删除</a> </body> <script type="text/javascript"> function del(){ var url="DeleteServlet"; xmlHttp=createXmlHttpRequest(); xmlHttp.onreadystatechange=process; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function process(){ if(xmlHttp.readyState==4){ if (xmlHttp.status==200) { alert("x"); } } } 后面 省略 …… DeleteServlet in on the word , System.out.println (" the delete ! " ) ; Whenever I click Delete , the first played in the console ' executive Delete' and pop 'x', the second and third time , the console did not print out content, but 'x' was able to pop up in the end is how is this all about? ------ Solution ---------------------------------------- ---- delete no parameters ? Followed by a timestamp look . ------ Solution ---------------------------------------- ---- Ajax tips , followed by a time stamp prevents the browser cache data ------ For reference only ---------------- ----------------------- which property will not be xmlHttp is not set ------ For reference only --------------------------------------- The reply was deleted administrator at 2014-01-06 08:51:15 ------ For reference only ---------------------------------- ----- the delete into delete the servlet code execution every time , I found Ajax request must not be the same for each url servlet code will be executed if the same would only perform the first - ----- For reference only --------------------------------------- you mean they do not write synchronization function , write directly configured servlet that DeleteServlet? ------ For reference only -------------------------------------- - thanks, should be the caching issues, together with a time stamp after each will execute the code inside a servlet ------ For reference only ------ --------------------------------- the delete into delete the servlet code execution every time , I found Ajax request url must not be the same for each servlet code will be executed if the same would only perform for the first time behind url add a new Date ()
Spring is our company uses Tool Suite, previously used MyEclipse, just started using this , many did not make things right . Really not used , who uses this development tools to help under busy. . encountered the first problem ,. m folder where? Qiufa map. ------ Solution ---------------------------------------- ---- may be dependent on the warehouse did not find your stuff, you try another version . ------ Solution ---------------------------------------- ---- with them as with the eclipse , some of which are spring template , create a project is also more convenient. sts maven 's own integration . Good update your pom.xml file , so it is still prompted to download jar if the download is complete . available on the project right - property -mven clean select it under the clean-up. general project in the pom.xml file has configured the others , basically no you what happened. ------ Solution ------------------------------------ -------- I also use this , send a message to me , I'll teach you . ------ For reference only -------------------------------------- - maven repository ? ------ For reference only ---------------------------------- ----- morning that problem solved encountered a new problem. . Weighs . . Just learning this is troublesome. ------ For reference only ----- ---------------------------------- encountered a lot of things , ah, weighs . a problem is Setting.xml file in question . have encountered maven automatically lead pack error problem . ------ For reference only -------------------------------------- - never used , ------ For reference only ---------------------------- ----------- I also use this information and you have to learn to share their experience you seek
This post last edited by javaee_ssh on 2011-05-16 01:55:00 axis2 due to the need to publish the project to both the external network and internal network ( the network calls for the two servers , intranet , extranet for calls outside the network ) . Network access calls webservice interface. Outside the network seems to be affected by firewalls or what limits access to many, will be reported connection reset exception ( but said there was no network restrictions do ) , a few times through the RPC, Axios normal visit, sometimes old reported abnormal Description : server : spring, hibernate ... web server : glassfish, using , axis2 deployment service.xml file using client PRC, AXIOM are not connected ( the program is connected with the PRC ) . But I can . Net and in the browser via the above address access , and return the correct message. http:// domain / dataService / services / DataexchangeService / checkLoginuserCode = admin & password = admin clients: java swing, spring ... exception as follows : java.lang.RuntimeException: [was class java.net.SocketException] Connection reset at com.ctc.wstx.util.ExceptionUtil.throwRuntimeException (ExceptionUtil.java: 18) at com.ctc.wstx.sr.StreamScanner.throwLazyError (StreamScanner.java: 731) at com.ctc.wstx.sr.BasicStreamReader.safeFinishToken (BasicStreamReader.java: 3657) at com.ctc.wstx.sr.BasicStreamReader.getText (BasicStreamReader.java: 809) at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.getText (XMLStreamReaderWrapper.java: 164) at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.getText (XMLStreamReaderWrapper.java: 164) at org.apache.axiom.om.impl.builder.StAXBuilder.createOMText (StAXBuilder.java: 289) at org.apache.axiom.om.impl.builder.StAXBuilder.createOMText (StAXBuilder.java: 250) at org.apache.axiom.om.impl.builder.StAXOMBuilder.next (StAXOMBuilder.java: 252) at org.apache.axiom.om.impl.llom.OMElementImpl.getNextOMSibling (OMElementImpl.java: 337) at org.apache.axiom.om.impl.traverse.OMChildrenQNameIterator.findNextElementWithQName (OMChildrenQNameIterator.java: 96) at org.apache.axiom.om.impl.traverse.OMChildrenQNameIterator.hasNext (OMChildrenQNameIterator.java: 76) at org.apache.axiom.om.impl.llom.OMElementImpl.getFirstChildWithName (OMElementImpl.java: 274) at org.apache.axiom.soap.impl.llom.soap11.SOAP11FaultImpl.getRole (SOAP11FaultImpl.java: 136) at org.apache.axis2.AxisFault.initializeValues (AxisFault.java: 202) at org.apache.axis2.AxisFault . (AxisFault.java: 196) at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext (Utils.java: 446) at org.apache.axis2.description.OutInAxisOperationClient.handleResponse (OutInAxisOperation.java: 371) at org.apache.axis2.description.OutInAxisOperationClient.send (OutInAxisOperation.java: 417) at org.apache.axis2.description.OutInAxisOperationClient.executeImpl (OutInAxisOperation.java: 229) at org.apache.axis2.client.OperationClient.execute (OperationClient.java: 165) at org.apache.axis2.client.ServiceClient.sendReceive (ServiceClient.java: 540) at org.apache.axis2.client.ServiceClient.sendReceive (ServiceClient.java: 521) at org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking (RPCServiceClient.java: 102) at RPCClient.checkLogin (RPCClient.java: 48) at RPCClient.main (RPCClient.java: 60) Caused by: java.net.SocketException: Connection reset at java.net.SocketInputStream.read (SocketInputStream.java: 168) at java.io.BufferedInputStream.read1 (BufferedInputStream.java: 256) at java.io.BufferedInputStream.read (BufferedInputStream.java: 317) at org.apache.commons.httpclient.ChunkedInputStream.read (ChunkedInputStream.java: 182) at java.io.FilterInputStream.read (FilterInputStream.java: 116) at org.apache.commons.httpclient.AutoCloseInputStream.read (AutoCloseInputStream.java: 108) at java.io.FilterInputStream.read (FilterInputStream.java: 116) at org.apache.axiom.om.util.DetachableInputStream.read (DetachableInputStream.java: 147) at java.io.FilterInputStream.read (FilterInputStream.java: 116) at java.io.PushbackInputStream.read (PushbackInputStream.java: 169) at java.io.FilterInputStream.read (FilterInputStream.java: 90) at com.ctc.wstx.io.UTF8Reader.loadMore (UTF8Reader.java: 365) at com.ctc.wstx.io.UTF8Reader.read (UTF8Reader.java: 110) at com.ctc.wstx.io.MergedReader.read (MergedReader.java: 101) at com.ctc.wstx.io.ReaderSource.readInto (ReaderSource.java: 84) at com.ctc.wstx.io.BranchingReaderSource.readInto (BranchingReaderSource.java: 57) at com.ctc.wstx.sr.StreamScanner.loadMore (StreamScanner.java: 992) at com.ctc.wstx.sr.BasicStreamReader.readTextSecondary (BasicStreamReader.java: 4628) at com.ctc.wstx.sr.BasicStreamReader.readCoalescedText (BasicStreamReader.java: 4126) at com.ctc.wstx.sr.BasicStreamReader.finishToken (BasicStreamReader.java: 3701) at com.ctc.wstx.sr.BasicStreamReader.safeFinishToken (BasicStreamReader.java: 3649) ... 23 more PRC connection private final String srcTargetNameSpaces = "http://impl.webservice.dataexchange.jst.com"; private final String srcSrvcUrl = "http://域名/dataService/services/DataexchangeService"; //RPC public String checkLogin(String userCode, String password) throws Exception { QName qname = new QName(srcTargetNameSpaces, "checkLogin"); Object param[] = new Object[] { userCode, password }; Object[] response = null; try { RPCServiceClient client = new RPCServiceClient(); Options options = client.getOptions(); options.setTo(new EndpointReference(srcSrvcUrl)); Class[] returnTypes = new Class[] { String.class }; response = client.invokeBlocking(qname, param, returnTypes); client.cleanupTransport(); } catch (AxisFault e) { logger.error(e); throw new Exception(e); } return (String) response[0]; } AXIOM private static EndpointReference targetEPR = new EndpointReference("http://域名/dataService/services/DataexchangeService"); public static OMElement checkLogin(String symbol, String price) { OMFactory fac = OMAbstractFactory.getOMFactory(); OMNamespace omNs = fac.createOMNamespace("http://impl.webservice.dataexchange.jst.com", "tns"); OMElement method = fac.createOMElement("checkLogin", omNs); OMElement value1 = fac.createOMElement("userCode", omNs); value1.addChild(fac.createOMText(value1, symbol)); method.addChild(value1); OMElement value2 = fac.createOMElement("password", omNs); value2.addChild(fac.createOMText(value2,price)); method.addChild(value2); return method; } public static void main(String[] args) { try { // OMElement getPricePayload = getPricePayload("WSO"); OMElement updatePayload = checkLogin("admin", "admin"); Options options = new Options(); options.setTo(targetEPR); options.setTransportInProtocol(Constants.TRANSPORT_HTTP); ServiceClient sender = new ServiceClient(); sender.setOptions(options); OMElement result = sender.sendReceive(updatePayload); System.err.println("price updated"); // OMElement result = sender.sendReceive(getPricePayload); String response = result.getFirstElement().getText(); System.err.println("Current price of WSO: " + response); } catch (Exception e) { e.printStackTrace(); } } service.xml <serviceGroup> <service name="DataexchangeService" scope="application" targetNamespace="http://acl.common.jst.com"> <description> POJO: AddressBook Service </description> <messageReceivers> <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" /> <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" /> </messageReceivers> <parameter name="ServiceObjectSupplier">org.apache.axis2.extensions.spring.receivers.SpringServletContextObjectSupplier </parameter> <parameter name="SpringBeanName">jst_dataExchangeService</parameter> <!-- <operation name="getUser"> <messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" /> </operation> --> </service> </serviceGroup> Saturday , Sunday engage in two days , including the configuration environment , resolve the error . . . . . Really egg pain. two connections should be no problem . . . This problem was impatient . . . We help about ------ Solution ------------------------------------ -------- I came to see you loose points ------ Solution -------------------- ------------------------ at com.ctc.wstx.io.UTF8Reader.loadMore (UTF8Reader.java: 365) here to do what ? side of the socket closed. ------ For reference only -------------------------------------- - their first top one ------ For reference only ------------------------------ --------- The reply was deleted on 2011-05-16 11:11:18 moderator ------ For reference only ---------------------------------- ----- The reply was deleted at the moderator 2011-05-17 16:37:22 ------ For reference only ---------------------------------- ----- to one of ------ For reference only --------------------------- ------------ above problem is caused by inconsistent standard http protocol . The check items removed ok. Then I would knot posted . ------ For reference only -------------------------------------- - access points to the ------ For reference only ------------------------------ --------- landlord problem solved? I encountered a problem and ask you exactly ah ... next is how to solve ah ! ! ! Urgent ! ! ! Thank ------ For reference only --------------------------------- ------ encountered the same problem, tangle a day yet to be resolved - ------ For reference only --------------- ------------------------ what caused the problem ?
|