GVKun编程网logo

JRE System Library、Referenced Libraries、Web App Libraries的含义(jre libraries are missing)

1

最近很多小伙伴都在问JRESystemLibrary、ReferencedLibraries、WebAppLibraries的含义和jrelibrariesaremissing这两个问题,那么本篇文章

最近很多小伙伴都在问JRE System Library、Referenced Libraries、Web App Libraries的含义jre libraries are missing这两个问题,那么本篇文章就来给大家详细解答一下,同时本文还将给你拓展(OK) cannot locate symbol referenced by (math symbols in libgcc.a sneaking into dynamic libraries)、.net – System.Web.Razor vs System.Web.WebPages.Razor、asp.net – BC30561:’Html’不明确,从命名空间或类型’System.Web.WebPages,System.Web.Mvc’导入、asp.net – RedirectToAction MVC2的问题 – 不能将类型“System.Web.Mvc.RedirectToRouteResult”隐式转换为“System.Web.Mvc.ViewResult”等相关知识,下面开始了哦!

本文目录一览:

JRE System Library、Referenced Libraries、Web App Libraries的含义(jre libraries are missing)

JRE System Library、Referenced Libraries、Web App Libraries的含义(jre libraries are missing)

  • JRE System Library、Referenced Libraries、Web App Libraries 这三个都是jar包的存放集合
  • JRE System Library:指Java SE 的常用库文件集合,建立普通的Java项目均会使用。
  • Referenced Libraries:指你项目中所使用的第三方库文件集合,如果你把项目所需要的其他JAR包直接加在,项目 --> 属性 --> Java Build Path --> Libraries 中的时候,Eclipse 会自动将这些JAR包归类到一个集合中, 并取名为 Referenced Libraries ,显示在项目中。
  • 问:经常在SSH中出现jar包冲突,不知是 Referenced Libraries 中的jar文件冲突,还是 WebRoot/WEB-INF/lib/ 下jar文件冲突?
    • 解答:编译期冲突是由 Referenced Libraries 中jar包冲突引起;运行期冲突是由 WebRoot/WEB-INF/lib/ 下jar文件冲突引起的。
    • 首先,Referenced Libraries 可以是引用 WebRoot/WEB-INF/lib/ lib下的jar包,也可以是其他从别的地方复制过来的第三方jar包。Referenced Libraries 是编译环境下使用的JAR包,所谓编译环境下使用的JAR包,就是说你在Eclipse中进行源文件的编写的时候,所需要引用到的类都 Referenced Libraries 这个集合中的JAR包中拿。
    • WebRoot/WEB-INF/lib 中的JAR包是运行时环境下使用的JAR包,所谓运行时环境下使用的JAR包,就是说你在运行你的项目的时候所需要使用的JAR包的集合。
    • 注意区分两种环境:编译环境与运行环境。
  • Web App Libraries: 关于web项目没有看到Web App Libraries,可以通过右键项目 --> built path --> Configure built path --> 点击libraries标签 --> 选择右边的 Add Library… 按钮 ,在弹出的窗口中选择 Web App Libraries 添加即可。

  • Referenced Libraries 是存放第三方的jar包,也就是自己导入的jar包。在项目属性的Java Build Path中的Libraries中配置。
    • 本人理解:这里导入和配置jar包,都是为了让web工程能够在eclipse开发环境可以正常编译,不报错而已。如果该web工程利用eclipse生成war包,是不会导出其jar包到 WEB-INF/lib文件夹下的。
  • Web App Libraries 的主要作用是让eclipse导出war包的时候,会把其目录下的所有jar或者项目中的工程引用都导出到WEB-INF/lib文件夹下。
    • Web App Libraries中的jar包在eclipse中项目属性的Java EE Module Dependencies 配置的。如果你勾上了,或者添加了外部jar包,都会在WEB-INF/lib文件夹下生成。
    • 当然,如果你直接在WEB-INF/lib文件夹下,copy一个jar进入,刷新一下,Web App Libraries 也会自动增加一个jar的引用。简单说,Java EE Module Dependencies的配置只针对Web App Libraries。
  • 在项目发布的时候 Referenced Libraries 下面的jar包不会被打包

  • 补刀1:
    • EJB = Enterprise Java Bean
      • 实体Bean --> 类似于Hibernate中的持久化对象
      • 会话Bean --> 类似于Service
      • 消息驱动Bean --> 发送消息
    • EAR Libraries:开发EJB工程所需的库包。
    • EAR Libraries:是开发JavaEE服务器端组件模型所需要的库包。但是现在一般都用轻量化的框架实现模块化。EJB太笨重了,2003年的淘宝就是采用EJB开发,现在已经很少见了。
    • 开发EJB工程所需的库包,像我们常用zip或者rar一样,也是可以解压出来的。
    • 顺便说下:
      • war包:是做好一个web应用后,通常是网站,打成包部署到容器中。
      • jar包:通常是开发时要引用通用类,打成包便于存放管理。
      • ear包:企业级应用,通常是EJB打成ear包。
      • 所有的包都是用jar打的,只不过目标文件的扩展名不一样。

  • 补刀2:
    • cdn全称是Content Delivery Network,主要用于加速静态资源,如网站上面上传图片、媒体、以及引入的一些js和css等文件。它的加速依靠各个网络节点,例如100台CDN服务器分布在全国,从上海访问,会从最近的节点返回资源,这是核心。

