发表于: 2017-08-05 23:36:16

2 946


今天完成的事情:

上午写图片上传接口 未完成

下午写职位接口 未完成 

搭建开发环境 未完成


明天计划的事情:

解决以上问题


遇到的问题:

关于图片上传接口,和前端沟通了说是他们有插件可以实现,需要调用后端接口,然后返回一个img地址

这个接口有现成的,研究好久还是看不懂。。



职位接口调试查询详情接口时报错,找不到属性

对比model和数据库发现两边cid字段不一样,代码中是cId 数据库中是cid 我记得代码生成时Excel表格这个字段是c_id的,后来得知是赵宇改的,闲字段太长。。。。我把数据库字段修改为c_id后 代码还是跑不通报错

08-06 02:47:56:INFO(90)qtp2095793272-23 com.ptteng.carrots.bangbang.controller.ProfessionController - get profession data is com.ptteng.carrots.bangbang.model.Profession@29e38533[

  id=5

  name=产品经理

  cId=<null>

  releaseAt=<null>

  salary=<null>

  education=<null>

  workExperience=<null>

  status=<null>

  responsibility=<null>

  requirement=<null>

  welfare=<null>

  createAt=1501417011103

  updateAt=1501417011103

  createBy=<null>

  updateBy=<null>

]

[WARNING] 

javax.servlet.ServletException: javax.servlet.jsp.JspException: javax.el.PropertyNotFoundException: The class 'com.ptteng.carrots.bangbang.model.Profession' does not have the property 'cId'.

at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:944)

at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:879)

at org.apache.jsp.WEB_002dINF.pages.carrots_002dbangbang_002dadmin_002dservice.profession.json.professionDetailJson_jsp._jspService(professionDetailJson_jsp.java:107)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)

可以看到数据已经查到了,但是提示找不到这个属性cId,不明白什么原因


下午前端要接口调试页面,就去部署开发环境

第一次部署,过程艰辛,从下午吃完饭回来弄到晚上都没跑通接口

1.开发机2 hosts配了

2.代码从svn update上去前,本地可以跑通

3.用命令打war包,tar包,移动到web、service目录下解压

4.复制resion到web项目下,修改三个端口号。http 端口号和pom文件里的对应

5.resion日志路径,resion在开发机上应该是一直启动着的吧,所以一直没有日志记录

6.用脚本启动server,执行命令后无提示,查看日志发现

[root@ptteng_dev_2 logs]# cat stderr.log

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=64m; support was removed in 8.0

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0

log4j:WARN No appenders could be found for logger (com.ptteng.carrots.bangbang.server.Server).

log4j:WARN Please initialize the log4j system properly.

log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

Aug 06, 2017 1:43:58 AM org.apache.tuscany.sca.node.impl.NodeImpl <init>

INFO: Creating node: META-INF/carrots-bangbang-admin-service/server.composite

Aug 06, 2017 1:43:59 AM org.apache.tuscany.sca.node.impl.NodeImpl configureNode

INFO: Loading contribution: file:/data/services/carrots-bangbang/carrots-bangbang-admin-service/run/classes/

Aug 06, 2017 1:43:59 AM org.apache.tuscany.sca.node.impl.NodeImpl configureNode

INFO: Loading composite: file:/data/services/carrots-bangbang/carrots-bangbang-admin-service/run/classes/META-INF/carrots-bangbang-admin-service/server.composite

Aug 06, 2017 1:43:59 AM org.apache.tuscany.sca.node.impl.NodeImpl start

INFO: Starting node: META-INF/carrots-bangbang-admin-service/server.composite

You have new mail in /var/spool/mail/root


[root@ptteng_dev_2 logs]# cat stdout.log

Spring parent context - containsBean called for name: loadTimeWeaver

Spring parent context - containsBean called for name: environment

Spring parent context - containsBean called for name: systemProperties

Spring parent context - containsBean called for name: systemEnvironment

Spring parent context - containsBean called for name: conversionService

SpringImplementationProvider: Spring context started


[root@ptteng_dev_2 logs]# cat gc.log

Java HotSpot(TM) 64-Bit Server VM (25.66-b17) for linux-amd64 JRE (1.8.0_66-b17), built on Oct  6 2015 17:28:34 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8)

Memory: 4k page, physical 16268464k(4577072k free), swap 0k(0k free)

CommandLine flags: -XX:CMSInitiatingOccupancyFraction=58 -XX:InitialHeapSize=67108864 -XX:MaxHeapSize=67108864 -XX:MaxNewSize=52428800 -XX:MaxTenuringThreshold=6 -XX:NewSize=52428800 -XX:OldPLABSize=16 -XX:OldSize=14680064 -XX:+PrintGC -XX:+PrintGCTimeStamps -XX:ThreadStackSize=256 -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC -XX:+UseParNewGC

0.548: [GC (Allocation Failure)  40960K->3695K(60416K), 0.0105438 secs]

1.047: [GC (Allocation Failure)  44655K->6503K(60416K), 0.0239698 secs]

1.236: [GC (Allocation Failure)  47463K->6741K(60416K), 0.0113899 secs]

1.369: [GC (Allocation Failure)  47701K->5626K(60416K), 0.0028920 secs]

1.690: [GC (Allocation Failure)  46586K->8095K(60416K), 0.0045676 secs]

1.880: [Full GC (System.gc())  23988K->7394K(60416K), 0.0307978 secs]

1.912: [GC (CMS Initial Mark)  8205K(60416K), 0.0005259 secs]

1.921: [GC (CMS Final Remark)  8688K(60416K), 0.0066281 secs]

2.285: [GC (Allocation Failure)  47278K->11039K(60416K), 0.0064179 secs]

3601.934: [Full GC (System.gc())  33061K->8522K(60416K), 0.0788198 secs]

3602.014: [GC (CMS Initial Mark)  8522K(60416K), 0.0003748 secs]

3602.025: [GC (CMS Final Remark)  8522K(60416K), 0.0098481 secs]


看着木有报错,又启动web提示

[root@ptteng_dev_2 deploy]# sh start.sh

Resin/4.0.47 launching watchdog at 127.0.0.1:20024

Resin/4.0.47 started -server 'ptteng-0' with watchdog at 127.0.0.1:20024

看提示是启动了


测试接口连不上

ping了下ip地址 可以测通

端口也可测通

只访问ip地址可连接到Nginx

web日志目录是空的


目前不知道是哪里出的问题,明天再问下师兄吧



收获:

学习几个Linux命令

Linux复制目录命令

cp -r dir1 dir2      dir2不存在的情况下

cp -r dir1/. dir2    dir2已存在的情况下

dir1 dir2改成对应的目录路径也可以

删除目录用

rm -rf dir


解压war包命令

jar.xvf xx.war


打包命令

jar.xvf xx.war /xx


可以写一个自动部署项目的脚本,能省掉很多时间




返回列表 返回列表
评论

    分享到