1)java.lang.ArrayIndexOutOfBoundsException: 48188
如果同一个项目,在两台服务器部署,一台可以,另一台报错的话,则可能是服务器上weblogic上的版本不一样。如果一样的话,则可以检查WEB-INF下的weblogic.xml文件。
2) authentication for user denied
感觉很奇怪,我用刚输入的用户名和密码登录weblogic的控制台,确可以正常登录。运行上面的命令时,输入那个用户名和密码,就是不能启动那个服务。怀疑是受管服务本身的问题,删除了重新建,还是报一样的错误。
网上找了很久,有的说在“服务器概要”》“安全领域概要”》“myrealm”》“配置”》“用户封锁”中,去掉“启用封锁”前面的勾选标识。据说这个选项是为了防止用户名和密码验证失败次数过多时,锁定系统的。
我没有去修改这里,删除了原来的受管服务,新建了受管服务Server0,并按以下命令方式启动服务:
./startManagedWebLogic.sh Server0
http://192.168.30.98:7001
其中后面是我的管理端IP及端口。可以正常启动,并在servers目录下生成了以受管服务Server0命令的目录,进入该目录并新建security目录,进入security目录,创建boot.properties文件,输入如下信息:
username=weblogic
password=weblogic
保存后退出。使用上面的命令重启受管服务时,不再要求输入用户及密码。
ps: 如果启动后仍报错用户名密码错误的话,则删除root.properties文件和ManagedServerDir/data/ldap文件夹再试。
不需要输入用户名和秘密后,就可以使用nohup后台启动服务了
nohup ./startManagedWebLogic.sh Server0
http://127.0.0.1:7001/ &
3) weblogic.management.DeploymentException: Exception occured while downloading files
这个怀疑是部署文件中有中文存在乱码
4) root of context hierarchy
Unable to set the activation state to true for the application 'dataSource0'.
weblogic.application.ModuleException: 这种类似的错误可能是由于包冲突。如果在shell中不好看清错误的话,可以在网页控制台启动,看报错信息。 5) 如果部署已经成功,但是配置host后无法访问页面,这时候可以先看看能不能ping通,如果可以的话看看 telnet ip 端口 是否能联通,如果不行的话则说明防火墙没有对外开放。 6)如果报错误:The server name newSpaceServer specified with -Dweblogic.Name does not exist. The configuration includes the following servers {AdminServer}. 这种,但是本身又确实部署了newSpaceServer这个服务的话,则可以到base_domain/servers/下看看,如果有newSpaceServer,则先rm -rf 掉,然后再重新部署一次。 7)在一个weblogic上建立了两个服务,启动时先启动一个后报错端口冲突,然后先后执行 lsof -i:7080 (得到进程号) pwdx pid(进程ID) 这个执行后得知占用端口的是/data/weblogic/wlserver/user_projects/domains/base_domain/
然后判断是startManagedWeblogic.sh 中用到了7080,注掉后解决。
部署步骤:
1)先写deply-XXX.xml脚本
<antcall> 里面的ip 为部署的线上服务器IP
<sshexec command 为线上的部署地址(需要先建好一个空的war和文件夹,如xhTopic.war和xhTopic文件夹)
<localFile> 为本地打的WAR包地址
后面的<sshexec command 改成相应自己项目的路径,文件就成了
2) 修改POM文件
<build> <finalName>xhTopic</finalName> <plugins> <plugin> <artifactId>maven-war-plugin</artifactId> <version>2.3</version> <configuration> <packagingExcludes> WEB-INF/lib/xml-apis-*.jar, WEB-INF/lib/xmlParserAPIs-*.jar </packagingExcludes> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.6</source> <target>1.6</target> <encoding>UTF8</encoding> <compilerArguments> <verbose /> <bootclasspath>${java.home}/lib/rt.jar</bootclasspath> </compilerArguments> </configuration> </plugin> <plugin> <artifactId>maven-antrun-plugin</artifactId> <version>1.7</version> <executions> <execution> <id>package</id> <phase>package</phase> <goals> <goal>run</goal> </goals> <configuration> <tasks> <ant antfile="deploy-topic.xml" dir="f:\workspace\autoplay\src" target="deployJava" /> </tasks> </configuration> </execution> </executions> <dependencies> <dependency> <groupId>com.jcraft</groupId> <artifactId>jsch</artifactId> <version>0.1.51</version> </dependency> <dependency> <groupId>ant</groupId> <artifactId>ant-jsch</artifactId> <version>1.6.5</version> </dependency> </dependencies> </plugin> </plugins> </build>
上面的<finalName>xhTopic</finalName> 这里一定要跟deply-topic中的sshexec写的war包名称对应
修改<ant antfile="deploy-topic.xml" dir="f:\workspace\autoplay\src" 这块,改成项目相应的
3) 修改dubbo-server的port,端口要设成线上没有用过的、
4)执行depoly-xxx脚本,如果有服务器负载的话,把一个服务器的isMaser设为true