给我一个maven结构的war包,反编译成项目并成功运行起来

开发工具eclipse,idea,反编译工具jq-gui

1.用eclipse创建一个maven结构的web项目
给我一个maven结构的war包,反编译成项目并成功运行起来_第1张图片
将第一项勾选,跳过选择maven结构类型,下一步的jar包类型一定要选择war包类型,其他自定义,

给我一个maven结构的war包,反编译成项目并成功运行起来_第2张图片
标准的maven结构,webapp里面的文件可以自己建。

pom文件以下配置注意两点,maven依赖包如果是私有包必须通过maven打包命令打进本地仓库再引用。打本地仓命令:mvn install:install-file -Dfile=E:\内网通文件\杜青\WEB-INF\lib\proxool-cglib.jar -DgroupId=proxool -DartifactId=proxool-cglib -Dversion=0.9.1 -Dpackaging=jar

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0modelVersion>
  <groupId>com.coswgroupId>
  <artifactId>transartifactId>
  <packaging>warpackaging>
  <version>0.0.1-SNAPSHOTversion>
  <name>trans Maven Webappname>
  


> ## 这里可以配置pom文件的属性值,便于全局通用 ##

  <properties>
        <project.build.sourceEncoding>UTF-8project.build.sourceEncoding>
        <springVersion>4.3.7.RELEASEspringVersion>
  properties>

    <dependencies>
        <dependency>
            <groupId>junitgroupId>
            <artifactId>junitartifactId>
            <version>4.1version>
        dependency>

        
        <dependency>
            <groupId>javax.servletgroupId>
            <artifactId>servlet-apiartifactId>
            <scope>providedscope>
            <version>3.0-alpha-1version>
        dependency>
        <dependency>
            <groupId>javax.servletgroupId>
            <artifactId>jstlartifactId>
            <version>1.2version>
        dependency>
        <dependency>
            <groupId>javax.servletgroupId>
            <artifactId>jsp-apiartifactId>
            <scope>providedscope>
            <version>2.0version>
        dependency>
        <dependency>
            <groupId>taglibsgroupId>
            <artifactId>standardartifactId>
            <version>1.1.2version>
        dependency>

        
        <dependency>
            <groupId>org.slf4jgroupId>
            <artifactId>slf4j-apiartifactId>
            <version>1.7.1version>
        dependency>
        <dependency>
            <groupId>org.slf4jgroupId>
            <artifactId>slf4j-log4j12artifactId>
            <version>1.7.1version>
        dependency>
        <dependency>
            <groupId>log4jgroupId>
            <artifactId>log4jartifactId>
            <version>1.2.16version>
        dependency>
        

        
        <dependency>
            <groupId>org.springframeworkgroupId>
            <artifactId>spring-coreartifactId>
            <version>${springVersion}version>
        dependency>

        <dependency>
            <groupId>org.springframeworkgroupId>
            <artifactId>spring-beansartifactId>
            <version>${springVersion}version>
        dependency>

        <dependency>
            <groupId>org.springframeworkgroupId>
            <artifactId>spring-contextartifactId>
            <version>${springVersion}version>
        dependency>
        <dependency>
            <groupId>org.springframeworkgroupId>
            <artifactId>spring-context-supportartifactId>
            <version>${springVersion}version>
        dependency>

        <dependency>
            <groupId>org.springframeworkgroupId>
            <artifactId>spring-txartifactId>
            <version>4.3.7.RELEASEversion>
        dependency>
        <dependency>
            <groupId>org.springframeworkgroupId>
            <artifactId>spring-expressionartifactId>
            <version>${springVersion}version>
        dependency>

        <dependency>
            <groupId>org.springframeworkgroupId>
            <artifactId>spring-webartifactId>
            <version>${springVersion}version>
        dependency>

        
        <dependency>
            <groupId>org.springframeworkgroupId>
            <artifactId>spring-webmvcartifactId>
            <version>${springVersion}version>
        dependency>
        
        <dependency>
            <groupId>org.springframeworkgroupId>
            <artifactId>spring-ormartifactId>
            <version>${springVersion}version>
        dependency>
        
        
        <dependency>
            <groupId>org.aspectjgroupId>
            <artifactId>aspectjweaverartifactId>
            <version>1.8.4version>
        dependency>

        
        <dependency>
            <groupId>org.hibernategroupId>
            <artifactId>hibernate-coreartifactId>
            <version>4.3.8.Finalversion>
        dependency>

        <dependency>
            <groupId>org.hibernategroupId>
            <artifactId>hibernate-ehcacheartifactId>
            <version>4.3.8.Finalversion>
        dependency>

        

        
        <dependency>
            <groupId>javassistgroupId>
            <artifactId>javassistartifactId>
            <version>3.9.0.GAversion>
        dependency>
        

        <dependency>
            <groupId>com.fasterxml.jackson.coregroupId>
            <artifactId>jackson-annotationsartifactId>
            <version>2.5.0version>
        dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.coregroupId>
            <artifactId>jackson-coreartifactId>
            <version>2.5.0version>
        dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.coregroupId>
            <artifactId>jackson-databindartifactId>
            <version>2.5.0version>
        dependency>

        
        <dependency>
            <groupId>commons-langgroupId>
            <artifactId>commons-langartifactId>
            <version>2.6version>
        dependency>
        <dependency>
            <groupId>commons-fileuploadgroupId>
            <artifactId>commons-fileuploadartifactId>
            <version>1.3.1version>
        dependency>
        <dependency>
            <groupId>commons-httpclientgroupId>
            <artifactId>commons-httpclientartifactId>
            <version>3.1version>
        dependency>
        <dependency>
            <groupId>commons-logginggroupId>
            <artifactId>commons-loggingartifactId>
            <version>1.1.1version>
        dependency>
        <dependency>
            <groupId>commons-codecgroupId>
            <artifactId>commons-codecartifactId>
            <version>1.10version>
        dependency>
        <dependency>
            <groupId>commons-collectionsgroupId>
            <artifactId>commons-collectionsartifactId>
            <version>3.2.1version>
        dependency>
        <dependency>
            <groupId>commons-beanutilsgroupId>
            <artifactId>commons-beanutilsartifactId>
            <version>1.9.0version>
        dependency>

        
        <dependency>
            <groupId>org.quartz-schedulergroupId>
            <artifactId>quartzartifactId>
            <version>2.2.1version>
        dependency>

        
        <dependency>
            <groupId>org.codehaus.jacksongroupId>
            <artifactId>jackson-core-lgplartifactId>
            <version>1.2.1version>
        dependency>
        <dependency>
            <groupId>org.codehaus.jacksongroupId>
            <artifactId>jackson-mapper-lgplartifactId>
            <version>1.2.1version>
        dependency>
        
        <dependency>
            <groupId>com.google.code.gsongroupId>
            <artifactId>gsonartifactId>
            <version>2.2.4version>
        dependency>

        
        
        <dependency>
            <groupId>mysqlgroupId>
            <artifactId>mysql-connector-javaartifactId>
            <version>5.1.30version>
        dependency>

        
        <dependency>
            <groupId>proxoolgroupId>
            <artifactId>proxoolartifactId>
            <version>0.9.1version>
        dependency>
        <dependency>
            <groupId>proxoolgroupId>
            <artifactId>proxool-cglibartifactId>
            <version>0.9.1version>
        dependency>

        
        <dependency>
            <groupId>net.sf.json-libgroupId>
            <artifactId>json-libartifactId>
            <version>1.0version>
        dependency>
        <dependency>
            <groupId>xomgroupId>
            <artifactId>xomartifactId>
            <version>1.2.5version>
        dependency>

        <dependency>
            <groupId>net.sf.ezmorphgroupId>
            <artifactId>ezmorphartifactId>
            <version>1.0.6version>
        dependency>

        <dependency>
            <groupId>org.apache.httpcomponentsgroupId>
            <artifactId>httpclientartifactId>
            <version>4.3version>
        dependency>
        <dependency>
            <groupId>org.apache.httpcomponentsgroupId>
            <artifactId>httpmimeartifactId>
            <version>4.3version>
        dependency>

        
        <dependency>
            <groupId>xmlpullgroupId>
            <artifactId>xmlpullartifactId>
            <version>1.1.3.4aversion>
        dependency>
        <dependency>
            <groupId>kxml2groupId>
            <artifactId>kxml2artifactId>
            <version>2.3.0version>
        dependency>
        

        
        <dependency>
            <groupId>com.coswgroupId>
            <artifactId>commons-utilartifactId>
            <version>1.0version>
        dependency>

        <dependency>
            <groupId>com.coswgroupId>
            <artifactId>commons-cardartifactId>
            <version>1.0version>
        dependency>

        <dependency>
            <groupId>com.coswgroupId>
            <artifactId>commons-hsmartifactId>
            <version>1.0version>
        dependency>

        
        <dependency>
            <groupId>com.coswgroupId>
            <artifactId>qh-card-serviceartifactId>
            <version>1.0version>
        dependency>

        <dependency>
            <groupId>com.coswgroupId>
            <artifactId>qh-card-protocolartifactId>
            <version>1.0version>
        dependency>

    dependencies>