(OK) cannot locate symbol referenced by (math symbols in libgcc.a sneaking into dynamic libraries)

(OK) cannot locate symbol referenced by (math symbols in libgcc.a sneaking into dynamic libraries)


http://dan.drown.org/android/worknotes.html


Worknotes for the The android ports project

1/5/2014 - math symbols in libgcc.a sneaking into dynamic libraries

When linking for Android, special attention has to be made for the symbols in libgcc.a, especially when using libgnustl. When source is compiled without hardware math support, it''ll generate various __aeabi_ calls. This can lead to a problem if you link against a dynamic library that has these symbols (copied from libgcc.a) and try to run it on a library without the copies. You''ll get an error message as follows:

CANNOT LINK EXECUTABLE: cannot locate symbol "__aeabi_d2uiz" referenced by "iperf"...
Adding -Wl,-y__aeabi_d2uiz (trace the symbol __aeabi_d2uiz) to the LDFLAGS to find out where this is coming from, I get the output:
/home/admin/droid/lib/libstdc++/libs/armeabi//libgnustl_shared.so: definition of __aeabi_d2uiz
/home/admin/droid/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/libgcc.a(_fixunsdfdi.o): reference to __aeabi_d2uiz
You can see here that the symbol is assumed to come from libgnustl_shared.so. But if you have the armeabi-v7a version of libgnustl_shared.so, it does not have a copy of __aeabi_d2uiz. Looking at the symbols in the libraries:
# nm -D ~/droid/android-ndk/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/libgnustl_shared.so | grep __aeabi_ | wc -l
23
# nm -D ~/droid/android-ndk/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/libgnustl_shared.so | grep __aeabi_ | wc -l
52
This is because the armv7a has hardware math support, and does not need the routines from libgcc.a
Summary: make sure your running environment matches your cross compile environment

1/17/2012 - the dynamic linker on ice cream sandwich

Ice cream sandwich has changed their environment, and using the linker compiled against the GB environment in ICS causes a segmentation fault:

#0  0xb00099ac in __set_errno (n=2) at bionic/libc/bionic/__set_errno.c:34
#1  0xb00099c4 in __set_syscall_errno (n=)
    at bionic/libc/bionic/__set_errno.c:51
#2  0xb0002110 in _open_lib (name=0xbed74934 "/vendor/lib/libc.so")
    at linker.c:609
#3  0xb0002248 in open_library (name=0x84b5 "libc.so") at linker.c:638
The linker is statically linked (for obvious reasons) and __set_errno gets copied into the linker from libc.a at build time. Updating the NDK to r7 (from r5b) fixes this problem.

7/24/2011 - the dynamic linker, /system/bin/linker

Not much has been written about bionic''s dynamic linker (that I can find). Itsupports the environment variable LD_LIBRARY_PATH, but does not support ald.so.conf file or an rpath built into the binary. This makes it hard to addshared libraries, as the /system/lib directory is mounted read-only on most(all?) phones. So, changing the dynamic linker is needed in order to changethe library search path (using the environment variable LD_LIBRARY_PATH ispossible, but does not seem very reliable).

