我正在开发一个包含以下3个组件的简单Web应用程序:
我需要决定使用哪个java webserver.一些选项是:
a)在java(com.sun.net.httpserver)中使用httpserver类并创建一个多线程进程.
b)使用Glassfish服务器并在其上部署创建网页的应用程序等.
c)使用Jetty.
d)?
网络服务器的选择标准是:
稳定性(进程(Web服务器)应该运行几天而不重启)
可能的最大并发请求大约为200.平均情况大约为30.
缓存在Web服务器上完成,如果数据可用或数据处理实体未标记为脏,则从Web服务器本身提供请求.
非常感谢您的建议.
谢谢.罗恩.
我们在GlassFish 2服务器上部署了一些不透明的EJB(EJB3),它们通过@Webmethod注释将它们的一些方法公开为webservices.
现在我们想要保护这些Web服务方法,以便只有经过身份验证的客户端才能调用它.实现这一目标的好方法是什么?
我要开发一个高扩展性的webservice,但是连接池大小(Oracle DB)设置为50。
拥有这个大小意味着服务的并发请求数量最多为 50,否则将没有新连接可用,对吗?
但是通过配置,Weblogic 或 Glassfish 服务器是否可以同时接受 50 个以上的请求?
我读到服务器接受“排队”的请求,直到线程处理它们。
关于“可扩展性”,我也有一个问号,因为平均数据库调用需要 1,2 秒。+ 肥皂开销...==> 每次调用的响应时间为 2,3 秒。
我可以估计服务器将支持多少并发用户(Weblogic 或 Glasfish 4gb)?
谢谢
我使用GlassFish服务器和Java EE 6创建了我的Java EE项目.当我创建项目时它工作得很好,但我关闭了我的netbeans(没有任何错误关闭了NetBeans)并启动了我的NetBeans.
然后标题问题面临.我多次重新安装我的NetBeans.所以我无法解决它.请帮我!NETBEANS GEEKS!
当我通过Glassfish服务器访问嵌入了applet的Facelets页面时,我收到此错误.虽然当我只是从我的电脑打开它时,它工作正常,所以小程序是好的.是否可以在Glassfish(3.1,JSF 2.0)上运行applet?
这是我尝试的方式:
<applet code="test.TestApplet" archive="TestApplet.jar"/>
Run Code Online (Sandbox Code Playgroud) 我在使用 Glassfish 3.1.2 + JPA + EclipseLink + MySQL 开发的应用程序上遇到了问题,在我部署应用程序后(DB 上没有表)它运行得很好,显然执行了唯一的查询(表中的实体计数)我输入的。但是如果我重新加载页面,再次调用 servlet 会导致抛出异常:TransactionRolledbackLocalException
显然与用于计算实体的方法相同。
然后如果我再次重新加载,它运行得很好,然后再次异常,很好,异常等等......
这是我的 servlet:
@WebServlet(name="Controller", urlPatterns={"/Controller"})
public class Controller extends HttpServlet {
private static final long serialVersionUID = 1L;
@EJB WineDao _wines;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
_wines.countWines();
RequestDispatcher view = request.getRequestDispatcher("ShowAll.jsp");
view.forward(request, response);
}
}
Run Code Online (Sandbox Code Playgroud)
这是 WineDao:
@Stateless
public class WineDao {
@PersistenceContext private EntityManager em;
public Long countWines() {
CriteriaBuilder qb = em.getCriteriaBuilder();
CriteriaQuery<Long> cq = qb.createQuery(Long.class);
cq.select(qb.count(cq.from(Wine.class)));
return em.createQuery(cq).getSingleResult(); …Run Code Online (Sandbox Code Playgroud) 我有glassfish服务器,我正在尝试从netbeans运行服务器.我收到以下错误:
WARNING: Cannot start JMX connector JmxConnector config: { name = system, Protocol = rmi_jrmp, Address = 0.0.0.0, Port = 8686, AcceptAll = false, AuthRealmName = admin-realm, SecurityEnabled = false} due to exception java.io.IOException: Cannot bind to URL [rmi://MAZUMDAM4.americas.hpqcorp.net:8686/jmxrmi]: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: MAZUMDAM4.americas.hpqcorp.net; nested exception is:
java.net.ConnectException: Connection timed out: connect]
SEVERE: java.io.IOException: Cannot bind to URL [rmi://MAZUMDAM4.americas.hpqcorp.net:8686/jmxrmi]: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: MAZUMDAM4.americas.hpqcorp.net; nested exception is:
java.net.ConnectException: Connection timed …Run Code Online (Sandbox Code Playgroud) 发生了以下情况。我在 Glassfish 服务器上超越了一个 Java 项目。现在由于两次异常事件,定时报告器不再工作。日志说:
[#|2014-02-19T08:00:36.179+0100|INFO|glassfish3.1.2|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=112;_ThreadName=Thread-2;|EJB5119:Expunging timer ['2@@1368688442192@@server@@domain1' 'TimedObject = TimerBean' 'Application = MY_APP' 'BEING_DELIVERED' 'PERIODIC' 'Container ID = 89698358364733447' 'Thu May 16 09:00:00 CEST 2013' '86400000' ] after [2] failed deliveries|#]
Run Code Online (Sandbox Code Playgroud)
但是我怎样才能取回这个计时器呢?我是否认为它正确,它必须在显示的屏幕“EJB 计时器服务”中以某种方式设置。
我正在尝试使用glassfish-resources.xml创建JDBC连接池和JDBC资源,代码如下.我试过用Glassfish 4.0,4.1,4.1.1和Payara来做.我知道4.1.1存在问题,但它并没有创造出任何一个问题.我一直试图解决这个问题几个小时,但没有成功.PLZ帮助.
<resources>
<jdbc-resource enabled="true"
jndi-name="jdbc/affablebean"
object-type="user"
pool-name="AffableBeanPool">
</jdbc-resource>
<jdbc-connection-pool allow-non-component-callers="false"
associate-with-thread="false"
connection-creation-retry-attempts="0"
connection-creation-retry-interval-in-seconds="10"
connection-leak-reclaim="false"
connection-leak-timeout-in-seconds="0"
connection-validation-method="auto-commit"
datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
fail-all-connections="false"
idle-timeout-in-seconds="300"
is-connection-validation-required="false"
is-isolation-level-guaranteed="true"
lazy-connection-association="false"
lazy-connection-enlistment="false"
match-connections="false"
max-connection-usage-count="0"
max-pool-size="32"
max-wait-time-in-millis="60000"
name="AffableBeanPool"
non-transactional-connections="false"
pool-resize-quantity="2"
res-type="javax.sql.ConnectionPoolDataSource"
statement-timeout-in-seconds="-1"
steady-pool-size="8"
validate-atmost-once-period-in-seconds="0"
wrap-jdbc-objects="false">
<description>Connects to the affablebean database</description>
<property name="URL" value="jdbc:mysql://localhost:3306/affablebean"/>
<property name="User" value="root"/>
<property name="Password" value="nbuser"/>
</jdbc-connection-pool>
</resources>
Run Code Online (Sandbox Code Playgroud) 我下载了 GlassFish 4.1.1 的 zip 文件,解压后,我使用终端使用asadmin start-domain命令启动服务器。它给了我这个错误:
Traceback (most recent call last):
File "/usr/local/bin/asadmin", line 260, in <module> autoscale = boto.connect_autoscale()
File "/Library/Python/2.7/site-packages/boto/__init__.py", line 208, in connect_autoscale**kwargs)
File "/Library/Python/2.7/site-packages/boto/ec2/autoscale/__init__.py", line 115, in __init__profile_name=profile_name)
File "/Library/Python/2.7/site-packages/boto/connection.py", line 1100, in __init__provider=provider)
File "/Library/Python/2.7/site-packages/boto/connection.py", line 569, in __init__host, config, self.provider, self._required_auth_capability())
File "/Library/Python/2.7/site-packages/boto/auth.py", line 997, in get_auth_handler 'Check your credentials' % (len(names), str(names))) boto.exception.NoAuthHandlerFound: No handler was ready to authenticate. 1 handlers were checked. ['HmacAuthV4Handler'] Check your credentials
Run Code Online (Sandbox Code Playgroud)
我正在使用 MacOS Sierra …
glassfish ×10
java ×5
ejb ×2
jakarta-ee ×2
web-services ×2
applet ×1
eclipselink ×1
ejb-3.0 ×1
facelets ×1
glassfish-3 ×1
httpserver ×1
jdbc ×1
jetty ×1
jsf ×1
macos-sierra ×1
mysql ×1
netbeans ×1
rmi ×1
scalability ×1
security ×1
webserver ×1