## build打包编译并部署到jetty ##

    <build>
        <finalName>ncubossfinalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.pluginsgroupId>
                <artifactId>maven-compiler-pluginartifactId>
                <version>2.5version>
                <configuration>
                    <source>1.8source>
                    <target>1.8target>
                configuration>
            plugin>
            <plugin>
                <groupId>org.apache.maven.pluginsgroupId>
                <artifactId>maven-clean-pluginartifactId>
                <version>2.4version>
            plugin>
            <plugin>
                <groupId>org.apache.maven.pluginsgroupId>
                <artifactId>maven-war-pluginartifactId>
                <version>2.6version>
                <configuration>
                    <webResources>
                        <resource>
                            <directory>${project.basedir}/libdirectory>
                            <targetPath>WEB-INFtargetPath>
                            <filtering>truefiltering>
                            <includes>
                                <include>*.jarinclude>
                            includes>
                        resource>
                    webResources>
                configuration>
            plugin>

            <plugin>
                <groupId>org.apache.maven.pluginsgroupId>
                <artifactId>maven-dependency-pluginartifactId>
                <version>2.4version>
                <executions>
                    <execution>
                        <id>copyid>
                        <phase>packagephase>
                        <goals>
                            <goal>copy-dependenciesgoal>
                        goals>
                        <configuration>
                            <outputDirectory>src/main/webapp/WEB-INF/liboutputDirectory>
                        configuration>
                    execution>
                executions>
            plugin>
            <plugin>
                <groupId>org.codehaus.mojogroupId>
                <artifactId>tomcat-maven-pluginartifactId>
                <version>1.0-beta-1version>
                <configuration>
                    <url>http://localhost:8080/manager/texturl>
                    <server>tomcatserver>
                    <path>/ncubosspath>
                
                configuration>
            plugin>
