我想在我的运行在Websphere Liberty上的JAX-RS应用程序中使用这个JSON解析器.
我做了以下事情:
1)右键单击Project - > Properties - > Java Build Path - > Add External Jar - > C:\ javalib\quick-json.jar
2)将C:\ javalib添加到环境变量CLASSPATH中
3)将文件集xml添加到serverl.xml
<library id="ExternalLibs">
<fileset dir="C:\javalib" includes="*.jar"/>
</library>
Run Code Online (Sandbox Code Playgroud)
4)在"Java编译器"中未选中"启用项目特定设置"
5)清理项目
[编辑]
我最初创建了一个新实例,然后将其转换为@ApplicationScoped bean并将其注入.现在我收到这个错误:
The JNDI lookup failed for JNDI name java:module/ConsoleREST with the following Exception CNTR4007E: An error occurred creating the websphere.jaxrs.service.ConsoleREST interface for the ConsoleREST enterprise bean in the WebApiConsole.war module in the WebApiConsole application. The enterprise bean look up failed using the java:module/ConsoleREST JNDI …
Run Code Online (Sandbox Code Playgroud) 在 Liberty 上运行我的项目时,特别是在 Chrome 中,我收到一些警告消息。
[WARNING ] Detected JSESSIONID with invalid length; expected length of 23, found 28, setting: BD14EBEEDBE53803FAE565131A03 to null.
Run Code Online (Sandbox Code Playgroud)
这是因为 Liberty 正在生成长度为 28 的 JSESSIONID,但 Liberty 配置文件将 httpSession 属性 idLength 默认为 23。如果我设置
<httpSession idLength="28" />
Run Code Online (Sandbox Code Playgroud)
在 Liberty server.xml 中,我没有在日志中收到这些警告消息。但是,我想在不更改 server.xml 的情况下解决这个问题。
是否可以将 JSESSIONID 的生成方式更改为默认长度 23?或者也许这是一个糟糕的方法?
尝试将servlet部署到bluemix时收到以下错误:
SRVE0227E:检查该类是否位于正确的包目录中.SRVE0228E:使用正确的大小写和完全限定的包检查是否已在服务器中定义了类名.SRVE0229E:使用二进制传输模式检查类是否已传输到文件系统.SRVE0230E:检查类是否使用正确的大小写(如类定义中所定义).SRVE0231E:检查类文件编译后是否未重命名.*
我已根据错误消息检查了servlet,但找不到问题.
我在eclipse中有一个WebSphere Application Server V8.5 Liberty Profile.我的webapp一直在给java.lang.OutOfMemoryError
,因此我需要增加堆大小.
由于这个和这篇文章建议我改变了server.xml
,通过添加jvmEntries
标签(以前没有):
<server description="new server">
<!-- Enable features -->
<featureManager>
<feature>jsp-2.2</feature>
<feature>localConnector-1.0</feature>
<feature>jpa-2.0</feature>
</featureManager>
<!-- To access this server from a remote client add a host attribute to
the following element, e.g. host="*" -->
<httpEndpoint httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint" />
<jvmEntries initialHeapSize="1024" maximumHeapSize="2048" />
<applicationMonitor updateTrigger="mbean" />
<webApplication id="app" location="app.war"
name="app" />
</server>
Run Code Online (Sandbox Code Playgroud)
但是eclipse将它显示为无效标记,并出现以下错误:
cvc-complex-type.2.4.a:从元素'jvmEntries'开始发现无效内容.其中一个'{include,variable,trustAssociation,applicationMonitor,application,classloading,basicRegistry,bundleRepository,osgiApplication,authentication,authCache,jaasLoginModule,jaasLoginContextEntry,cdiContainer,channelfw,tcpOptions,library,collectiveMember,hostAuthInfo,managedExecutorService,connectionManager,contextService,distributedMap, enterpriseApplication,web应用,httpDispatcher,MIME类型,httpEncoding,虚拟主机,httpOptions,httpAccessLogging,httpEndpoint,的authData,数据源,jdbcDriver,jndiEntry,JPA jspEngine,文件集,执行者,的FeatureManager,配置,customLdapFilterProperties,edirectoryLdapFilterProperties,domino50LdapFilterProperties,netscapeLdapFilterProperties,ldapRegistry,securewayLdapFilterProperties, iplanetLdapFilterProperties,idsLdapFilterProperties,activedLdapFilterProperties,logging,ltpa,ejbContainer,monitor,oauthProvider,oauth-roles,remoteFileAccess,administrator-role,
quickStartSecurity,pluginConfiguration,w ebContainer,httpSession,httpSessionDatabase,sslDefault,keyStore,ssl,sslOptions,timedOperation,transaction,webAppSecurity,federatedRepository,zosLogging,authorization-roles}'是预期的.
那么我应该如何增加堆大小呢?
我已经安装了WebSphere Liberty profile 8.5.我可以使用http:// localhost:9080访问WebSphere服务器
但不确定如何启动管理控制台.
我正在将一个打包的自由服务器部署到包含我的应用程序的Bluemix中.
我想更新我的应用程序,但在此之前,我想知道什么是备份我当前正在运行的最佳方法?如果我的更新不好,我想恢复以前版本的应用程序.
换句话说,更新Bluemix中Liberty服务器上运行的Web应用程序的最佳实践或建议方法是什么.我是否只是保留了我推送到Bluemix的zip的备份并在出现问题时恢复它?或者Bluemix是否提供备份和还原的管理功能?
我知道Liberty是免费的,但是想确认IBM WAS Liberty Network Deployment配置文件是免费的吗?我们也可以建立集群.
这篇文章说:
如果您还没有WebSphere许可证,可以将Liberty配置文件Network Deployment下载为试用版.
我需要创建一个EJB计时器(使用@Schedule),但是已经读过Websphere Liberty配置文件中不支持这个?根据之前在StackOverflow上发布的问题,截至2013年8月,它不受支持:
Websphere Liberty Profile中的Java EE-Timer/@Schedule
目前,当我尝试使用@Schedule注释时,我得到以下异常:
[ERROR ] CWWKZ0004E: An exception occurred while starting the application
<EAR>. The exception message was: com.ibm.ws.container.service.state.StateChangeException: com.ibm.ws.exception.RuntimeError: java.lang.IllegalStateException: The ejbPersistentTimer feature is enabled, but the defaultEJBPersistentTimerExecutor persistent executor cannot be resolved. The most likely cause is that the DefaultDataSource datasource has not been configured. Persistent EJB timers require a datasource configuration for persistence.
Run Code Online (Sandbox Code Playgroud)
问题是我确定了默认数据源.这是EJB代码 - 它非常简单,因为我只是试图测试计时器功能:
import javax.ejb.Schedule;
import javax.ejb.Stateless;
@Stateless
public class TimerBean {
@Schedule(second="*/10", persistent=false)
public void doSomething() {
System.out.println("Hello World!"); …
Run Code Online (Sandbox Code Playgroud) 我以前在本地环境中使用Tomcat v9.0,同时使用
getServletContext()。getRealPath(“”)
检索路径,服务器返回
.... metadata.plugins \ org.eclipse.wst.server.core \ tmp1 \ wtpwebapps \ WebApp \
但是,当客户端运行WebSphere Application Server Liberty时,我在机器上安装了相同的软件,但是在Tomcat中返回路径的相同代码会返回
空值
在Websphere环境中。您能否帮助我了解为什么会发生这种情况以及如何在Websphere环境中获得通行证。我也检查了以下链接https://www.ibm.com/developerworks/community/forums/html/topic?id=eb04c8ae-02d4-421b-af2c-2ef626a3db1b&ps=50&tags=&query=&filter=&sortBy=&order=asc,但找不到解决方案。
我正在开发一个项目,我们计划使用 WLP(WebSphere liberty)而不是传统的 WAS。
该代码具有用于不同组件的 ejb 模块(ejb 2 和 3)。一个组件的 EJB 客户端被其他一些组件用来与 EJB 服务器模块进行通信。
我知道 liberty 有一些 ejb 功能。但是 liberty 是否具有与 WAS 9 中提供的相同级别的 EJB 支持/功能?
自由使用 EJB 有哪些限制/问题?
websphere ×4
eclipse ×3
ejb ×2
ibm-cloud ×2
java ×2
java-ee ×2
ibm-was ×1
javascript ×1
jsessionid ×1
open-liberty ×1
session ×1
timer ×1