The change to the library path is very simple. I''ve added /data/local/lib tothe library search path in my copy of the dynamic linker. Telling gcc to usethe new path to the dynamic linker is the flag "-Wl,-dynamic-linker,/data/local/bin/linker"I''ve verified that the bind binaries work with their shared libraries in/data/local/lib, and it has reduced the install size of the bind-utils packagefrom 17.3mb to 5.5mb

7/21/2011 - Resolver library

Changing the dns server at runtime for a single process (through the _res global object) is highly discouraged on bionic, to the point where there is no global object named _res. I took the resolver code from dietlibc and gave it non-conflicting function names in order to get the nslookup applet in busybox working.

7/7/2011 - Busybox

I want to port busybox to Android''s libc because the busybox ports I''ve seen are statically compiled against glibc or uclibc. This means: no user/group info and no dns configuration. No DNS is a problem for tools like wget, ping, and traceroute.

After filling in the missing functions and other porting work, I was having trouble with output/input not showing up or otherwise acting strange. After doing some investigation on my busybox binary, I found that inline functions (from stdio.h) were failing but regular functions (in libc.so) worked. I also found that the busybox binary had the symbol "__sF" and so did libc.so. Normally, the binary would have an undefined reference that would be satisfied at runtime linking.

The "__sF" symbol is an array of files for the stdin, stdout, stderr macros. Inline functions would get messed up by the binary''s symbol, and libc functions would . That brings up the next question: how did that symbol get in the binary? I went through all the .a and .o files and only found undefined references (as expected). I eventually found that it depended on which busybox applets I built into the binary.

Since it was a problem triggered by one (or more) applets, I used a binary search to find one of the applets that was causing the problem. Turns out there was only one applet causing the problem, "diff". So next up was a binary search of the functions inside of the diff applet. And it turns out, it was one line of code: "FILE *fp[2] = { stdout, stdin };". Changing the code to runtime instead of initalized by the dynamic linker works around the issue: "FILE *fp[2]; fp[0] = stdout; fp[1] = stdin;"

A comparison of objdump between the broken code and the working code:

$ aobjdump -R puts | grep __sF
00009538 R_ARM_GLOB_DAT    __sF
0000953c R_ARM_COPY        __sF
$ aobjdump -R puts-ok | grep __sF
00009534 R_ARM_GLOB_DAT    __sF
$ aobjdump -T puts | grep __sF
0000953c g    DO .bss	000000fc __sF
$ aobjdump -T puts-ok | grep __sF
00000000      DO *UND*	00000000 __sF
Also, comparing the intermediate forms (agcc -c X.c):
$ aobjdump -r puts.o

puts.o:     file format elf32-littlearm

RELOCATION RECORDS FOR [.text]:
OFFSET   TYPE              VALUE 
00000090 R_ARM_PLT32       __swbuf
000000f0 R_ARM_GOTPC       _GLOBAL_OFFSET_TABLE_
000000f4 R_ARM_REL32       .data.rel.ro
000000f8 R_ARM_GOT32       __sF


RELOCATION RECORDS FOR [.data.rel.ro]:
OFFSET   TYPE              VALUE 
00000000 R_ARM_ABS32       __sF
00000004 R_ARM_ABS32       __sF

$ aobjdump -r puts-ok.o

puts-ok.o:     file format elf32-littlearm

RELOCATION RECORDS FOR [.text]:
OFFSET   TYPE              VALUE 
00000090 R_ARM_PLT32       __swbuf
000000f8 R_ARM_GOTPC       _GLOBAL_OFFSET_TABLE_
000000fc R_ARM_GOT32       __sF

Some further comparison between data relocation vs run-time reference:

# gdb ./print
...
(gdb) info shared
From        To          Syms Read   Shared Object Library
0xb0001000  0xb00090e8  Yes (*)     /system/bin/linker
0xafd0a720  0xafd38908  Yes (*)     /system/lib/libc.so
(*): Shared library is missing debugging information.
(gdb) cont
Continuing.
9500 =? 9500
Program exited with code 015.
(gdb) quit
# gdb ./print-ok
...
(gdb) info shared
From        To          Syms Read   Shared Object Library
0xb0001000  0xb00090e8  Yes (*)     /system/bin/linker
0xafd0a720  0xafd38908  Yes (*)     /system/lib/libc.so
(*): Shared library is missing debugging information.
(gdb) cont
Continuing.
afd424f8 =? afd424f8
From this, you can see that the stdout macro (and __sF symbol) are referring to the wrong location. With print.c, it points to 0x9500, which is the bss segment of the executable. With print-ok.c, it points into the libc.so memory location, where it belongs.

