eclipse中的Maven动态Web项目为依赖项目部署无效的jar文件(Maven dynamic web project in eclipse deploys invalid jar files for dependent project(s))
我有一个导入eclipse的maven web项目。 我有另一个maven项目(生成一个jar文件),该web项目依赖。
这两个项目在从命令行执行时都可以正常工作。 mvn包创建一个war文件,该文件从web项目的maven存储库中获取它所依赖的jar文件。 运行库时,mvn包会创建一个有效的jar文件。
当我将库导入Eclipse时,m2e认识到Web项目依赖于库并更新了项目的某些部分,以利用这两个Maven项目都驻留在单个Eclipse工作区中的事实。 Web项目的“Java Build Path”首选项的“Libraries”选项卡的“Maven Dependencies”部分将删除库jar文件并将其替换为库项目。 随着库在Eclipse中进行更新,Web项目可识别这些更改,而无需安装/部署库。
当我尝试在Eclipse中运行Web应用程序时,会发生该问题。 由于Eclipse实际上是针对Eclipse中的库版本构建Web项目的,因此它不会从Maven存储库部署库文件,它会创建一个新的jar文件,该文件是Eclipse中当前版本库的快照。 所有这些对我来说一般都很好,但是在我正在处理的项目中,Eclipse正在创建的jar文件存在问题。 而不是插入库的类文件,它似乎将我的Maven项目的“src”目录并将其压缩为jar文件。 jar文件的内容如下所示:
-main -java -com -... *.java -resources -... -test -java -com -... *.java
我期望它看起来更像是:
-com -... *.class
既然我已经成功地使用过这种类型的项目,我试图弄清楚是否需要配置一些东西,或者如果我碰到一个bug。
我在Eclipse Indigo上使用最新的m2e(1.0.200.20111228-1245)更新(Build ID:20120216-1857)。
I have a maven web project that imported into eclipse. I have another maven project (generates a jar file) that the web project depends on.
Both of these projects work correctly when executed from the command line. mvn package creates a war file which pulls the jar it depends on from the maven repository for the web project. mvn package creates a valid jar file when run for the library.
When I import the library into Eclipse, m2e recognizes that the web project depends on the library and updates parts of the project to take advantage of the fact that both maven projects are hosted within a single Eclipse workspace. The "Maven Dependencies" section of the "Libraries" tab of the "Java Build Path" preference for the web project removes the library jar file and replaces it with the library project. As the library is updated in Eclipse, the web project recognizes those changes without having to install/deploy the library.
The problem occurs when I attempt to run the web application in Eclipse. Because Eclipse is actually building the Web project against the version of the library in Eclipse, it does not deploy the library file from the maven repository, it creates a new jar file that's a snapshot of the current version of the library in Eclipse. All of this has generally worked well for me, but on the project I'm currently working on there's a problem with the jar file that Eclipse is creating. Instead of inserting the class files for the library, it appears that it's taking the "src" directory of my Maven project and zipping it up as the jar file. The contents of the jar file look something like:
-main -java -com -... *.java -resources -... -test -java -com -... *.java
Where I would expect it to look more like:
-com -... *.class
Since I have successfully used this type of project before, I'm trying to figure out if there's something I need to configure or if I've just run into a bug.
I'm using the latest update of m2e (1.0.200.20111228-1245) on Eclipse Indigo (Build id: 20120216-1857).
原文:https://stackoverflow.com/questions/9710925
最满意答案
问题不在于Greenplum,命令失败的是
socket.getaddrinfo(hostToPing, None)
。 很可能你在机器上运行selinux,禁用它So i fixed the issue by adding a mapping to the /etc/hosts file..i have no idea what broke it in the first place but it is working for now
Reference :- https://support.pivotal.io/hc/communities/public/questions/203012917-cannot-start-greenplum-gpstart-failed
相关问答
更多-
您无法在Greenplum的交易中开始或结束交易。 它会自动提交或自动回滚。 多版本并发控制,始终存在数据一致性,并且查询始终在并行机制内按顺序执行。 重试: - 标签重试开始 truncate table tablename select pg_sleep(5) -- Wait for 5 ms Insert into tablename RAISE INFO 'Rollback Transaction' IF ERROR_NUMBER = 1205 -- Deadlock Error Number ...
-
回答你的问题:“我想建立从sql到greenplum数据库的连接”......对于你指的是哪个SQL数据库是不明确的。 此外,没有直接连接驱动程序可用于将非greenplum数据库连接到greenplum数据库。 但是,如果您想将数据从Oracle迁移到Greenplum,那么您可以使用Informatica的快速克隆工具。 回答关于gpfdist和gpload的第二部分问题。 GPFDIST是一个在主机系统上运行的文件分发过程,它可以并行处理许多段文件。 当初始化外部表从文件读取/写入时,您需要指定哪个进 ...
-
不,Greenplum必须在扩展阶段停止,但在添加更多节点/分段后,数据的重新分配可以在用户在数据库中处于活动状态时完成。 或者,Pivotal HDB(基于Apache HAWQ)确实具有动态虚拟段,您甚至可以在查询级别进行控制。 优化器根据查询的成本控制查询使用多少段,但您也可以提供更多段来真正利用集群中可用的资源。 No, Greenplum must stop during the expansion phase but after it adds more nodes/segments, the ...
-
好的,它可以做到。 我已经测试过,只需安装不同的路径,用户所有者和端口。 防爆。 GPDB 4.2.5.2 /usr/local/greenplum-db-4.2.5.2 所有者是“gpadm4252”用户 端口基础从40000开始(段主机) 主人主持人是5432 GPDB 4.2.6.2 /opt/greenplum-db-4.2.6.2 所有者是“gpadm4262”用户 端口基础从45000开始(段主机) 主帖是6432 OK, It can do. I already tested, just in ...
-
问题不在于Greenplum,命令失败的是socket.getaddrinfo(hostToPing, None) 。 很可能你在机器上运行selinux,禁用它 So i fixed the issue by adding a mapping to the /etc/hosts file..i have no idea what broke it in the first place but it is working for now Reference :- https://support.pivota ...
-
调度在greenplum DB上运行的postgreSQL查询(Scheduling a postgreSQL query operating on greenplum DB)[2022-07-21]
您将需要对Greenplum和PostgreSQL中的数据范围进行并行COPY 。 确保PostgreSQL设置为快速数据加载。 如果可能,请使用UNLOGGED表; 否则至少使用wal_level = 'minimal' 。 有多少并行工作者依赖于PostgreSQL服务器的I / O子系统。 测试看看。 我建议使用Python和psycopg2以及copy_expert游标函数。 查看文档 。 使用管道进行多处理,在读写器工作者之间共享类似文件的对象,读取器连接到greenplum,编写器连接到Post ... -
DISTRIBUTED BY是Greenplum如何确定哪个段将存储每一行。 由于Greenplum是大多数生产数据库中的MPP数据库,因此您将拥有多个分段服务器。 您希望确保“分发”列是您将加入的列。 temp_table是将在Greenplum集群上为您创建的表。 如果您尚未将search_path设置为其他内容,则它将位于公共模式中。 DISTRIBUTED BY is how Greenplum determines which segment will store each row. Becaus ...
-
尝试这个: UPDATE IncrementalLoad_Dest_dbo.tblDest d SET d.ColA = s.ColA, d.ColB = s.ColB, d.ColC = s.ColC FROM IncrementalLoad_Source_dbo.tblSource s WHERE s.ColID = d.ColID and ((d.ColA != s.ColA) OR (d.ColB != s.ColB) OR (d.ColC != s.ColC)); 您基本上必须 ...
-
gpfdist将在ETL服务器上运行,而不是在主控主机上运行。 您必须将ETL服务器ip和name添加到Greenplum集群中所有节点上的/ etc / hosts文件中。 然后,您需要确保ETL服务器可以直接与Greenplum专用网络中的段主机通信。 这需要将Greenplum使用的10GB私有交换机连接到10GB LAN并创建VLAN以便您可以访问节点,或者您可以从ETL服务器运行10GB电缆以打开10GB交换机的端口并为其分配IP地址与现有主机不冲突。 gpfdist will run on th ...
-
虽然我不知道究竟是什么原因,但我可以解决这个错误。 然而,第一次,我在一次性完成所有步骤时遇到了很多问题(很多先决条件都不清楚)因此我可能在此错误中结束了。 所以我拿了一台干净的机器,尝试了以下所有步骤。 还要确保在开始第一步之前添加了以下必备软件包。 先决条件1.以gpadmin身份创建新用户。 为该用户设置密码2.确保密码少ssh从root用户以及从同一用户到localhost。 3.仅将所有步骤作为新用户的一部分。 4.首先安装下面的软件包yum install -y zlib * yum insta ...