## jetty服务插件以及配置 ##
            
            <plugin>
                <groupId>org.mortbay.jettygroupId>
                <artifactId>maven-jetty-pluginartifactId>
                <version>6.1.26version>
                <configuration>
                <connectors>
                <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                    <port>9090port>
                connector>
            connectors>  
                    <scanIntervalSeconds>10scanIntervalSeconds>
                    <webAppConfig>
                        <contextPath>/transcontextPath>
                    webAppConfig>
                configuration>
            plugin>

        plugins>
    build>
project>

解决Cannot change version of project facet Dynamic web module to 2.5
这里写链接内容

最近做的一个项目中运用到了连接池技术,可能我们大家比较熟悉的开源连接池有dbcp,c3p0,proxool。对这三种连接池来说,从性能和出错率来说,proxool稍微比前两种好些。今天我主要简单的讲述一下proxool,我在项目中成功的配置和源码。

    第一步:首先去http://proxool.sourceforge.net/下载一个proxool.jar文件了,我用的是proxool-0.9.0RC3.jar,现在最新版本是proxool-0.9.1.jar,我在用这个JAR包时,老是报如下错误: 

严重: Servlet.service() for servlet action threw exception
java.lang.NoClassDefFoundError: org/logicalcobwebs/cglib/proxy/Callback
at org.logicalcobwebs.proxool.ConnectionPool.getConnection(ConnectionPool.java:261)
at org.logicalcobwebs.proxool.ProxoolDriver.connect(ProxoolDriver.java:89)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)

最后换用proxool-0.9.0RC3.jar无此问题,哪们知道解决办法的话,请留言.
.除了他们的查看监控台的页面有变化,其他的变化不是太大。

给我一个maven结构的war包,反编译成项目并成功运行起来_第3张图片

换了jar包之后,CallBack类就可以找到了。以上就是在整个过程中遇到的比较难的问题,备忘下。

你可能感兴趣的:(技术备忘)