.net – System.Web.Razor vs System.Web.WebPages.Razor

.net – System.Web.Razor vs System.Web.WebPages.Razor

这些组件用于什么?我刚刚注意到,当删除对System.Web.Razor的引用时,ASP.NET项目似乎工作得非常好.

由于应用程序似乎不是必须运行的,删除它是否安全?

解决方法

两个程序集都是Razor实现的一部分. System.Web.WebPages.Razor具有对System.Web.Razor的引用.您已从项目中删除它作为参考,但您的应用程序仅适用,因为此程序集位于GAC中.否则它不会.所以两者实际上都需要在运行时出现.

asp.net – BC30561:’Html’不明确,从命名空间或类型’System.Web.WebPages,System.Web.Mvc’导入

asp.net – BC30561:’Html’不明确,从命名空间或类型’System.Web.WebPages,System.Web.Mvc’导入

我将我的MVC应用程序从MVC 3升级到5.2.2,现在我收到了这个错误.我使用新的项目向导创建了一个全新的MVC项目,这很有效,我在两个项目中比较了我的/web.config和Views / web.config文件,但没有看到任何看起来很重要的差异.

在对象浏览器中查看,实际上在System.Web.WebPages和System.Web.Mvc中定义了两个不同的HtmlHelper对象,这似乎是相关的:

但我不确定如何处理这个事实.

解决方法

经过几个小时的摔跤,然后在这里发布问题,我一分钟后想出来了;我已经指定了一个像这样的强类型模型:

@ModelType IEnumerable(Of MyModel)

但是在我升级到5.2.2的同一时间,我重新组织了我的命名空间,以便MyModel位于不同的命名空间中,这导致了问题.解决方法是将其更改为:

@ModelType IEnumerable(Of NewNamespace.MyModel)

如果编译器发现了这一点会很好.我永远不会想到它根本找不到我的模型对象类型,但不会这么说.

asp.net – RedirectToAction MVC2的问题 – 不能将类型“System.Web.Mvc.RedirectToRouteResult”隐式转换为“System.Web.Mvc.ViewResult”

asp.net – RedirectToAction MVC2的问题 – 不能将类型“System.Web.Mvc.RedirectToRouteResult”隐式转换为“System.Web.Mvc.ViewResult”

在尝试使用RedirectToAction时,我收到此错误,任何人都可以提供任何建议,为什么会发生这种情况,呃在没有任何问题的情况下使用这个错误,我一定是缺少一些东西.

不能将类型“System.Web.Mvc.RedirectToRouteResult”隐式转换为“System.Web.Mvc.ViewResult”

[HttpPost]
    public ViewResult Edit(Customer customer)
    {
        if (ModelState.IsValid)
        {
            customersRepository.SaveCustomer(customer);
            TempData["message"] = customer.CustomerName + " has been saved.";
            return RedirectToAction("Index");
        }

        else //validation error,so redisplay the same view
            return View(customer);

    }

问候

利亚姆

解决方法

尝试将公共ViewResult Edit(客户客户)更改为public ActionResult Edit(客户客户)

ViewResult派生自ActionResult,只能返回视图.由于您的代码可以返回View或重定向,因此您应该使用ActionResult.有关详细信息,请参阅this answer.

今天的关于JRE System Library、Referenced Libraries、Web App Libraries的含义jre libraries are missing的分享已经结束,谢谢您的关注,如果想了解更多关于(OK) cannot locate symbol referenced by (math symbols in libgcc.a sneaking into dynamic libraries)、.net – System.Web.Razor vs System.Web.WebPages.Razor、asp.net – BC30561:’Html’不明确,从命名空间或类型’System.Web.WebPages,System.Web.Mvc’导入、asp.net – RedirectToAction MVC2的问题 – 不能将类型“System.Web.Mvc.RedirectToRouteResult”隐式转换为“System.Web.Mvc.ViewResult”的相关知识,请在本站进行查询。

本文标签: